Chromium Code Reviews| Index: gpu/command_buffer/service/texture_manager.h |
| diff --git a/gpu/command_buffer/service/texture_manager.h b/gpu/command_buffer/service/texture_manager.h |
| index 11c8b6305050b6bff3fb6abacfa2c52b5bddf6e5..04b28fa298bf210d907c5d6a37753e073c4f9317 100644 |
| --- a/gpu/command_buffer/service/texture_manager.h |
| +++ b/gpu/command_buffer/service/texture_manager.h |
| @@ -45,16 +45,27 @@ class TextureRef; |
| class GPU_EXPORT TextureBase { |
| public: |
| - explicit TextureBase(GLuint service_id); |
| + TextureBase(GLuint service_id); |
|
piman
2016/11/22 23:06:10
nit: keep explicit
Geoff Lang
2016/11/23 15:08:52
Whoops, removed the wrong explicit.
|
| virtual ~TextureBase(); |
| // The service side OpenGL id of the texture. |
| GLuint service_id() const { return service_id_; } |
| + // Returns the target this texure was first bound to or 0 if it has not |
| + // been bound. Once a texture is bound to a specific target it can never be |
| + // bound to a different target. |
| + GLenum target() const { return target_; } |
| + |
| protected: |
| // The id of the texture. |
| GLuint service_id_; |
| + // The target. 0 if unset, otherwise GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP. |
| + // Or GL_TEXTURE_2D_ARRAY or GL_TEXTURE_3D (for GLES3). |
| + GLenum target_; |
| + |
| + void SetTarget(GLenum target); |
| + |
| void DeleteFromMailboxManager(); |
| private: |
| @@ -71,7 +82,7 @@ class GPU_EXPORT TextureBase { |
| class TexturePassthrough final : public TextureBase, |
| public base::RefCounted<TexturePassthrough> { |
| public: |
| - explicit TexturePassthrough(GLuint service_id); |
| + explicit TexturePassthrough(GLuint service_id, GLenum target); |
| // Notify the texture that the context is lost and it shouldn't delete the |
| // native GL texture in the destructor |
| @@ -195,13 +206,6 @@ class GPU_EXPORT Texture final : public TextureBase { |
| owned_service_id_ = service_id; |
| } |
| - // Returns the target this texure was first bound to or 0 if it has not |
| - // been bound. Once a texture is bound to a specific target it can never be |
| - // bound to a different target. |
| - GLenum target() const { |
| - return target_; |
| - } |
| - |
| bool SafeToRenderFrom() const { |
| return cleared_; |
| } |
| @@ -593,10 +597,6 @@ class GPU_EXPORT Texture final : public TextureBase { |
| int num_uncleared_mips_; |
| int num_npot_faces_; |
| - // The target. 0 if unset, otherwise GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP. |
| - // Or GL_TEXTURE_2D_ARRAY or GL_TEXTURE_3D (for GLES3). |
| - GLenum target_; |
| - |
| // Texture parameters. |
| SamplerState sampler_state_; |
| GLenum usage_; |