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 int sampleCnt, 27 const GrDawnTextureInfo& textureInfo, 28 GrMipmapStatus mipmapStatus); 29 30 bool canAttemptStencilAttachment(bool useMSAASurface) const override; 31 backendFormat()32 GrBackendFormat backendFormat() const override { return GrDawnTexture::backendFormat(); } 33 34 protected: onAbandon()35 void onAbandon() override { 36 GrDawnRenderTarget::onAbandon(); 37 GrDawnTexture::onAbandon(); 38 } 39 onRelease()40 void onRelease() override { 41 GrDawnRenderTarget::onRelease(); 42 GrDawnTexture::onRelease(); 43 } 44 45 private: 46 size_t onGpuMemorySize() const override; 47 }; 48 49 #ifdef SK_BUILD_FOR_WIN 50 #pragma warning(pop) 51 #endif 52 53 #endif 54