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
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index e0df165..1348f640 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -1171,6 +1171,8 @@
   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::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));