| 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..6eca1fb8cf91468b3ab60c927f12bfc8b4b629f9 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,29 @@ 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(), this will reset
|
| + // |service_id_| back to |owned_service_id_|, removing the service id override
|
| + // set by the GLStreamTextureImage.
|
| 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);
|
| +
|
| + // Set the ImageState for the image bound to the given level.
|
| + void SetLevelImageState(GLenum target, GLint level, ImageState state);
|
| +
|
|
|
| // Get the image associated with a particular level. Returns NULL if level
|
| // does not exist.
|
| @@ -342,8 +346,7 @@ class GPU_EXPORT Texture {
|
| GLStreamTextureImage* stream_texture_image,
|
| ImageState state);
|
|
|
| - // Helper for GetLevel*Image. Returns the LevelInfo for |target| and |level|
|
| - // if it's set, else NULL.
|
| + // Returns the LevelInfo for |target| and |level| if it's set, else NULL.
|
| const LevelInfo* GetLevelInfo(GLint target, GLint level) const;
|
|
|
| // Set the info for a particular level.
|
| @@ -358,6 +361,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 +521,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 +540,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 +942,13 @@ class GPU_EXPORT TextureManager : public base::trace_event::MemoryDumpProvider {
|
| GLenum target,
|
| GLint level,
|
| GLStreamTextureImage* image,
|
| - Texture::ImageState state);
|
| + Texture::ImageState state,
|
| + GLuint service_id);
|
| +
|
| + void SetLevelImageState(TextureRef* ref,
|
| + GLenum target,
|
| + GLint level,
|
| + Texture::ImageState state);
|
|
|
| size_t GetSignatureSize() const;
|
|
|
|
|