diff options
author | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-16 19:19:39 +0000 |
---|---|---|
committer | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-16 19:19:39 +0000 |
commit | 43ecf3770972226c55ec7b813ce6dece8f4fc259 (patch) | |
tree | 842372a2747ac9854cbd1197554609b47cbff10d /gpu/command_buffer/service | |
parent | 61f5d33b82980dbd74167a7f81f9a379678f8096 (diff) | |
download | chromium_src-43ecf3770972226c55ec7b813ce6dece8f4fc259.zip chromium_src-43ecf3770972226c55ec7b813ce6dece8f4fc259.tar.gz chromium_src-43ecf3770972226c55ec7b813ce6dece8f4fc259.tar.bz2 |
Added glResizeCHRM to resize the drawable associated with the command buffer.
This new command is used to pipe resize requests to the GPU process. It will allow is to synchronize the resize with the drawing. Specifically, if we resize at the wrong time, we will damage the backbuffer, causing visual artefacts (http://code.google.com/p/chromium/issues/detail?id=54430).
The resize request gets sent to the GLContext. Each backend will implement it differently. At this point it's set as a NOP.
-I will do an XResizeWindow on Linux.
-Nat will do a resize on Windows.
-Nico (or me?) will refactor the MacOSX code to use this path.
There is one line webkit patch that's necessary to activate this code (removing an #ifdef).
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/4671003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66307 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/service')
5 files changed, 19 insertions, 2 deletions
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc index 71ccb5b..cf755d8 100644 --- a/gpu/command_buffer/service/feature_info.cc +++ b/gpu/command_buffer/service/feature_info.cc @@ -94,6 +94,7 @@ void FeatureInfo::AddFeatures(const char* desired_features) { AddExtensionString("GL_CHROMIUM_map_sub"); AddExtensionString("GL_CHROMIUM_copy_texture_to_parent_texture"); AddExtensionString("GL_CHROMIUM_resource_safe"); + AddExtensionString("GL_CHROMIUM_resize"); AddExtensionString("GL_CHROMIUM_strict_attribs"); // Only turn this feature on if it is requested. Not by default. diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index e0df165..1348f64 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -1171,6 +1171,8 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>, void DoCopyTextureToParentTexture(GLuint client_texture_id, GLuint parent_client_texture_id); + void DoResizeCHROMIUM(GLuint width, GLuint height); + // Gets the number of values that will be returned by glGetXXX. Returns // false if pname is unknown. bool GetNumValuesReturnedForGLGet(GLenum pname, GLsizei* num_values); @@ -2503,6 +2505,11 @@ void GLES2DecoderImpl::DoCopyTextureToParentTexture( } } +void GLES2DecoderImpl::DoResizeCHROMIUM(GLuint width, GLuint height) { + gfx::Size size(width, height); + context_->SetSize(size); +} + const char* GLES2DecoderImpl::GetCommandName(unsigned int command_id) const { if (command_id > kStartPoint && command_id < kNumCommands) { return gles2::GetCommandName(static_cast<CommandId>(command_id)); diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h index 9ca83c5..18daa6a 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h @@ -2670,5 +2670,13 @@ error::Error GLES2DecoderImpl::HandleCopyTextureToParentTexture( return error::kNoError; } +error::Error GLES2DecoderImpl::HandleResizeCHROMIUM( + uint32 immediate_data_size, const gles2::ResizeCHROMIUM& c) { + GLuint width = static_cast<GLuint>(c.width); + GLuint height = static_cast<GLuint>(c.height); + DoResizeCHROMIUM(width, height); + return error::kNoError; +} + #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_ 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 83f11ba..eaa7af3 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 @@ -1753,5 +1753,7 @@ TEST_F(GLES2DecoderTest1, GetTexParameterivInvalidArgs2_1) { // TODO(gman): GetUniformLocationImmediate +// TODO(gman): GetUniformLocationBucket + #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_1_AUTOGEN_H_ diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h index 9b82306..95a1952 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h @@ -8,8 +8,6 @@ #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_2_AUTOGEN_H_ #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_2_AUTOGEN_H_ -// TODO(gman): GetUniformLocationBucket - TEST_F(GLES2DecoderTest2, GetVertexAttribfvValidArgs) { SpecializedSetup<GetVertexAttribfv, 0>(true); @@ -1612,5 +1610,6 @@ TEST_F(GLES2DecoderTest2, ViewportInvalidArgs3_0) { // TODO(gman): CommandBufferEnable // TODO(gman): CopyTextureToParentTexture +// TODO(gman): ResizeCHROMIUM #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_2_AUTOGEN_H_ |