diff options
author | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-01 19:59:19 +0000 |
---|---|---|
committer | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-01 19:59:19 +0000 |
commit | 391770e102b5f2364d9186a3dfa54e73b7114a1c (patch) | |
tree | a84783df4df72056ea63c6da076f28f109bc4b5c | |
parent | 534e326a8d539cc1ead844dc3b6a50886cb15349 (diff) | |
download | chromium_src-391770e102b5f2364d9186a3dfa54e73b7114a1c.zip chromium_src-391770e102b5f2364d9186a3dfa54e73b7114a1c.tar.gz chromium_src-391770e102b5f2364d9186a3dfa54e73b7114a1c.tar.bz2 |
aura: fix fullscreen pepper flash
2 parts:
- not all RenderWidgetHosts are RenderViewHosts
- correctly set window/viewport size regardless of order of RenderWidgetFullscreenPepper::OnResize vs RenderWidgetFullscreenPepper::CreateContext
BUG=101848
TEST=Pepper Flash on Youtube, go fullscreen
Review URL: http://codereview.chromium.org/8758017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112503 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | content/browser/gpu/gpu_process_host_ui_shim.cc | 50 | ||||
-rw-r--r-- | content/renderer/render_widget_fullscreen_pepper.cc | 3 |
2 files changed, 25 insertions, 28 deletions
diff --git a/content/browser/gpu/gpu_process_host_ui_shim.cc b/content/browser/gpu/gpu_process_host_ui_shim.cc index 5c992e2..fab719d 100644 --- a/content/browser/gpu/gpu_process_host_ui_shim.cc +++ b/content/browser/gpu/gpu_process_host_ui_shim.cc @@ -81,6 +81,18 @@ class ScopedSendOnIOThread { bool cancelled_; }; +RenderWidgetHostView* GetRenderWidgetHostViewFromID(int render_process_id, + int render_widget_id) { + content::RenderProcessHost* process = + content::RenderProcessHost::FromID(render_process_id); + if (!process) + return NULL; + + RenderWidgetHost* host = static_cast<RenderWidgetHost*>( + process->GetListenerByID(render_widget_id)); + return host ? host->view() : NULL; +} + } // namespace RouteToGpuProcessHostUIShimTask::RouteToGpuProcessHostUIShimTask( @@ -230,11 +242,8 @@ void GpuProcessHostUIShim::OnResizeView(int32 renderer_id, host_id_, new AcceleratedSurfaceMsg_ResizeViewACK(route_id)); - RenderViewHost* host = RenderViewHost::FromID(renderer_id, render_view_id); - if (!host) - return; - - RenderWidgetHostView* view = host->view(); + RenderWidgetHostView* view = GetRenderWidgetHostViewFromID(renderer_id, + render_view_id); if (!view) return; @@ -277,12 +286,8 @@ void GpuProcessHostUIShim::OnAcceleratedSurfaceNew( params.surface_id, TransportDIB::DefaultHandleValue())); - RenderViewHost* host = RenderViewHost::FromID(params.renderer_id, - params.render_view_id); - if (!host) - return; - - RenderWidgetHostView* view = host->view(); + RenderWidgetHostView* view = GetRenderWidgetHostViewFromID( + params.renderer_id, params.render_view_id); if (!view) return; @@ -336,12 +341,8 @@ void GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped( host_id_, new AcceleratedSurfaceMsg_BuffersSwappedACK(params.route_id)); - RenderViewHost* host = RenderViewHost::FromID(params.renderer_id, - params.render_view_id); - if (!host) - return; - - RenderWidgetHostView* view = host->view(); + RenderWidgetHostView* view = GetRenderWidgetHostViewFromID( + params.renderer_id, params.render_view_id); if (!view) return; @@ -360,12 +361,8 @@ void GpuProcessHostUIShim::OnAcceleratedSurfacePostSubBuffer( host_id_, new AcceleratedSurfaceMsg_PostSubBufferACK(params.route_id)); - RenderViewHost* host = RenderViewHost::FromID(params.renderer_id, - params.render_view_id); - if (!host) - return; - - RenderWidgetHostView* view = host->view(); + RenderWidgetHostView* view = GetRenderWidgetHostViewFromID( + params.renderer_id, params.render_view_id); if (!view) return; @@ -379,11 +376,8 @@ void GpuProcessHostUIShim::OnAcceleratedSurfacePostSubBuffer( void GpuProcessHostUIShim::OnAcceleratedSurfaceRelease( const GpuHostMsg_AcceleratedSurfaceRelease_Params& params) { - RenderViewHost* host = RenderViewHost::FromID(params.renderer_id, - params.render_view_id); - if (!host) - return; - RenderWidgetHostView* view = host->view(); + RenderWidgetHostView* view = GetRenderWidgetHostViewFromID( + params.renderer_id, params.render_view_id); if (!view) return; view->AcceleratedSurfaceRelease(params.identifier); diff --git a/content/renderer/render_widget_fullscreen_pepper.cc b/content/renderer/render_widget_fullscreen_pepper.cc index 7b2df61..95ac902 100644 --- a/content/renderer/render_widget_fullscreen_pepper.cc +++ b/content/renderer/render_widget_fullscreen_pepper.cc @@ -424,6 +424,9 @@ const float kTexCoords[] = { bool RenderWidgetFullscreenPepper::InitContext() { gpu::gles2::GLES2Implementation* gl = context_->GetImplementation(); + gl->ResizeCHROMIUM(size().width(), size().height()); + gl->Viewport(0, 0, size().width(), size().height()); + program_ = gl->CreateProgram(); GLuint vertex_shader = |