• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
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 
14 class 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 
22 class GrDawnTextureRenderTarget : public GrDawnTexture, public GrDawnRenderTarget {
23 public:
24     GrDawnTextureRenderTarget(GrDawnGpu* gpu,
25                               SkISize dimensions,
26                               const wgpu::TextureView textureView,
27                               int sampleCnt,
28                               const GrDawnTextureInfo& textureInfo,
29                               GrMipMapsStatus mipMapsStatus);
30 
31     bool canAttemptStencilAttachment() const override;
32 
backendFormat()33     GrBackendFormat backendFormat() const override { return GrDawnTexture::backendFormat(); }
34 
35 protected:
onAbandon()36     void onAbandon() override {
37         GrDawnRenderTarget::onAbandon();
38         GrDawnTexture::onAbandon();
39     }
40 
onRelease()41     void onRelease() override {
42         GrDawnRenderTarget::onRelease();
43         GrDawnTexture::onRelease();
44     }
45 
46 private:
47     size_t onGpuMemorySize() const override;
48 };
49 
50 #ifdef SK_BUILD_FOR_WIN
51 #pragma warning(pop)
52 #endif
53 
54 #endif
55