diff options
author | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-07 17:18:37 +0000 |
---|---|---|
committer | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-07 17:18:37 +0000 |
commit | 656dcaad7854f685618c39647cb1eda818a86d43 (patch) | |
tree | 078ed9a3a9c581a8ff2e2da2a79d6aefbb21d91f /gpu/command_buffer/service/texture_manager.cc | |
parent | 3651cf802999c8ae4532a23db254e7249f45c589 (diff) | |
download | chromium_src-656dcaad7854f685618c39647cb1eda818a86d43.zip chromium_src-656dcaad7854f685618c39647cb1eda818a86d43.tar.gz chromium_src-656dcaad7854f685618c39647cb1eda818a86d43.tar.bz2 |
A few more changes for conformance tests.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/1985006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46699 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/service/texture_manager.cc')
-rw-r--r-- | gpu/command_buffer/service/texture_manager.cc | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/gpu/command_buffer/service/texture_manager.cc b/gpu/command_buffer/service/texture_manager.cc index 326d2b3..e854faf 100644 --- a/gpu/command_buffer/service/texture_manager.cc +++ b/gpu/command_buffer/service/texture_manager.cc @@ -199,9 +199,9 @@ void TextureManager::TextureInfo::Update() { npot_ = false; for (size_t ii = 0; ii < level_infos_.size(); ++ii) { const TextureInfo::LevelInfo& info = level_infos_[ii][0]; - if (((info.width & (info.width - 1)) != 0) || - ((info.height & (info.height - 1)) != 0) || - ((info.depth & (info.depth - 1)) != 0)) { + if (GLES2Util::IsNPOT(info.width) || + GLES2Util::IsNPOT(info.height) || + GLES2Util::IsNPOT(info.depth)) { npot_ = true; break; } @@ -277,6 +277,26 @@ TextureManager::TextureManager( } } +bool TextureManager::ValidForTarget( + GLenum target, GLint level, + GLsizei width, GLsizei height, GLsizei depth) { + GLsizei max_size = MaxSizeForTarget(target); + return level >= 0 && + width >= 0 && + height >= 0 && + depth >= 0 && + level < MaxLevelsForTarget(target) && + width <= max_size && + height <= max_size && + depth <= max_size && + (level == 0 || + (!GLES2Util::IsNPOT(width) && + !GLES2Util::IsNPOT(height) && + !GLES2Util::IsNPOT(depth))) && + (target != GL_TEXTURE_CUBE_MAP || (width == height && depth == 1)) && + (target != GL_TEXTURE_2D || (depth == 1)); +} + TextureManager::TextureInfo* TextureManager::CreateTextureInfo( GLuint client_id, GLuint service_id) { TextureInfo::Ref info(new TextureInfo(service_id)); |