Index: include/gpu/GrRenderTarget.h |
diff --git a/include/gpu/GrRenderTarget.h b/include/gpu/GrRenderTarget.h |
index b8e30d905c55fb2f62dc1d0938dd902e65e4b7a8..e0f11999f44148de0560d7b61ba9e7b825a38da4 100644 |
--- a/include/gpu/GrRenderTarget.h |
+++ b/include/gpu/GrRenderTarget.h |
@@ -12,36 +12,21 @@ |
#include "SkRect.h" |
class GrStencilBuffer; |
-class GrTexture; |
/** |
* GrRenderTarget represents a 2D buffer of pixels that can be rendered to. |
* A context's render target is set by setRenderTarget(). Render targets are |
- * created by a createTexture with the kRenderTarget_TextureFlag flag. |
+ * created by a createTexture with the kRenderTarget_SurfaceFlag flag. |
* Additionally, GrContext provides methods for creating GrRenderTargets |
* that wrap externally created render targets. |
*/ |
-class GrRenderTarget : public GrSurface { |
+class GrRenderTarget : virtual public GrSurface { |
brucedawson
2015/07/15 17:27:33
Note that the use of virtual here makes the call t
|
public: |
SK_DECLARE_INST_COUNT(GrRenderTarget) |
- // GrResource overrides |
- virtual size_t gpuMemorySize() const SK_OVERRIDE; |
- |
// GrSurface overrides |
- /** |
- * @return the texture associated with the render target, may be NULL. |
- */ |
- virtual GrTexture* asTexture() SK_OVERRIDE { return fTexture; } |
- virtual const GrTexture* asTexture() const SK_OVERRIDE { return fTexture; } |
- |
- /** |
- * @return this render target. |
- */ |
virtual GrRenderTarget* asRenderTarget() SK_OVERRIDE { return this; } |
- virtual const GrRenderTarget* asRenderTarget() const SK_OVERRIDE { |
- return this; |
- } |
+ virtual const GrRenderTarget* asRenderTarget() const SK_OVERRIDE { return this; } |
// GrRenderTarget |
/** |
@@ -134,11 +119,9 @@ public: |
protected: |
GrRenderTarget(GrGpu* gpu, |
bool isWrapped, |
- GrTexture* texture, |
const GrSurfaceDesc& desc) |
: INHERITED(gpu, isWrapped, desc) |
- , fStencilBuffer(NULL) |
- , fTexture(texture) { |
+ , fStencilBuffer(NULL) { |
fResolveRect.setLargestInverted(); |
} |
@@ -147,15 +130,7 @@ protected: |
virtual void onRelease() SK_OVERRIDE; |
private: |
- friend class GrTexture; |
- // called by ~GrTexture to remove the non-ref'ed back ptr. |
- void owningTextureDestroyed() { |
- SkASSERT(fTexture); |
- fTexture = NULL; |
- } |
- |
GrStencilBuffer* fStencilBuffer; |
- GrTexture* fTexture; // not ref'ed |
SkIRect fResolveRect; |