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

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

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.cc
===================================================================
--- gpu/command_buffer/service/texture_manager.cc (revision 112643)
+++ gpu/command_buffer/service/texture_manager.cc (working copy)
@@ -11,11 +11,6 @@
namespace gpu {
namespace gles2 {
-static GLsizei ComputeMipMapCount(
- GLsizei width, GLsizei height, GLsizei depth) {
- return 1 + base::bits::Log2Floor(std::max(std::max(width, height), depth));
-}
-
static size_t GLTargetToFaceIndex(GLenum target) {
switch (target) {
case GL_TEXTURE_2D:
@@ -111,7 +106,8 @@
}
bool TextureManager::TextureInfo::MarkMipmapsGenerated(
- const FeatureInfo* feature_info) {
+ const FeatureInfo* feature_info,
+ bool cleared) {
if (!CanGenerateMipmaps(feature_info)) {
return false;
}
@@ -137,7 +133,7 @@
info1.border,
info1.format,
info1.type,
- true);
+ cleared);
}
}
@@ -368,6 +364,12 @@
case GL_TEXTURE_MAX_ANISOTROPY_EXT:
// Nothing to do for this case at the moment.
break;
+ case GL_TEXTURE_USAGE_ANGLE:
+ if (!feature_info->validators()->texture_usage.IsValid(param)) {
+ return false;
+ }
+ usage_ = param;
+ break;
default:
NOTREACHED();
return false;
@@ -789,7 +791,8 @@
bool TextureManager::MarkMipmapsGenerated(
const FeatureInfo* feature_info,
- TextureManager::TextureInfo* info) {
+ TextureManager::TextureInfo* info,
+ bool cleared) {
DCHECK(info);
if (!info->CanRender(feature_info)) {
DCHECK_NE(0, num_unrenderable_textures_);
@@ -801,7 +804,7 @@
}
num_uncleared_mips_ -= info->num_uncleared_mips();
DCHECK_GE(num_uncleared_mips_, 0);
- bool result = info->MarkMipmapsGenerated(feature_info);
+ bool result = info->MarkMipmapsGenerated(feature_info, cleared);
num_uncleared_mips_ += info->num_uncleared_mips();
if (!info->CanRender(feature_info)) {
++num_unrenderable_textures_;
@@ -867,6 +870,12 @@
return false;
}
+GLsizei TextureManager::ComputeMipMapCount(
+ GLsizei width, GLsizei height, GLsizei depth) {
+ return 1 + base::bits::Log2Floor(std::max(std::max(width, height), depth));
+}
+
+
} // namespace gles2
} // namespace gpu

Powered by Google App Engine
This is Rietveld 408576698