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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 445013002: media: Optimize HW Video to 2D Canvas copy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename from Context3DProvider to Context3D Created 6 years, 1 month 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/media/webmediaplayer_ms.cc ('k') | media/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 5e52222662b9f770d1d101c6a4f1dd1ec87b3eaf..1ae39aa27116af6452f0106b14fe9f2817c46b16 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -152,6 +152,8 @@
#include "content/renderer/media/android/renderer_media_player_manager.h"
#include "content/renderer/media/android/stream_texture_factory_impl.h"
#include "content/renderer/media/android/webmediaplayer_android.h"
+#else
+#include "webkit/common/gpu/context_provider_web_context.h"
#endif
#if defined(ENABLE_PEPPER_CDMS)
@@ -247,7 +249,7 @@ void GetRedirectChain(WebDataSource* ds, std::vector<GURL>* result) {
// Returns the original request url. If there is no redirect, the original
// url is the same as ds->request()->url(). If the WebDataSource belongs to a
// frame was loaded by loadData, the original url will be ds->unreachableURL()
-static GURL GetOriginalRequestURL(WebDataSource* ds) {
+GURL GetOriginalRequestURL(WebDataSource* ds) {
// WebDataSource has unreachable URL means that the frame is loaded through
// blink::WebFrame::loadData(), and the base URL will be in the redirect
// chain. However, we never visited the baseURL. So in this case, we should
@@ -263,7 +265,7 @@ static GURL GetOriginalRequestURL(WebDataSource* ds) {
return ds->originalRequest().url();
}
-NOINLINE static void CrashIntentionally() {
+NOINLINE void CrashIntentionally() {
// NOTE(shess): Crash directly rather than using NOTREACHED() so
// that the signature is easier to triage in crash reports.
volatile int* zero = NULL;
@@ -271,7 +273,7 @@ NOINLINE static void CrashIntentionally() {
}
#if defined(ADDRESS_SANITIZER) || defined(SYZYASAN)
-NOINLINE static void MaybeTriggerAsanError(const GURL& url) {
+NOINLINE void MaybeTriggerAsanError(const GURL& url) {
// NOTE(rogerm): We intentionally perform an invalid heap access here in
// order to trigger an Address Sanitizer (ASAN) error report.
const char kCrashDomain[] = "crash";
@@ -306,7 +308,7 @@ NOINLINE static void MaybeTriggerAsanError(const GURL& url) {
}
#endif // ADDRESS_SANITIZER || SYZYASAN
-static void MaybeHandleDebugURL(const GURL& url) {
+void MaybeHandleDebugURL(const GURL& url) {
if (!url.SchemeIs(kChromeUIScheme))
return;
if (url == GURL(kChromeUICrashURL)) {
@@ -333,15 +335,15 @@ static void MaybeHandleDebugURL(const GURL& url) {
}
// Returns false unless this is a top-level navigation.
-static bool IsTopLevelNavigation(WebFrame* frame) {
+bool IsTopLevelNavigation(WebFrame* frame) {
return frame->parent() == NULL;
}
// Returns false unless this is a top-level navigation that crosses origins.
-static bool IsNonLocalTopLevelNavigation(const GURL& url,
- WebFrame* frame,
- WebNavigationType type,
- bool is_form_post) {
+bool IsNonLocalTopLevelNavigation(const GURL& url,
+ WebFrame* frame,
+ WebNavigationType type,
+ bool is_form_post) {
if (!IsTopLevelNavigation(frame))
return false;
@@ -473,10 +475,21 @@ CommonNavigationParams MakeCommonNavigationParams(
return params;
}
+#if !defined(OS_ANDROID)
+media::Context3D GetSharedMainThreadContext3D() {
+ cc::ContextProvider* provider =
+ RenderThreadImpl::current()->SharedMainThreadContextProvider().get();
+ if (!provider)
+ return media::Context3D();
+ return media::Context3D(provider->ContextGL(), provider->GrContext());
+}
+#endif
+
+using CreateRenderFrameImpl = RenderFrameImpl* (*)(RenderViewImpl*, int32);
Charlie Reis 2014/12/09 22:08:23 Is there a reason for this to be in this CL? Clea
dshwang 2014/12/10 09:14:16 @jamesr requested it in https://codereview.chromiu
+CreateRenderFrameImpl g_create_render_frame_impl = nullptr;
+
} // namespace
-static RenderFrameImpl* (*g_create_render_frame_impl)(RenderViewImpl*, int32) =
- NULL;
// static
RenderFrameImpl* RenderFrameImpl::Create(RenderViewImpl* render_view,
@@ -1756,12 +1769,11 @@ blink::WebMediaPlayer* RenderFrameImpl::createMediaPlayer(
static_cast<RenderFrame*>(this)),
render_thread->GetAudioRendererMixerManager()->CreateInput(
render_view_->routing_id_, routing_id_),
- *render_thread->GetAudioHardwareConfig(),
- new RenderMediaLog(),
+ *render_thread->GetAudioHardwareConfig(), new RenderMediaLog(),
render_thread->GetGpuFactories(),
render_thread->GetMediaThreadTaskRunner(),
render_thread->compositor_message_loop_proxy(),
- initial_cdm);
+ base::Bind(&GetSharedMainThreadContext3D), initial_cdm);
#if defined(ENABLE_PEPPER_CDMS)
scoped_ptr<media::CdmFactory> cdm_factory(
« no previous file with comments | « content/renderer/media/webmediaplayer_ms.cc ('k') | media/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698