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 03b4598b6c478aa973ece126d3741d00f21587bf..2c938d1998a64fe6717833138b3450f5e45b4932 100644 |
--- a/gpu/command_buffer/service/texture_manager.h |
+++ b/gpu/command_buffer/service/texture_manager.h |
@@ -24,6 +24,10 @@ |
#include "ui/gfx/geometry/rect.h" |
#include "ui/gl/gl_image.h" |
+namespace gl { |
+class GLStreamTextureImage; |
+} |
+ |
namespace gpu { |
namespace gles2 { |
@@ -167,6 +171,14 @@ class GPU_EXPORT Texture { |
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. |
+ void SetLevelStreamTextureImage(GLenum target, |
+ GLint level, |
+ gl::GLStreamTextureImage* image, |
+ ImageState state); |
+ |
// Get the image associated with a particular level. Returns NULL if level |
// does not exist. |
gl::GLImage* GetLevelImage(GLint target, |
@@ -174,6 +186,11 @@ class GPU_EXPORT Texture { |
ImageState* state) const; |
gl::GLImage* GetLevelImage(GLint target, GLint level) const; |
+ // Like GetLevelImage, but will return NULL if the image wasn't set via |
+ // a call to SetLevelStreamTextureImage. |
+ gl::GLStreamTextureImage* GetLevelStreamTextureImage(GLint target, |
+ GLint level) const; |
+ |
bool HasImages() const { |
return has_images_; |
} |
@@ -276,6 +293,7 @@ class GPU_EXPORT Texture { |
GLenum format; |
GLenum type; |
scoped_refptr<gl::GLImage> image; |
+ scoped_refptr<gl::GLStreamTextureImage> stream_texture_image; |
ImageState image_state; |
uint32_t estimated_size; |
bool internal_workaround; |
@@ -291,6 +309,17 @@ class GPU_EXPORT Texture { |
std::vector<LevelInfo> level_infos; |
}; |
+ // Helper for SetLevel*Image. |stream_texture_image| may be null. |
+ void SetLevelImageInternal(GLenum target, |
+ GLint level, |
+ gl::GLImage* image, |
+ gl::GLStreamTextureImage* stream_texture_image, |
+ ImageState state); |
+ |
+ // Helper for GetLevel*Image. 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. |
void SetLevelInfo(GLenum target, |
GLint level, |
@@ -851,6 +880,12 @@ class GPU_EXPORT TextureManager : public base::trace_event::MemoryDumpProvider { |
gl::GLImage* image, |
Texture::ImageState state); |
+ void SetLevelStreamTextureImage(TextureRef* ref, |
+ GLenum target, |
+ GLint level, |
+ gl::GLStreamTextureImage* image, |
+ Texture::ImageState state); |
+ |
size_t GetSignatureSize() const; |
void AddToSignature( |