From a471e9c8828edff914937df14c1998d4bc3dff72 Mon Sep 17 00:00:00 2001 From: "apatrick@chromium.org" Date: Thu, 3 Jun 2010 17:55:17 +0000 Subject: GPU plugin size is updated before GPU command buffer is initialized. Now it happens before the command buffer is initialized, which fixes an occasional race condition in Pepper 3D plugins that are not animated. TEST=try BUG=none Review URL: http://codereview.chromium.org/2461003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48848 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/renderer/webplugin_delegate_pepper.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'chrome/renderer/webplugin_delegate_pepper.cc') diff --git a/chrome/renderer/webplugin_delegate_pepper.cc b/chrome/renderer/webplugin_delegate_pepper.cc index 2523efc..1fd996e 100644 --- a/chrome/renderer/webplugin_delegate_pepper.cc +++ b/chrome/renderer/webplugin_delegate_pepper.cc @@ -580,6 +580,10 @@ NPError WebPluginDelegatePepper::Device3DInitializeContext( false)) { plugin_->SetAcceptsInputEvents(true); + // Ensure the window has the correct size before initializing the + // command buffer. + nested_delegate_->UpdateGeometry(window_rect_, clip_rect_); + // Ask the GPU plugin to create a command buffer and return a proxy. command_buffer_ = nested_delegate_->CreateCommandBuffer(); if (command_buffer_) { @@ -599,8 +603,6 @@ NPError WebPluginDelegatePepper::Device3DInitializeContext( ScheduleHandleRepaint(instance_->npp(), context); - // Ensure the service knows the window size before rendering anything. - nested_delegate_->UpdateGeometry(window_rect_, clip_rect_); #if defined(OS_MACOSX) command_buffer_->SetWindowSize(window_rect_.size()); #endif // OS_MACOSX -- cgit v1.1