summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorzmo@google.com <zmo@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-24 20:42:53 +0000
committerzmo@google.com <zmo@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-24 20:42:53 +0000
commitc5d79834e2053a5e4983198255c8f58b5ba596cb (patch)
tree224e16ab6e2fc7fcf908ba898b42000b964200dd /gpu
parent49420ffb6ce5a31ed48d1212bd0db878c2c6b7d2 (diff)
downloadchromium_src-c5d79834e2053a5e4983198255c8f58b5ba596cb.zip
chromium_src-c5d79834e2053a5e4983198255c8f58b5ba596cb.tar.gz
chromium_src-c5d79834e2053a5e4983198255c8f58b5ba596cb.tar.bz2
Fix WebGL getParameter bug in command buffer.
GetHelper was truning all getParameter return values into integers, even if they should have been floats. By returning false in GetHelper, it lets the individual DoGet(Float,Boolean,Integer)v functions skip this behavior and return the real value directly. Also, update unit tests now that the correct function is being called. BUG=51331 TEST=LayoutTests/fast/canvas/webgl/gl-get-calls.html git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60515 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rwxr-xr-xgpu/command_buffer/build_gles2_cmd_buffer.py4
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc5
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h16
3 files changed, 11 insertions, 14 deletions
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py
index 1209549..08b1bab 100755
--- a/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -1233,7 +1233,7 @@ _FUNCTION_INFO = {
'type': 'GETn',
'result': ['SizedResult<GLboolean>'],
'decoder_func': 'DoGetBooleanv',
- 'gl_test_func': 'glGetIntegerv',
+ 'gl_test_func': 'glGetBooleanv',
},
'GetBufferParameteriv': {'type': 'GETn', 'result': ['SizedResult<GLint>']},
'GetError': {
@@ -1246,7 +1246,7 @@ _FUNCTION_INFO = {
'type': 'GETn',
'result': ['SizedResult<GLfloat>'],
'decoder_func': 'DoGetFloatv',
- 'gl_test_func': 'glGetIntegerv',
+ 'gl_test_func': 'glGetFloatv',
},
'GetFramebufferAttachmentParameteriv': {
'type': 'GETn',
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 4a38f62..68fa2f3 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -2616,10 +2616,7 @@ bool GLES2DecoderImpl::GetHelper(
return true;
default:
*num_written = util_.GLGetNumValuesReturned(pname);
- if (params) {
- glGetIntegerv(pname, params);
- }
- return true;
+ return false;
}
}
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h
index 65c917e..dc65d58 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h
@@ -1063,7 +1063,7 @@ TEST_F(GLES2DecoderTest1, GetBooleanvValidArgs) {
SpecializedSetup<GetBooleanv, 0>(true);
typedef GetBooleanv::Result Result;
Result* result = static_cast<Result*>(shared_memory_address_);
- EXPECT_CALL(*gl_, GetIntegerv(GL_ACTIVE_TEXTURE, _));
+ EXPECT_CALL(*gl_, GetBooleanv(GL_ACTIVE_TEXTURE, result->GetData()));
result->size = 0;
GetBooleanv cmd;
cmd.Init(GL_ACTIVE_TEXTURE, shared_memory_id_, shared_memory_offset_);
@@ -1075,7 +1075,7 @@ TEST_F(GLES2DecoderTest1, GetBooleanvValidArgs) {
}
TEST_F(GLES2DecoderTest1, GetBooleanvInvalidArgs0_0) {
- EXPECT_CALL(*gl_, GetIntegerv(_, _)).Times(0);
+ EXPECT_CALL(*gl_, GetBooleanv(_, _)).Times(0);
SpecializedSetup<GetBooleanv, 0>(false);
GetBooleanv::Result* result =
static_cast<GetBooleanv::Result*>(shared_memory_address_);
@@ -1088,7 +1088,7 @@ TEST_F(GLES2DecoderTest1, GetBooleanvInvalidArgs0_0) {
}
TEST_F(GLES2DecoderTest1, GetBooleanvInvalidArgs1_0) {
- EXPECT_CALL(*gl_, GetIntegerv(_, _)).Times(0);
+ EXPECT_CALL(*gl_, GetBooleanv(_, _)).Times(0);
SpecializedSetup<GetBooleanv, 0>(false);
GetBooleanv::Result* result =
static_cast<GetBooleanv::Result*>(shared_memory_address_);
@@ -1100,7 +1100,7 @@ TEST_F(GLES2DecoderTest1, GetBooleanvInvalidArgs1_0) {
}
TEST_F(GLES2DecoderTest1, GetBooleanvInvalidArgs1_1) {
- EXPECT_CALL(*gl_, GetIntegerv(_, _)).Times(0);
+ EXPECT_CALL(*gl_, GetBooleanv(_, _)).Times(0);
SpecializedSetup<GetBooleanv, 0>(false);
GetBooleanv::Result* result =
static_cast<GetBooleanv::Result*>(shared_memory_address_);
@@ -1217,7 +1217,7 @@ TEST_F(GLES2DecoderTest1, GetFloatvValidArgs) {
SpecializedSetup<GetFloatv, 0>(true);
typedef GetFloatv::Result Result;
Result* result = static_cast<Result*>(shared_memory_address_);
- EXPECT_CALL(*gl_, GetIntegerv(GL_ACTIVE_TEXTURE, _));
+ EXPECT_CALL(*gl_, GetFloatv(GL_ACTIVE_TEXTURE, result->GetData()));
result->size = 0;
GetFloatv cmd;
cmd.Init(GL_ACTIVE_TEXTURE, shared_memory_id_, shared_memory_offset_);
@@ -1229,7 +1229,7 @@ TEST_F(GLES2DecoderTest1, GetFloatvValidArgs) {
}
TEST_F(GLES2DecoderTest1, GetFloatvInvalidArgs0_0) {
- EXPECT_CALL(*gl_, GetIntegerv(_, _)).Times(0);
+ EXPECT_CALL(*gl_, GetFloatv(_, _)).Times(0);
SpecializedSetup<GetFloatv, 0>(false);
GetFloatv::Result* result =
static_cast<GetFloatv::Result*>(shared_memory_address_);
@@ -1242,7 +1242,7 @@ TEST_F(GLES2DecoderTest1, GetFloatvInvalidArgs0_0) {
}
TEST_F(GLES2DecoderTest1, GetFloatvInvalidArgs1_0) {
- EXPECT_CALL(*gl_, GetIntegerv(_, _)).Times(0);
+ EXPECT_CALL(*gl_, GetFloatv(_, _)).Times(0);
SpecializedSetup<GetFloatv, 0>(false);
GetFloatv::Result* result =
static_cast<GetFloatv::Result*>(shared_memory_address_);
@@ -1254,7 +1254,7 @@ TEST_F(GLES2DecoderTest1, GetFloatvInvalidArgs1_0) {
}
TEST_F(GLES2DecoderTest1, GetFloatvInvalidArgs1_1) {
- EXPECT_CALL(*gl_, GetIntegerv(_, _)).Times(0);
+ EXPECT_CALL(*gl_, GetFloatv(_, _)).Times(0);
SpecializedSetup<GetFloatv, 0>(false);
GetFloatv::Result* result =
static_cast<GetFloatv::Result*>(shared_memory_address_);