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

Unified Diff: cc/resources/video_resource_updater.cc

Issue 2763223003: Reland of cc: Don't use StreamVideoDrawQuad on any platform but Android. (Closed)
Patch Set: Fix tests. Created 3 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
« no previous file with comments | « cc/resources/video_resource_updater.h ('k') | cc/resources/video_resource_updater_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/video_resource_updater.cc
diff --git a/cc/resources/video_resource_updater.cc b/cc/resources/video_resource_updater.cc
index 9e697580d3f22d696c93e556f9afb19c9ba23e16..2fc54d7561bd212dac06048730a03d6f3389000e 100644
--- a/cc/resources/video_resource_updater.cc
+++ b/cc/resources/video_resource_updater.cc
@@ -35,21 +35,22 @@ namespace {
const ResourceFormat kRGBResourceFormat = RGBA_8888;
VideoFrameExternalResources::ResourceType ResourceTypeForVideoFrame(
- media::VideoFrame* video_frame) {
+ media::VideoFrame* video_frame,
+ bool use_stream_video_draw_quad) {
switch (video_frame->format()) {
case media::PIXEL_FORMAT_ARGB:
case media::PIXEL_FORMAT_XRGB:
case media::PIXEL_FORMAT_UYVY:
switch (video_frame->mailbox_holder(0).texture_target) {
+ case GL_TEXTURE_EXTERNAL_OES:
+ if (use_stream_video_draw_quad &&
+ !video_frame->metadata()->IsTrue(
+ media::VideoFrameMetadata::COPY_REQUIRED))
+ return VideoFrameExternalResources::STREAM_TEXTURE_RESOURCE;
case GL_TEXTURE_2D:
return (video_frame->format() == media::PIXEL_FORMAT_XRGB)
? VideoFrameExternalResources::RGB_RESOURCE
: VideoFrameExternalResources::RGBA_PREMULTIPLIED_RESOURCE;
- case GL_TEXTURE_EXTERNAL_OES:
- return video_frame->metadata()->IsTrue(
- media::VideoFrameMetadata::COPY_REQUIRED)
- ? VideoFrameExternalResources::RGBA_RESOURCE
- : VideoFrameExternalResources::STREAM_TEXTURE_RESOURCE;
case GL_TEXTURE_RECTANGLE_ARB:
return VideoFrameExternalResources::RGB_RESOURCE;
default:
@@ -172,9 +173,11 @@ VideoFrameExternalResources::VideoFrameExternalResources(
VideoFrameExternalResources::~VideoFrameExternalResources() {}
VideoResourceUpdater::VideoResourceUpdater(ContextProvider* context_provider,
- ResourceProvider* resource_provider)
+ ResourceProvider* resource_provider,
+ bool use_stream_video_draw_quad)
: context_provider_(context_provider),
resource_provider_(resource_provider),
+ use_stream_video_draw_quad_(use_stream_video_draw_quad),
weak_ptr_factory_(this) {}
VideoResourceUpdater::~VideoResourceUpdater() {
@@ -630,7 +633,8 @@ VideoFrameExternalResources VideoResourceUpdater::CreateForHardwarePlanes(
}
gfx::ColorSpace resource_color_space = video_frame->ColorSpace();
- external_resources.type = ResourceTypeForVideoFrame(video_frame.get());
+ external_resources.type =
+ ResourceTypeForVideoFrame(video_frame.get(), use_stream_video_draw_quad_);
if (external_resources.type == VideoFrameExternalResources::NONE) {
DLOG(ERROR) << "Unsupported Texture format"
<< media::VideoPixelFormatToString(video_frame->format());
« no previous file with comments | « cc/resources/video_resource_updater.h ('k') | cc/resources/video_resource_updater_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698