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

Unified Diff: gpu/command_buffer/service/texture_manager.h

Issue 1401423003: Re-land: ui: Move GLImage::BindTexImage fallback from GLImage implementations to GLES2CmdDecoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix stream texture issue Created 5 years, 2 months 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
« no previous file with comments | « gpu/command_buffer/service/texture_definition.cc ('k') | gpu/command_buffer/service/texture_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..33cd54ad225b682f962f69e169f49e67c94cef86 100644
--- a/gpu/command_buffer/service/texture_manager.h
+++ b/gpu/command_buffer/service/texture_manager.h
@@ -39,6 +39,22 @@ class TextureRef;
// jointly owned by possibly multiple TextureRef.
class GPU_EXPORT Texture {
public:
+ enum ImageState {
+ // If an image is associated with the texture and image state is UNBOUND,
+ // then sampling out of the texture or using it as a target for drawing
+ // will not read/write from/to the image.
+ UNBOUND,
+ // If image state is BOUND, then sampling from the texture will return the
+ // contents of the image and using it as a target will modify the image.
+ BOUND,
+ // Image state is set to COPIED if the contents of the image has been
+ // copied to the texture. Sampling from the texture will be equivalent
+ // to sampling out the image (assuming image has not been changed since
+ // it was copied). Using the texture as a target for drawing will only
+ // modify the texture and not the image.
+ COPIED
+ };
+
explicit Texture(GLuint service_id);
GLenum min_filter() const {
@@ -133,8 +149,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 +218,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 +264,7 @@ class GPU_EXPORT Texture {
GLenum format;
GLenum type;
scoped_refptr<gfx::GLImage> image;
+ ImageState image_state;
uint32 estimated_size;
};
@@ -362,13 +385,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 +806,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;
« no previous file with comments | « gpu/command_buffer/service/texture_definition.cc ('k') | gpu/command_buffer/service/texture_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698