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..6a21b64930acb90b12b63d30fabc71411e2d357e 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,24 @@ 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 a GLStreamTextureImage was |
+ // previously set with SetLevelStreamTextureImage(), |service_id_| will be |
+ // reset 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. If |service_id| is zero, |
+ // |service_id_| will be unchanged. |
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 +357,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 |
@@ -513,7 +518,7 @@ class GPU_EXPORT Texture { |
// 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. |
+ // overridden by SetStreamTextureServiceId(). |
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 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; |