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

Unified Diff: src/gpu/gl/GrGLTexture.h

Issue 695813003: Add class GrGLTextureRenderTarget for GL texture/rendertarget objects (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleanup Created 6 years, 2 months 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
Index: src/gpu/gl/GrGLTexture.h
diff --git a/src/gpu/gl/GrGLTexture.h b/src/gpu/gl/GrGLTexture.h
index 11d63531cf48225c06bd52188105cf4adafb7119..2248670c0517ea4df45065eed9aff9372a81a8eb 100644
--- a/src/gpu/gl/GrGLTexture.h
+++ b/src/gpu/gl/GrGLTexture.h
@@ -10,7 +10,8 @@
#define GrGLTexture_DEFINED
#include "GrGpu.h"
-#include "GrGLRenderTarget.h"
+#include "GrTexture.h"
+#include "GrGLUtil.h"
robertphillips 2014/11/03 13:58:54 Can we move GrGLTexID into GrGLTexture.cpp ?
bsalomon 2014/11/03 15:20:14 Yup, forthcoming.
/**
* A ref counted tex id that deletes the texture in its destructor.
@@ -62,10 +63,6 @@ public:
bool fIsWrapped;
};
- // creates a texture that is also an RT
- GrGLTexture(GrGpuGL* gpu, const GrSurfaceDesc&, const IDDesc&, const GrGLRenderTarget::IDDesc&);
-
- // creates a non-RT texture
GrGLTexture(GrGpuGL* gpu, const GrSurfaceDesc&, const IDDesc&);
virtual ~GrGLTexture() { this->release(); }
@@ -89,7 +86,12 @@ public:
GrGLuint textureID() const { return (fTexIDObj.get()) ? fTexIDObj->id() : 0; }
protected:
- // overrides of GrTexture
+ // The public constructor registers this object with the cache. However, only the most derived
+ // class should register with the cache. This constructor does not do the registration and
+ // rather moves that burden onto the derived class.
+ enum Derived { kDerived };
+ GrGLTexture(GrGpuGL* gpu, const GrSurfaceDesc&, const IDDesc&, Derived);
+
virtual void onAbandon() SK_OVERRIDE;
virtual void onRelease() SK_OVERRIDE;
@@ -98,8 +100,6 @@ private:
GrGpu::ResetTimestamp fTexParamsTimestamp;
SkAutoTUnref<GrGLTexID> fTexIDObj;
- void init(GrGpuGL* gpu, const GrSurfaceDesc&, const IDDesc&, const GrGLRenderTarget::IDDesc*);
-
typedef GrTexture INHERITED;
};

Powered by Google App Engine
This is Rietveld 408576698