Index: content/renderer/gpu/render_widget_compositor.cc |
diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc |
index 311e175cdcb1ecad3177c9a6792f2c65960cbe51..1aa0c848821224075f98cd9e623fa55ce5bc7917 100644 |
--- a/content/renderer/gpu/render_widget_compositor.cc |
+++ b/content/renderer/gpu/render_widget_compositor.cc |
@@ -17,6 +17,7 @@ |
#include "content/renderer/gpu/compositor_thread.h" |
#include "content/renderer/render_thread_impl.h" |
#include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeViewClient.h" |
+#include "third_party/WebKit/Source/Platform/chromium/public/WebSharedGraphicsContext3D.h" |
#include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" |
#include "webkit/compositor_bindings/web_layer_impl.h" |
#include "webkit/compositor_bindings/web_to_ccinput_handler_adapter.h" |
@@ -340,6 +341,29 @@ void RenderWidgetCompositor::didRecreateOutputSurface(bool success) { |
client_->didRecreateOutputSurface(success); |
} |
+// TODO(danakj): This hook is just meant for testing, remove it when we track |
+// losing the offscreen context in the embedder! The getter methods should |
+// return a new valid context after a loss automatically. |
+void RenderWidgetCompositor::willRetryRecreateOutputSurface() { |
+ if (WebKit::WebSharedGraphicsContext3D::haveCompositorThreadContext()) |
+ WebKit::WebSharedGraphicsContext3D::createCompositorThreadContext(); |
+} |
+ |
+// TODO(danakj): This should go through WebWidget |
+WebKit::WebGraphicsContext3D* RenderWidgetCompositor:: |
+ OffscreenContext3dForMainThread() { |
+ return WebKit::WebSharedGraphicsContext3D::mainThreadContext(); |
+} |
+ |
+// TODO(danakj): This should go through WebWidget |
+WebKit::WebGraphicsContext3D* RenderWidgetCompositor:: |
+ OffscreenContext3dForCompositorThread() { |
+ if (!WebKit::WebSharedGraphicsContext3D::haveCompositorThreadContext() && |
+ !WebKit::WebSharedGraphicsContext3D::createCompositorThreadContext()) |
+ return NULL; |
+ return WebKit::WebSharedGraphicsContext3D::compositorThreadContext(); |
+} |
+ |
// TODO(jamesr): This should go through WebWidget |
scoped_ptr<cc::InputHandler> RenderWidgetCompositor::createInputHandler() { |
scoped_ptr<cc::InputHandler> ret; |