From 091f60c2a0e4504c017b8a67ff96a0e829519b14 Mon Sep 17 00:00:00 2001 From: bsalomon Date: Tue, 10 Nov 2015 11:54:56 -0800 Subject: Use a struct for client GL texture handles Review URL: https://codereview.chromium.org/1429863009 --- src/gpu/gl/GrGLTexture.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/gpu/gl/GrGLTexture.h') diff --git a/src/gpu/gl/GrGLTexture.h b/src/gpu/gl/GrGLTexture.h index 40a68eb9e9..8366a8dab0 100644 --- a/src/gpu/gl/GrGLTexture.h +++ b/src/gpu/gl/GrGLTexture.h @@ -28,8 +28,7 @@ public: }; struct IDDesc { - GrGLenum fTarget; - GrGLuint fTextureID; + GrGLTextureInfo fInfo; GrGpuResource::LifeCycle fLifeCycle; }; @@ -51,9 +50,9 @@ public: fTexParamsTimestamp = timestamp; } - GrGLuint textureID() const { return fTextureID; } + GrGLuint textureID() const { return fInfo.fID; } - GrGLenum target() const { return fTarget; } + GrGLenum target() const { return fInfo.fTarget; } protected: // The public constructor registers this object with the cache. However, only the most derived @@ -72,8 +71,9 @@ protected: private: TexParams fTexParams; GrGpu::ResetTimestamp fTexParamsTimestamp; - GrGLenum fTarget; - GrGLuint fTextureID; + // 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. -- cgit v1.2.3