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

Unified Diff: content/renderer/render_view_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/render_thread_impl.cc ('k') | content/renderer/renderer_webkitplatformsupport_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 44e58f5487dd9b546ecff4591258efe5789be19f..54647af3f07c2226ca018ef4f84b858fc56350ef 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -216,6 +216,7 @@
#if defined(OS_ANDROID)
#include "content/common/android/device_telephony_info.h"
+#include "content/common/gpu/client/context_provider_command_buffer.h"
#include "content/renderer/android/address_detector.h"
#include "content/renderer/android/content_detector.h"
#include "content/renderer/android/email_detector.h"
@@ -2721,9 +2722,6 @@ WebMediaPlayer* RenderViewImpl::createMediaPlayer(
#endif
#if defined(OS_ANDROID)
- WebGraphicsContext3D* resource_context =
- GetWebView()->sharedGraphicsContext3D();
-
GpuChannelHost* gpu_channel_host =
RenderThreadImpl::current()->EstablishGpuChannelSync(
CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE);
@@ -2732,6 +2730,14 @@ WebMediaPlayer* RenderViewImpl::createMediaPlayer(
return NULL;
}
+ scoped_refptr<cc::ContextProvider> context_provider =
+ RenderThreadImpl::current()->OffscreenContextProviderForMainThread();
+ if (!context_provider->InitializeOnMainThread() ||
+ !context_provider->BindToCurrentThread()) {
+ LOG(ERROR) << "Failed to get context3d for media player";
+ return NULL;
+ }
+
if (cmd_line->HasSwitch(switches::kInProcessWebGL)) {
if (!media_bridge_manager_.get()) {
media_bridge_manager_.reset(
@@ -2744,7 +2750,7 @@ WebMediaPlayer* RenderViewImpl::createMediaPlayer(
media_player_manager_.get(),
media_bridge_manager_.get(),
new StreamTextureFactoryImpl(
- resource_context, gpu_channel_host, routing_id_),
+ context_provider->Context3d(), gpu_channel_host, routing_id_),
cmd_line->HasSwitch(switches::kDisableMediaHistoryLogging));
}
if (!media_player_proxy_) {
@@ -2757,7 +2763,7 @@ WebMediaPlayer* RenderViewImpl::createMediaPlayer(
media_player_manager_.get(),
media_player_proxy_,
new StreamTextureFactoryImpl(
- resource_context, gpu_channel_host, routing_id_));
+ context_provider->Context3d(), gpu_channel_host, routing_id_));
#endif
scoped_refptr<media::AudioRendererSink> sink;
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | content/renderer/renderer_webkitplatformsupport_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698