Index: src/gpu/gl/GrGLTexture.h |
diff --git a/src/gpu/gl/GrGLTexture.h b/src/gpu/gl/GrGLTexture.h |
index 6ee8dcfe2b6eefa5ef35cba7f9496df124938edf..05d26c8de821a07df64555a1ef9d055776e89ca6 100644 |
--- a/src/gpu/gl/GrGLTexture.h |
+++ b/src/gpu/gl/GrGLTexture.h |
@@ -16,7 +16,6 @@ |
class GrGLGpu; |
class GrGLTexture : public GrTexture { |
- |
public: |
struct TexParams { |
GrGLenum fMinFilter; |
@@ -31,11 +30,11 @@ public: |
struct IDDesc { |
GrGLTextureInfo fInfo; |
- GrGpuResource::LifeCycle fLifeCycle; |
+ GrBackendObjectOwnership fOwnership; |
}; |
- |
- GrGLTexture(GrGLGpu*, const GrSurfaceDesc&, const IDDesc&); |
- GrGLTexture(GrGLGpu*, const GrSurfaceDesc&, const IDDesc&, bool wasMipMapDataProvided); |
+ GrGLTexture(GrGLGpu*, SkBudgeted, const GrSurfaceDesc&, const IDDesc&); |
+ GrGLTexture(GrGLGpu*, SkBudgeted, const GrSurfaceDesc&, const IDDesc&, |
+ bool wasMipMapDataProvided); |
GrBackendObject getTextureHandle() const override; |
@@ -57,12 +56,14 @@ public: |
GrGLenum target() const { return fInfo.fTarget; } |
+ static GrGLTexture* CreateWrapped(GrGLGpu*, const GrSurfaceDesc&, const IDDesc&); |
protected: |
- // 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(GrGLGpu*, const GrSurfaceDesc&, const IDDesc&, Derived); |
+ // Constructor for subclasses. |
+ GrGLTexture(GrGLGpu*, const GrSurfaceDesc&, const IDDesc&); |
+ |
+ enum Wrapped { kWrapped }; |
+ // Constructor for instances wrapping backend objects. |
+ GrGLTexture(GrGLGpu*, Wrapped, const GrSurfaceDesc&, const IDDesc&); |
void init(const GrSurfaceDesc&, const IDDesc&); |
@@ -77,10 +78,7 @@ private: |
// Holds the texture target and ID. A pointer to this may be shared to external clients for |
// direct interaction with the GL object. |
GrGLTextureInfo fInfo; |
- |
- // We track this separately from GrGpuResource because this may be both a texture and a render |
- // target, and the texture may be wrapped while the render target is not. |
- LifeCycle fTextureIDLifecycle; |
+ GrBackendObjectOwnership fTextureIDOwnership; |
typedef GrTexture INHERITED; |
}; |