blob: 69c94b034ea4ced7ef27ff4ed673be66f302ba83 [file] [log] [blame]
Stephen White9d421922019-08-14 15:07:42 -04001/*
2 * Copyright 2019 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef GrDawnTextureRenderTarget_DEFINED
9#define GrDawnTextureRenderTarget_DEFINED
10
11#include "src/gpu/dawn/GrDawnRenderTarget.h"
12#include "src/gpu/dawn/GrDawnTexture.h"
13
14class GrDawnGpu;
15
16#ifdef SK_BUILD_FOR_WIN
17// Windows gives bogus warnings about inheriting asTexture/asRenderTarget via dominance.
18#pragma warning(push)
19#pragma warning(disable: 4250)
20#endif
21
22class GrDawnTextureRenderTarget : public GrDawnTexture, public GrDawnRenderTarget {
23public:
24 GrDawnTextureRenderTarget(GrDawnGpu* gpu,
25 const SkISize& size,
26 GrPixelConfig config,
27 const dawn::TextureView textureView,
28 int sampleCnt,
29 const GrDawnImageInfo& info,
30 GrMipMapsStatus mipMapsStatus);
31
32 bool canAttemptStencilAttachment() const override;
33
34 GrBackendFormat backendFormat() const override { return GrDawnTexture::backendFormat(); }
35
36protected:
37 void onAbandon() override {
38 GrDawnRenderTarget::onAbandon();
39 GrDawnTexture::onAbandon();
40 }
41
42 void onRelease() override {
43 GrDawnRenderTarget::onRelease();
44 GrDawnTexture::onRelease();
45 }
46
47private:
48 size_t onGpuMemorySize() const override;
49};
50
51#ifdef SK_BUILD_FOR_WIN
52#pragma warning(pop)
53#endif
54
55#endif