| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 | 8 |
| 9 #ifndef GrGLTextureRenderTarget_DEFINED | 9 #ifndef GrGLTextureRenderTarget_DEFINED |
| 10 #define GrGLTextureRenderTarget_DEFINED | 10 #define GrGLTextureRenderTarget_DEFINED |
| 11 | 11 |
| 12 #include "GrGLGpu.h" |
| 12 #include "GrGLTexture.h" | 13 #include "GrGLTexture.h" |
| 13 #include "GrGLRenderTarget.h" | 14 #include "GrGLRenderTarget.h" |
| 14 | 15 |
| 15 class GrGLGpu; | 16 class GrGLGpu; |
| 16 | 17 |
| 17 #ifdef SK_BUILD_FOR_WIN | 18 #ifdef SK_BUILD_FOR_WIN |
| 18 // Windows gives bogus warnings about inheriting asTexture/asRenderTarget via do
minance. | 19 // Windows gives bogus warnings about inheriting asTexture/asRenderTarget via do
minance. |
| 19 #pragma warning(push) | 20 #pragma warning(push) |
| 20 #pragma warning(disable: 4250) | 21 #pragma warning(disable: 4250) |
| 21 #endif | 22 #endif |
| 22 | 23 |
| 23 class GrGLTextureRenderTarget : public GrGLTexture, public GrGLRenderTarget { | 24 class GrGLTextureRenderTarget : public GrGLTexture, public GrGLRenderTarget { |
| 24 public: | 25 public: |
| 25 // We're virtually derived from GrSurface (via both GrGLTexture and GrGLRend
erTarget) so its | 26 // We're virtually derived from GrSurface (via both GrGLTexture and GrGLRend
erTarget) so its |
| 26 // constructor must be explicitly called. | 27 // constructor must be explicitly called. |
| 27 GrGLTextureRenderTarget(GrGLGpu* gpu, | 28 GrGLTextureRenderTarget(GrGLGpu* gpu, |
| 28 const GrSurfaceDesc& desc, | 29 const GrSurfaceDesc& desc, |
| 29 const GrGLTexture::IDDesc& texIDDesc, | 30 const GrGLTexture::IDDesc& texIDDesc, |
| 30 const GrGLRenderTarget::IDDesc& rtIDDesc) | 31 const GrGLRenderTarget::IDDesc& rtIDDesc) |
| 31 : GrSurface(gpu, texIDDesc.fLifeCycle, desc) | 32 : GrSurface(gpu, texIDDesc.fLifeCycle, desc) |
| 32 , GrGLTexture(gpu, desc, texIDDesc, GrGLTexture::kDerived) | 33 , GrGLTexture(gpu, desc, texIDDesc, GrGLTexture::kDerived) |
| 33 , GrGLRenderTarget(gpu, desc, rtIDDesc, GrGLRenderTarget::kDerived) { | 34 , GrGLRenderTarget(gpu, desc, rtIDDesc, GrGLRenderTarget::kDerived) { |
| 34 this->registerWithCache(); | 35 this->registerWithCache(); |
| 35 } | 36 } |
| 36 | 37 |
| 38 void dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const override
; |
| 39 |
| 37 protected: | 40 protected: |
| 38 void onAbandon() override { | 41 void onAbandon() override { |
| 39 GrGLRenderTarget::onAbandon(); | 42 GrGLRenderTarget::onAbandon(); |
| 40 GrGLTexture::onAbandon(); | 43 GrGLTexture::onAbandon(); |
| 41 } | 44 } |
| 42 | 45 |
| 43 void onRelease() override { | 46 void onRelease() override { |
| 44 GrGLRenderTarget::onRelease(); | 47 GrGLRenderTarget::onRelease(); |
| 45 GrGLTexture::onRelease(); | 48 GrGLTexture::onRelease(); |
| 46 } | 49 } |
| 47 | 50 |
| 48 private: | 51 private: |
| 49 // GrGLRenderTarget accounts for the texture's memory and any MSAA renderbuf
fer's memory. | 52 // GrGLRenderTarget accounts for the texture's memory and any MSAA renderbuf
fer's memory. |
| 50 size_t onGpuMemorySize() const override { | 53 size_t onGpuMemorySize() const override { |
| 51 return GrGLRenderTarget::onGpuMemorySize(); | 54 return GrGLRenderTarget::onGpuMemorySize(); |
| 52 } | 55 } |
| 53 | 56 |
| 54 }; | 57 }; |
| 55 | 58 |
| 56 #ifdef SK_BUILD_FOR_WIN | 59 #ifdef SK_BUILD_FOR_WIN |
| 57 #pragma warning(pop) | 60 #pragma warning(pop) |
| 58 #endif | 61 #endif |
| 59 | 62 |
| 60 #endif | 63 #endif |
| OLD | NEW |