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

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: 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
Index: src/gpu/gl/GrGLTexture.h
diff --git a/src/gpu/gl/GrGLTexture.h b/src/gpu/gl/GrGLTexture.h
index 11d63531cf48225c06bd52188105cf4adafb7119..5c64eafe29e6fdc00501bc8b51e53fa771ec91e1 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"
/**
* A ref counted tex id that deletes the texture in its destructor.
@@ -62,11 +63,7 @@ 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&);
+ GrGLTexture(GrGpuGL*, const GrSurfaceDesc&, const IDDesc&);
virtual ~GrGLTexture() { this->release(); }
@@ -89,7 +86,14 @@ 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*, const GrSurfaceDesc&, const IDDesc&, Derived);
+
+ void init(const GrSurfaceDesc&, const IDDesc&);
+
virtual void onAbandon() SK_OVERRIDE;
virtual void onRelease() SK_OVERRIDE;
@@ -98,8 +102,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