summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service/texture_manager_unittest.cc
diff options
context:
space:
mode:
authorjmadill <jmadill@chromium.org>2015-10-28 07:27:13 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-28 14:28:08 +0000
commit96713d46c7291a773362015d1344b140c7711631 (patch)
tree1ec74aeb042941fc25185a6d9c9a7773cbd9f55b /gpu/command_buffer/service/texture_manager_unittest.cc
parentaf70be7f4ba4ddc721c3b17362e3f67a86ddd319 (diff)
downloadchromium_src-96713d46c7291a773362015d1344b140c7711631.zip
chromium_src-96713d46c7291a773362015d1344b140c7711631.tar.gz
chromium_src-96713d46c7291a773362015d1344b140c7711631.tar.bz2
Revert of Fix WebGL 2 texture renderability check. (patchset #8 id:140001 of https://codereview.chromium.org/1412883002/ )
Reason for revert: Failing on several configs, possibly has a bug: On Windows, triggers a bug in ANGLE, should have a skip suppression: http://build.chromium.org/p/chromium.gpu.fyi/builders/Win7%20Debug%20%28NVIDIA%29/builds/11345 (assert in Renderer11.cpp in Debug) On Mac, fails for unknown reasons: http://build.chromium.org/p/chromium.gpu.fyi/builders/Mac%2010.10%20Release%20%28ATI%29/builds/5643 http://build.chromium.org/p/chromium.gpu.fyi/builders/Mac%2010.9%20Debug%20%28Intel%29/builds/21206 On Linux AMD, fails as well: http://build.chromium.org/p/chromium.gpu.fyi/builders/Linux%20Release%20%28ATI%29/builds/42849 Original issue's description: > Fix WebGL 2 texture renderability check. > > It should check from base_level and up, not 0 and up. > > BUG=429053 > TEST=conformance2/textures/misc/tex-mipmap-levels.html, gpu_unittests > R=bajones@chromium.org,kbr@chromium.org > > Committed: https://crrev.com/493f20d34a57ae22da78f798235881ff39465ae0 > Cr-Commit-Position: refs/heads/master@{#356475} TBR=bajones@chromium.org,kbr@chromium.org,sievers@chromium.org,piman@chromium.org,qiankun.miao@intel.com,zmo@google.com,zmo@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=429053 Review URL: https://codereview.chromium.org/1425943002 Cr-Commit-Position: refs/heads/master@{#356550}
Diffstat (limited to 'gpu/command_buffer/service/texture_manager_unittest.cc')
-rw-r--r--gpu/command_buffer/service/texture_manager_unittest.cc63
1 files changed, 7 insertions, 56 deletions
diff --git a/gpu/command_buffer/service/texture_manager_unittest.cc b/gpu/command_buffer/service/texture_manager_unittest.cc
index af18f79..516f478 100644
--- a/gpu/command_buffer/service/texture_manager_unittest.cc
+++ b/gpu/command_buffer/service/texture_manager_unittest.cc
@@ -47,12 +47,12 @@ class TextureTestHelper {
class TextureManagerTest : public GpuServiceTest {
public:
- static const GLint kMaxTextureSize = 32;
+ static const GLint kMaxTextureSize = 16;
static const GLint kMaxCubeMapTextureSize = 8;
- static const GLint kMaxRectangleTextureSize = 32;
- static const GLint kMaxExternalTextureSize = 32;
+ static const GLint kMaxRectangleTextureSize = 16;
+ static const GLint kMaxExternalTextureSize = 16;
static const GLint kMax3DTextureSize = 256;
- static const GLint kMax2dLevels = 6;
+ static const GLint kMax2dLevels = 5;
static const GLint kMaxCubeMapLevels = 4;
static const GLint kMaxExternalLevels = 1;
static const bool kUseDefaultTextures = false;
@@ -465,11 +465,11 @@ TEST_F(TextureManagerTest, ValidForTargetNPOT) {
class TextureTestBase : public GpuServiceTest {
public:
- static const GLint kMaxTextureSize = 32;
+ static const GLint kMaxTextureSize = 16;
static const GLint kMaxCubeMapTextureSize = 8;
- static const GLint kMaxRectangleTextureSize = 32;
+ static const GLint kMaxRectangleTextureSize = 16;
static const GLint kMax3DTextureSize = 256;
- static const GLint kMax2dLevels = 6;
+ static const GLint kMax2dLevels = 5;
static const GLint kMaxCubeMapLevels = 4;
static const GLuint kClient1Id = 1;
static const GLuint kService1Id = 11;
@@ -684,55 +684,6 @@ TEST_F(TextureTest, POT2D) {
EXPECT_FALSE(manager_->HaveUnrenderableTextures());
}
-TEST_F(TextureTest, BaseLevel) {
- manager_->SetTarget(texture_ref_.get(), GL_TEXTURE_2D);
- Texture* texture = texture_ref_->texture();
- EXPECT_EQ(static_cast<GLenum>(GL_TEXTURE_2D), texture->target());
- // Check Setting level 1 to POT
- manager_->SetLevelInfo(texture_ref_.get(), GL_TEXTURE_2D, 1, GL_RGBA, 4, 4, 1,
- 0, GL_RGBA, GL_UNSIGNED_BYTE, gfx::Rect(4, 4));
- SetParameter(
- texture_ref_.get(), GL_TEXTURE_MIN_FILTER, GL_LINEAR, GL_NO_ERROR);
- EXPECT_FALSE(manager_->CanRender(texture_ref_.get()));
- EXPECT_TRUE(manager_->HaveUnrenderableTextures());
- SetParameter(
- texture_ref_.get(), GL_TEXTURE_BASE_LEVEL, 1, GL_NO_ERROR);
- EXPECT_TRUE(manager_->CanRender(texture_ref_.get()));
- EXPECT_FALSE(manager_->HaveUnrenderableTextures());
-}
-
-TEST_F(TextureTest, BaseLevelMaxLevel) {
- manager_->SetTarget(texture_ref_.get(), GL_TEXTURE_2D);
- Texture* texture = texture_ref_->texture();
- EXPECT_EQ(static_cast<GLenum>(GL_TEXTURE_2D), texture->target());
- // Set up level 2, 3, 4.
- manager_->SetLevelInfo(texture_ref_.get(), GL_TEXTURE_2D, 2, GL_RGBA, 8, 8, 1,
- 0, GL_RGBA, GL_UNSIGNED_BYTE, gfx::Rect(8, 8));
- manager_->SetLevelInfo(texture_ref_.get(), GL_TEXTURE_2D, 3, GL_RGBA, 4, 4, 1,
- 0, GL_RGBA, GL_UNSIGNED_BYTE, gfx::Rect(4, 4));
- manager_->SetLevelInfo(texture_ref_.get(), GL_TEXTURE_2D, 4, GL_RGBA, 2, 2, 1,
- 0, GL_RGBA, GL_UNSIGNED_BYTE, gfx::Rect(2, 2));
- SetParameter(
- texture_ref_.get(), GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR,
- GL_NO_ERROR);
- SetParameter(
- texture_ref_.get(), GL_TEXTURE_MAG_FILTER, GL_LINEAR, GL_NO_ERROR);
- EXPECT_FALSE(manager_->CanRender(texture_ref_.get()));
- EXPECT_TRUE(manager_->HaveUnrenderableTextures());
- SetParameter(
- texture_ref_.get(), GL_TEXTURE_BASE_LEVEL, 2, GL_NO_ERROR);
- EXPECT_FALSE(manager_->CanRender(texture_ref_.get()));
- EXPECT_TRUE(manager_->HaveUnrenderableTextures());
- SetParameter(
- texture_ref_.get(), GL_TEXTURE_MAX_LEVEL, 4, GL_NO_ERROR);
- EXPECT_TRUE(manager_->CanRender(texture_ref_.get()));
- EXPECT_FALSE(manager_->HaveUnrenderableTextures());
- SetParameter(
- texture_ref_.get(), GL_TEXTURE_BASE_LEVEL, 0, GL_NO_ERROR);
- EXPECT_FALSE(manager_->CanRender(texture_ref_.get()));
- EXPECT_TRUE(manager_->HaveUnrenderableTextures());
-}
-
TEST_F(TextureMemoryTrackerTest, MarkMipmapsGenerated) {
manager_->SetTarget(texture_ref_.get(), GL_TEXTURE_2D);
EXPECT_MEMORY_ALLOCATION_CHANGE(0, 64);