diff options
author | skyostil@chromium.org <skyostil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-20 22:50:23 +0000 |
---|---|---|
committer | skyostil@chromium.org <skyostil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-20 22:50:23 +0000 |
commit | 8e102e104b0cc918e44a304a14d7190634c04c45 (patch) | |
tree | 46ddcfabd227645fdd284baddf5ac580906c7530 /gpu/command_buffer/service/framebuffer_manager_unittest.cc | |
parent | d9bd278fccfcfd7ab7c48fef910f09d20d99dbad (diff) | |
download | chromium_src-8e102e104b0cc918e44a304a14d7190634c04c45.zip chromium_src-8e102e104b0cc918e44a304a14d7190634c04c45.tar.gz chromium_src-8e102e104b0cc918e44a304a14d7190634c04c45.tar.bz2 |
gpu: Upgrade DEPTH_COMPONENT16 to DEPTH_COMPONENT24 if possible
Upgrade the DEPTH_COMPONENT16 render buffer storage format to
DEPTH_COMPONENT24 if the GLES implementation supports the OES_depth24
extension. This is done to improve content portability between desktop
and mobile, since we already do a similar mapping from DEPTH_COMPONENT16
to the unsized DEPTH_COMPONENT on desktop GL. This means that for
example WebGL content can end up relying on a higher precision depth
buffer even though it only requested DEPTH_COMPONENT16.
BUG=285400
TEST=http://www.khronos.org/registry/webgl/conformance-suites/1.0.1/webgl-conformance-tests.html on Nexus 4
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=224117
Review URL: https://chromiumcodereview.appspot.com/24079010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224509 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/service/framebuffer_manager_unittest.cc')
-rw-r--r-- | gpu/command_buffer/service/framebuffer_manager_unittest.cc | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/gpu/command_buffer/service/framebuffer_manager_unittest.cc b/gpu/command_buffer/service/framebuffer_manager_unittest.cc index a2c8aeb..0793258 100644 --- a/gpu/command_buffer/service/framebuffer_manager_unittest.cc +++ b/gpu/command_buffer/service/framebuffer_manager_unittest.cc @@ -15,19 +15,24 @@ using ::testing::Return; namespace gpu { namespace gles2 { +namespace { -class FramebufferManagerTest : public testing::Test { - static const GLint kMaxTextureSize = 64; - static const GLint kMaxCubemapSize = 64; - static const GLint kMaxRenderbufferSize = 64; - static const GLint kMaxSamples = 4; +const GLint kMaxTextureSize = 64; +const GLint kMaxCubemapSize = 64; +const GLint kMaxRenderbufferSize = 64; +const GLint kMaxSamples = 4; +const bool kDepth24Supported = false; + +} // namespace +class FramebufferManagerTest : public testing::Test { public: FramebufferManagerTest() : manager_(1, 1), texture_manager_( NULL, new FeatureInfo(), kMaxTextureSize, kMaxCubemapSize), - renderbuffer_manager_(NULL, kMaxRenderbufferSize, kMaxSamples) { + renderbuffer_manager_(NULL, kMaxRenderbufferSize, kMaxSamples, + kDepth24Supported) { } virtual ~FramebufferManagerTest() { @@ -54,13 +59,6 @@ class FramebufferManagerTest : public testing::Test { RenderbufferManager renderbuffer_manager_; }; -// GCC requires these declarations, but MSVC requires they not be present -#ifndef COMPILER_MSVC -const GLint FramebufferManagerTest::kMaxTextureSize; -const GLint FramebufferManagerTest::kMaxCubemapSize; -const GLint FramebufferManagerTest::kMaxRenderbufferSize; -#endif - TEST_F(FramebufferManagerTest, Basic) { const GLuint kClient1Id = 1; const GLuint kService1Id = 11; @@ -110,16 +108,12 @@ class FramebufferInfoTest : public testing::Test { static const GLuint kClient1Id = 1; static const GLuint kService1Id = 11; - static const GLint kMaxTextureSize = 64; - static const GLint kMaxCubemapSize = 64; - static const GLint kMaxRenderbufferSize = 64; - static const GLint kMaxSamples = 4; - FramebufferInfoTest() : manager_(1, 1), texture_manager_( NULL, new FeatureInfo(), kMaxTextureSize, kMaxCubemapSize), - renderbuffer_manager_(NULL, kMaxRenderbufferSize, kMaxSamples) { + renderbuffer_manager_(NULL, kMaxRenderbufferSize, kMaxSamples, + kDepth24Supported) { } virtual ~FramebufferInfoTest() { manager_.Destroy(false); @@ -155,9 +149,6 @@ class FramebufferInfoTest : public testing::Test { #ifndef COMPILER_MSVC const GLuint FramebufferInfoTest::kClient1Id; const GLuint FramebufferInfoTest::kService1Id; -const GLint FramebufferInfoTest::kMaxTextureSize; -const GLint FramebufferInfoTest::kMaxCubemapSize; -const GLint FramebufferInfoTest::kMaxRenderbufferSize; #endif TEST_F(FramebufferInfoTest, Basic) { |