summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service/texture_manager.h
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-09 02:40:07 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-09 02:40:07 +0000
commit02965c2978b3d9193c99e65b24f0fb4e4e3f08cc (patch)
treeca4b0b8976092b95b75c2e36e64bebb023912488 /gpu/command_buffer/service/texture_manager.h
parent533fe51c4ddb18c4d876c475bb6c2c720beb971b (diff)
downloadchromium_src-02965c2978b3d9193c99e65b24f0fb4e4e3f08cc.zip
chromium_src-02965c2978b3d9193c99e65b24f0fb4e4e3f08cc.tar.gz
chromium_src-02965c2978b3d9193c99e65b24f0fb4e4e3f08cc.tar.bz2
Refactor a bunch of Texture related GPU code
Rename info->texture Move TexParameter guts into TextureManager BUG=none Review URL: https://chromiumcodereview.appspot.com/12647003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187120 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/service/texture_manager.h')
-rw-r--r--gpu/command_buffer/service/texture_manager.h46
1 files changed, 25 insertions, 21 deletions
diff --git a/gpu/command_buffer/service/texture_manager.h b/gpu/command_buffer/service/texture_manager.h
index b756e7a..18dda7a 100644
--- a/gpu/command_buffer/service/texture_manager.h
+++ b/gpu/command_buffer/service/texture_manager.h
@@ -430,13 +430,13 @@ class GPU_EXPORT TextureManager {
// Parameters:
// target: GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP
// max_levels: The maximum levels this type of target can have.
- void SetInfoTarget(
- Texture* info,
+ void SetTarget(
+ Texture* texture,
GLenum target);
// Set the info for a particular level in a TexureInfo.
void SetLevelInfo(
- Texture* info,
+ Texture* texture,
GLenum target,
GLint level,
GLenum internal_format,
@@ -449,32 +449,36 @@ class GPU_EXPORT TextureManager {
bool cleared);
// Save the texture definition and leave it undefined.
- TextureDefinition* Save(Texture* info);
+ TextureDefinition* Save(Texture* texture);
// Redefine all the levels from the texture definition.
- bool Restore(Texture* info,
- TextureDefinition* definition);
+ bool Restore(
+ const char* function_name,
+ GLES2Decoder* decoder,
+ Texture* texture,
+ TextureDefinition* definition);
// Sets a mip as cleared.
- void SetLevelCleared(Texture* info, GLenum target,
+ void SetLevelCleared(Texture* texture, GLenum target,
GLint level, bool cleared);
// Sets a texture parameter of a Texture
// Returns GL_NO_ERROR on success. Otherwise the error to generate.
// TODO(gman): Expand to SetParameteri,f,iv,fv
- GLenum SetParameter(
- Texture* info, GLenum pname, GLint param);
+ void SetParameter(
+ const char* function_name, GLES2Decoder* decoder,
+ Texture* texture, GLenum pname, GLint param);
// Makes each of the mip levels as though they were generated.
// Returns false if that's not allowed for the given texture.
- bool MarkMipmapsGenerated(Texture* info);
+ bool MarkMipmapsGenerated(Texture* texture);
// Clears any uncleared renderable levels.
- bool ClearRenderableLevels(GLES2Decoder* decoder, Texture* info);
+ bool ClearRenderableLevels(GLES2Decoder* decoder, Texture* texture);
// Clear a specific level.
bool ClearTextureLevel(
- GLES2Decoder* decoder,Texture* info, GLenum target, GLint level);
+ GLES2Decoder* decoder,Texture* texture, GLenum target, GLint level);
// Creates a new texture info.
Texture* CreateTexture(GLuint client_id, GLuint service_id);
@@ -539,13 +543,13 @@ class GPU_EXPORT TextureManager {
}
void SetLevelImage(
- Texture* info,
+ Texture* texture,
GLenum target,
GLint level,
gfx::GLImage* image);
void AddToSignature(
- Texture* info,
+ Texture* texture,
GLenum target,
GLint level,
std::string* signature) const;
@@ -553,7 +557,7 @@ class GPU_EXPORT TextureManager {
// Transfers added will get their Texture updated at the same time
// the async transfer is bound to the real texture.
void AddPendingAsyncPixelTransfer(
- base::WeakPtr<gfx::AsyncPixelTransferState> state, Texture* info);
+ base::WeakPtr<gfx::AsyncPixelTransferState> state, Texture* texture);
void BindFinishedAsyncPixelTransfers(bool* texture_dirty,
bool* framebuffer_dirty);
@@ -565,8 +569,8 @@ class GPU_EXPORT TextureManager {
GLenum target,
GLuint* black_texture);
- void StartTracking(Texture* info);
- void StopTracking(Texture* info);
+ void StartTracking(Texture* texture);
+ void StopTracking(Texture* texture);
MemoryTypeTracker* GetMemTracker(GLenum texture_pool);
scoped_ptr<MemoryTypeTracker> memory_tracker_managed_;
@@ -575,8 +579,8 @@ class GPU_EXPORT TextureManager {
scoped_refptr<FeatureInfo> feature_info_;
// Info for each texture in the system.
- typedef base::hash_map<GLuint, scoped_refptr<Texture> > TextureInfoMap;
- TextureInfoMap texture_infos_;
+ typedef base::hash_map<GLuint, scoped_refptr<Texture> > TextureMap;
+ TextureMap textures_;
GLsizei max_texture_size_;
GLsizei max_cube_map_texture_size_;
@@ -587,9 +591,9 @@ class GPU_EXPORT TextureManager {
int num_unsafe_textures_;
int num_uncleared_mips_;
- // Counts the number of Texture allocated with 'this' as its manager.
+ // Counts the number of Textures allocated with 'this' as its manager.
// Allows to check no Texture will outlive this.
- unsigned int texture_info_count_;
+ unsigned int texture_count_;
bool have_context_;