summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service/framebuffer_manager_unittest.cc
diff options
context:
space:
mode:
authorskyostil@chromium.org <skyostil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-19 13:04:11 +0000
committerskyostil@chromium.org <skyostil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-19 13:04:11 +0000
commit50bcb3cb9d02bd24ad21cb95a6375a37e38aeec1 (patch)
treee33e32d293f984d7c940a22fefc96739c0314429 /gpu/command_buffer/service/framebuffer_manager_unittest.cc
parent96946824b34885701dfe7fb36e035385fd859c0b (diff)
downloadchromium_src-50bcb3cb9d02bd24ad21cb95a6375a37e38aeec1.zip
chromium_src-50bcb3cb9d02bd24ad21cb95a6375a37e38aeec1.tar.gz
chromium_src-50bcb3cb9d02bd24ad21cb95a6375a37e38aeec1.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 Review URL: https://chromiumcodereview.appspot.com/24079010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224117 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.cc35
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) {