Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3670)

Unified Diff: include/gpu/GrRenderTarget.h

Issue 695813003: Add class GrGLTextureRenderTarget for GL texture/rendertarget objects (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: forgot to save file Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/GrGpuResourceRef.h ('k') | include/gpu/GrSurface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « include/gpu/GrGpuResourceRef.h ('k') | include/gpu/GrSurface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698