Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(695)

Unified Diff: content/renderer/browser_plugin/browser_plugin_compositing_helper.cc

Issue 12483002: browser plugin: Get the offscreen shared context from RenderThreadImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/browser_plugin/browser_plugin_compositing_helper.cc
diff --git a/content/renderer/browser_plugin/browser_plugin_compositing_helper.cc b/content/renderer/browser_plugin/browser_plugin_compositing_helper.cc
index 4826c3d239fda5ab9cd7577f161121e87790ecc6..bf7956ea1abd465677978223a19cb97deebfebe1 100644
--- a/content/renderer/browser_plugin/browser_plugin_compositing_helper.cc
+++ b/content/renderer/browser_plugin/browser_plugin_compositing_helper.cc
@@ -4,6 +4,7 @@
#include "content/renderer/browser_plugin/browser_plugin_compositing_helper.h"
+#include "cc/context_provider.h"
#include "cc/solid_color_layer.h"
#include "cc/texture_layer.h"
#include "content/common/browser_plugin/browser_plugin_messages.h"
@@ -11,7 +12,6 @@
#include "content/renderer/render_thread_impl.h"
#include "third_party/khronos/GLES2/gl2.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3D.h"
-#include "third_party/WebKit/Source/Platform/chromium/public/WebSharedGraphicsContext3D.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h"
#include "ui/gfx/size_conversions.h"
#include "webkit/compositor_bindings/web_layer_impl.h"
@@ -67,10 +67,14 @@ void BrowserPluginCompositingHelper::FreeMailboxMemory(
if (mailbox_name.empty())
return;
- WebKit::WebGraphicsContext3D *context =
- WebKit::WebSharedGraphicsContext3D::mainThreadContext();
- if (!context)
+ scoped_refptr<cc::ContextProvider> context_provider =
+ RenderThreadImpl::current()->OffscreenContextProviderForMainThread();
+ if (!context_provider->InitializeOnMainThread())
return;
+ if (!context_provider->BindToCurrentThread())
+ return;
+
+ WebKit::WebGraphicsContext3D *context = context_provider->Context3d();
// When a buffer is released from the compositor, we also get a
// sync point that specifies when in the command buffer
// it's safe to use it again.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698