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

Unified Diff: media/gpu/android_video_decode_accelerator.cc

Issue 2052103002: Enable deferred rendering strategy for Android WebView for Spitzer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@spitzer-aw-disable-tests
Patch Set: Created 4 years, 6 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
Index: media/gpu/android_video_decode_accelerator.cc
diff --git a/media/gpu/android_video_decode_accelerator.cc b/media/gpu/android_video_decode_accelerator.cc
index d0e34286369a6ba97c6dab30da8678ef646d7c1b..ccb23df7edb5437fe7dc3f5fab400993c0b8f628 100644
--- a/media/gpu/android_video_decode_accelerator.cc
+++ b/media/gpu/android_video_decode_accelerator.cc
@@ -477,9 +477,6 @@ bool AndroidVideoDecodeAccelerator::Initialize(const Config& config,
gles_decoder->GetContextGroup()->gpu_preferences();
if (UseDeferredRenderingStrategy(gpu_preferences)) {
- // TODO(liberato, watk): Figure out what we want to do about zero copy for
- // fullscreen external SurfaceView in WebView. http://crbug.com/582170.
- DCHECK(!gles_decoder->GetContextGroup()->mailbox_manager()->UsesSync());
DVLOG(1) << __FUNCTION__ << ", using deferred rendering strategy.";
strategy_.reset(new AndroidDeferredRenderingBackingStrategy(this));
} else {
@@ -1578,9 +1575,14 @@ void AndroidVideoDecodeAccelerator::ManageTimer(bool did_work) {
// static
bool AndroidVideoDecodeAccelerator::UseDeferredRenderingStrategy(
const gpu::GpuPreferences& gpu_preferences) {
- // TODO(liberato, watk): Figure out what we want to do about zero copy for
- // fullscreen external SurfaceView in WebView. http://crbug.com/582170.
- return !gpu_preferences.enable_threaded_texture_mailboxes;
+ return true;
+}
+
+// static
+bool AndroidVideoDecodeAccelerator::RequiresTextureCopy(
+ const gpu::GpuPreferences& gpu_preferences) {
+ // http://crbug.com/582170
+ return gpu_preferences.enable_threaded_texture_mailboxes;
}
// static
@@ -1647,6 +1649,10 @@ AndroidVideoDecodeAccelerator::GetCapabilities(
if (UseDeferredRenderingStrategy(gpu_preferences)) {
capabilities.flags |= media::VideoDecodeAccelerator::Capabilities::
NEEDS_ALL_PICTURE_BUFFERS_TO_DECODE;
+ if (RequiresTextureCopy(gpu_preferences)) {
+ capabilities.flags |=
+ media::VideoDecodeAccelerator::Capabilities::REQUIRES_TEXTURE_COPY;
+ }
if (media::MediaCodecUtil::IsSurfaceViewOutputSupported()) {
capabilities.flags |= media::VideoDecodeAccelerator::Capabilities::
SUPPORTS_EXTERNAL_OUTPUT_SURFACE;

Powered by Google App Engine
This is Rietveld 408576698