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

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

Issue 8772033: Adds support for the GL_ANGLE_texture_usage and GL_EXT_texture_storage (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years 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
===================================================================
--- gpu/command_buffer/service/texture_manager.h (revision 112643)
+++ gpu/command_buffer/service/texture_manager.h (working copy)
@@ -40,6 +40,7 @@
mag_filter_(GL_LINEAR),
wrap_s_(GL_REPEAT),
wrap_t_(GL_REPEAT),
+ usage_(GL_NONE),
max_level_set_(-1),
texture_complete_(false),
cube_complete_(false),
@@ -47,7 +48,8 @@
has_been_bound_(false),
framebuffer_attachment_count_(0),
owned_(true),
- stream_texture_(false) {
+ stream_texture_(false),
+ immutable_(false) {
}
GLenum min_filter() const {
@@ -66,6 +68,10 @@
return wrap_t_;
}
+ GLenum usage() const {
+ return usage_;
+ }
+
int num_uncleared_mips() const {
return num_uncleared_mips_;
}
@@ -169,6 +175,14 @@
return stream_texture_;
}
+ void SetImmutable(bool immutable) {
+ immutable_ = immutable;
greggman 2011/12/03 01:41:01 DCHECK(!immutable_) ?
+ }
+
+ bool IsImmutable() {
+ return immutable_;
+ }
+
// Whether a particular level/face is cleared.
bool IsLevelCleared(GLenum target, GLint level);
@@ -239,7 +253,7 @@
const FeatureInfo* feature_info, GLenum pname, GLint param);
// Makes each of the mip levels as though they were generated.
- bool MarkMipmapsGenerated(const FeatureInfo* feature_info);
+ bool MarkMipmapsGenerated(const FeatureInfo* feature_info, bool cleared);
void MarkAsDeleted() {
service_id_ = 0;
@@ -282,6 +296,7 @@
GLenum mag_filter_;
GLenum wrap_s_;
GLenum wrap_t_;
+ GLenum usage_;
// The maximum level that has been set.
GLint max_level_set_;
@@ -308,6 +323,10 @@
// Whether this is a special streaming texture.
bool stream_texture_;
+ // Whether the texture is immutable and no further changes to the format
+ // or dimensions of the texture object can be made.
+ bool immutable_;
+
DISALLOW_COPY_AND_ASSIGN(TextureInfo);
};
@@ -344,6 +363,10 @@
}
}
+ // Returns the maxium number of levels a texture of the given size can have.
+ static GLsizei ComputeMipMapCount(
+ GLsizei width, GLsizei height, GLsizei depth);
+
// Checks if a dimensions are valid for a given target.
bool ValidForTarget(
const FeatureInfo* feature_info,
@@ -385,7 +408,8 @@
// Makes each of the mip levels as though they were generated.
// Returns false if that's not allowed for the given texture.
- bool MarkMipmapsGenerated(const FeatureInfo* feature_info, TextureInfo* info);
+ bool MarkMipmapsGenerated(const FeatureInfo* feature_info, TextureInfo* info,
+ bool cleared);
// Clears any uncleared renderable levels.
bool ClearRenderableLevels(GLES2Decoder* decoder, TextureInfo* info);

Powered by Google App Engine
This is Rietveld 408576698