Chromium Code Reviews| Index: content/renderer/render_widget_fullscreen_pepper.cc |
| diff --git a/content/renderer/render_widget_fullscreen_pepper.cc b/content/renderer/render_widget_fullscreen_pepper.cc |
| index 3154bbbda7b6c14e0c3b2621ca6c5c04daa8be93..9ddaf8522879824edeb84f7db544e567a7eb1677 100644 |
| --- a/content/renderer/render_widget_fullscreen_pepper.cc |
| +++ b/content/renderer/render_widget_fullscreen_pepper.cc |
| @@ -451,17 +451,12 @@ void RenderWidgetFullscreenPepper::DidChangeCursor( |
| webkit::ppapi::PluginDelegate::PlatformContext3D* |
| RenderWidgetFullscreenPepper::CreateContext3D() { |
| #ifdef ENABLE_GPU |
| - return new PlatformContext3DImpl(this); |
| + return new PlatformContext3DImpl; |
| #else |
| return NULL; |
| #endif |
| } |
| -void RenderWidgetFullscreenPepper::ReparentContext( |
| - webkit::ppapi::PluginDelegate::PlatformContext3D* context) { |
| - static_cast<PlatformContext3DImpl*>(context)->SetParentContext(this); |
| -} |
| - |
| bool RenderWidgetFullscreenPepper::OnMessageReceived(const IPC::Message& msg) { |
| bool handled = true; |
| IPC_BEGIN_MESSAGE_MAP(RenderWidgetFullscreenPepper, msg) |
| @@ -565,7 +560,7 @@ void RenderWidgetFullscreenPepper::CreateContext() { |
| attributes.depth = false; |
| attributes.stencil = false; |
| attributes.antialias = false; |
| - attributes.shareResources = false; |
| + attributes.shareResources = true; |
| attributes.preferDiscreteGPU = true; |
| context_ = WebGraphicsContext3DCommandBufferImpl::CreateViewContext( |
| RenderThreadImpl::current(), |
| @@ -684,6 +679,18 @@ bool RenderWidgetFullscreenPepper::InitContext() { |
| } |
| bool RenderWidgetFullscreenPepper::CheckCompositing() { |
| + if (webwidget_) { |
| + if (context_ && context_->isContextLost()) { |
| + DestroyContext(context_, program_, buffer_); |
| + context_ = NULL; |
| + } |
| + if (!context_) |
| + CreateContext(); |
|
piman
2013/03/08 04:43:16
We should only create the context if the plugin ha
danakj
2013/03/08 18:13:34
Done.
|
| + } else if (context_) { |
|
piman
2013/03/08 04:43:16
I don't really think you need this clause. The web
danakj
2013/03/08 18:13:34
Done.
|
| + DestroyContext(context_, program_, buffer_); |
| + context_ = NULL; |
| + } |
| + |
| bool compositing = |
| webwidget_ && webwidget_->isAcceleratedCompositingActive(); |
| if (compositing != is_accelerated_compositing_active_) { |
| @@ -704,14 +711,4 @@ void RenderWidgetFullscreenPepper::SwapBuffers() { |
| didCommitAndDrawCompositorFrame(); |
| } |
| -WebGraphicsContext3DCommandBufferImpl* |
| -RenderWidgetFullscreenPepper::GetParentContextForPlatformContext3D() { |
| - if (!context_) { |
| - CreateContext(); |
| - } |
| - if (!context_) |
| - return NULL; |
| - return context_; |
| -} |
| - |
| } // namespace content |