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

Unified Diff: content/renderer/pepper/pepper_plugin_delegate_impl.cc

Issue 12506003: Stop using the WebView::sharedGraphicsContext3D interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixin Created 7 years, 9 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 | « content/renderer/pepper/pepper_plugin_delegate_impl.h ('k') | content/renderer/render_thread_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/pepper_plugin_delegate_impl.cc
diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.cc b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
index 5217709454039717c9376de647c35456ccd60362..b79ae624b646dc8dcab0135894b69edea7d5dfb7 100644
--- a/content/renderer/pepper/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
@@ -23,6 +23,7 @@
#include "content/common/child_thread.h"
#include "content/common/fileapi/file_system_dispatcher.h"
#include "content/common/fileapi/file_system_messages.h"
+#include "content/common/gpu/client/context_provider_command_buffer.h"
#include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
#include "content/common/pepper_messages.h"
#include "content/common/pepper_plugin_registry.h"
@@ -1574,15 +1575,17 @@ int PepperPluginDelegateImpl::GetSessionID(PP_DeviceType_Dev type,
WebGraphicsContext3DCommandBufferImpl*
PepperPluginDelegateImpl::GetParentContextForPlatformContext3D() {
- WebGraphicsContext3DCommandBufferImpl* context =
- static_cast<WebGraphicsContext3DCommandBufferImpl*>(
- render_view_->webview()->sharedGraphicsContext3D());
- if (!context)
- return NULL;
- if (!context->makeContextCurrent() || context->isContextLost())
- return NULL;
+ if (!offscreen_context3d_ || offscreen_context3d_->DestroyedOnMainThread()) {
+ offscreen_context3d_ =
+ RenderThreadImpl::current()->OffscreenContextProviderForMainThread();
- return context;
+ if (!offscreen_context3d_->InitializeOnMainThread() ||
+ !offscreen_context3d_->BindToCurrentThread()) {
+ offscreen_context3d_ = NULL;
+ return NULL;
+ }
+ }
+ return offscreen_context3d_->Context3d();
}
MouseLockDispatcher::LockTarget*
« no previous file with comments | « content/renderer/pepper/pepper_plugin_delegate_impl.h ('k') | content/renderer/render_thread_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698