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/ganesh/dawn/GrDawnRenderTarget.h" 12 #include "src/gpu/ganesh/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 std::string_view label); 30 31 bool canAttemptStencilAttachment(bool useMSAASurface) 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 onSetLabel()49 void onSetLabel() override{} 50 }; 51 52 #ifdef SK_BUILD_FOR_WIN 53 #pragma warning(pop) 54 #endif 55 56 #endif 57