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 a04cfa2a1f80315b209d05479f60b831d6402c82..0851df2a87f3d2c19240b572f4ab84694972a2b8 100644 |
| --- a/gpu/command_buffer/service/texture_manager.h |
| +++ b/gpu/command_buffer/service/texture_manager.h |
| @@ -39,6 +39,8 @@ class TextureRef; |
| // jointly owned by possibly multiple TextureRef. |
| class GPU_EXPORT Texture { |
| public: |
| + enum ImageState { UNBOUND, BOUND, COPIED }; |
|
no sievers
2015/10/15 21:52:44
nit: mind putting some comments with each enum abo
no sievers
2015/10/15 21:52:44
is the COPIED state actually used for anything?
reveman
2015/10/15 22:56:16
Done. COPIED is used. See the comment in latest pa
|
| + |
| explicit Texture(GLuint service_id); |
| GLenum min_filter() const { |
| @@ -133,8 +135,17 @@ class GPU_EXPORT Texture { |
| bool GetLevelType( |
| GLint target, GLint level, GLenum* type, GLenum* internal_format) const; |
| - // Get the image bound to a particular level. Returns NULL if level |
| + // Set the image for a particular level. |
| + void SetLevelImage(GLenum target, |
| + GLint level, |
| + gfx::GLImage* image, |
| + ImageState state); |
| + |
| + // Get the image associated with a particular level. Returns NULL if level |
| // does not exist. |
| + gfx::GLImage* GetLevelImage(GLint target, |
| + GLint level, |
| + ImageState* state) const; |
| gfx::GLImage* GetLevelImage(GLint target, GLint level) const; |
| bool HasImages() const { |
| @@ -193,9 +204,6 @@ class GPU_EXPORT Texture { |
| // Initialize TEXTURE_MAX_ANISOTROPY to 1 if we haven't done so yet. |
| void InitTextureMaxAnisotropyIfNeeded(GLenum target); |
| - void OnWillModifyPixels(); |
| - void OnDidModifyPixels(); |
| - |
| void DumpLevelMemory(base::trace_event::ProcessMemoryDump* pmd, |
| uint64_t client_tracing_id, |
| const std::string& dump_name) const; |
| @@ -242,6 +250,7 @@ class GPU_EXPORT Texture { |
| GLenum format; |
| GLenum type; |
| scoped_refptr<gfx::GLImage> image; |
| + ImageState image_state; |
| uint32 estimated_size; |
| }; |
| @@ -362,13 +371,6 @@ class GPU_EXPORT Texture { |
| // Update info about this texture. |
| void Update(const FeatureInfo* feature_info); |
| - // Set the image for a particular level. |
| - void SetLevelImage( |
| - const FeatureInfo* feature_info, |
| - GLenum target, |
| - GLint level, |
| - gfx::GLImage* image); |
| - |
| // Appends a signature for the given level. |
| void AddToSignature( |
| const FeatureInfo* feature_info, |
| @@ -790,11 +792,11 @@ class GPU_EXPORT TextureManager : public base::trace_event::MemoryDumpProvider { |
| return memory_type_tracker_->GetMemRepresented(); |
| } |
| - void SetLevelImage( |
| - TextureRef* ref, |
| - GLenum target, |
| - GLint level, |
| - gfx::GLImage* image); |
| + void SetLevelImage(TextureRef* ref, |
| + GLenum target, |
| + GLint level, |
| + gfx::GLImage* image, |
| + Texture::ImageState state); |
| size_t GetSignatureSize() const; |