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

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

Issue 2014313002: StreamTextureImages can now override a Texture's service id (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: liberato's comments Created 4 years, 7 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
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 5d1a518236207dd29326431762976fca8e4101a4..0e93a91e8ccb31fc9a5d52184a1d0d763863b774 100644
--- a/gpu/command_buffer/service/texture_manager.h
+++ b/gpu/command_buffer/service/texture_manager.h
@@ -153,12 +153,6 @@ class GPU_EXPORT Texture {
owned_service_id_ = service_id;
}
- // Causes us to report |service_id| as our service id, but does not delete
- // it when we are destroyed. Will rebind any OES_EXTERNAL texture units to
- // our new service id in all contexts. If |service_id| is zero, then we
- // revert to our original service id.
- void SetUnownedServiceId(GLuint 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.
@@ -181,19 +175,25 @@ class GPU_EXPORT Texture {
bool GetLevelType(
GLint target, GLint level, GLenum* type, GLenum* internal_format) const;
- // Set the image for a particular level.
+ // Set the image for a particular level. If |image| is not the same as the
+ // currently bound image, and the currently bound image is a
+ // GLStreamTextureImage, then |service_id_| will be reset back to
+ // |owned_service_id_|.
void SetLevelImage(GLenum target,
GLint level,
gl::GLImage* image,
ImageState state);
- // Set the GLStreamTextureImage for a particular level. This is identical
- // to SetLevelImage, but it also permits GetLevelStreamTextureImage to return
- // the image.
+ // Set the GLStreamTextureImage for a particular level. This is like
+ // SetLevelImage, but it also makes it optional to override |service_id_| with
+ // a texture bound to the stream texture, and permits
+ // GetLevelStreamTextureImage to return the image. See
+ // SetStreamTextureServiceId() for the details of how |service_id| is used.
void SetLevelStreamTextureImage(GLenum target,
GLint level,
GLStreamTextureImage* image,
- ImageState state);
+ ImageState state,
+ GLuint service_id);
// Get the image associated with a particular level. Returns NULL if level
// does not exist.
@@ -358,6 +358,12 @@ class GPU_EXPORT Texture {
GLenum type,
const gfx::Rect& cleared_rect);
+ // Causes us to report |service_id| as our service id, but does not delete
+ // it when we are destroyed. Will rebind any OES_EXTERNAL texture units to
+ // our new service id in all contexts. If |service_id| is zero, then we
+ // revert to |owned_service_id_|.
+ void SetStreamTextureServiceId(GLuint service_id);
+
void MarkLevelAsInternalWorkaround(GLenum target, GLint level);
// In GLES2 "texture complete" means it has all required mips for filtering
@@ -512,8 +518,7 @@ class GPU_EXPORT Texture {
void IncrementManagerServiceIdGeneration();
// Return the service id of the texture that we will delete when we are
- // destroyed. Normally, this is the same as service_id(), unless it is
- // overridden by SetUnownedServiceId.
+ // destroyed.
GLuint owned_service_id() const { return owned_service_id_; }
GLenum GetCompatibilitySwizzleForChannel(GLenum channel);
@@ -532,16 +537,14 @@ class GPU_EXPORT Texture {
// one of refs_.
TextureRef* memory_tracking_ref_;
- // The id of the texure
+ // The id of the texture.
GLuint service_id_;
- // The id of the texture that we are responsible for deleting. Normally,
- // this is the same as service_id_, unless a call to SetUnownedServiceId
- // overrides it. In that case, we'll use the overridden service id (stored
- // in |service_id_|) for all purposes except deleting the texture name.
- // Whoever calls SetUnownedServiceId is assumed to handle deleting that id,
- // and only after we are either deleted or told to stop using it via
- // another call to SetUnownedServiceId.
+ // The id of the texture that we are responsible for deleting. Normally, this
+ // is the same as |service_id_|, unless a GLStreamTextureImage with its own
+ // service id is bound. In that case the GLStreamTextureImage service id is
+ // stored in |service_id_| and overrides the owned service id for all purposes
+ // except deleting the texture name.
GLuint owned_service_id_;
// Whether all renderable mips of this texture have been cleared.
@@ -936,7 +939,8 @@ class GPU_EXPORT TextureManager : public base::trace_event::MemoryDumpProvider {
GLenum target,
GLint level,
GLStreamTextureImage* image,
- Texture::ImageState state);
+ Texture::ImageState state,
+ GLuint service_id);
size_t GetSignatureSize() const;
« no previous file with comments | « no previous file | gpu/command_buffer/service/texture_manager.cc » ('j') | gpu/command_buffer/service/texture_manager_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698