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

Unified Diff: cc/resources/video_resource_updater.cc

Issue 759753005: cc: Enable GL_RED_EXT for YUV resources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ext_texture_rg2
Patch Set: Enable GL_RED_EXT for YUV Created 6 years 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/resource_provider.cc ('k') | no next file » | 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 ea0399604ca62a0ccbc9c2dbdab827031748013f..c98fe3a7ef784443b4e92acbc481fd7cfd8d0aa2 100644
--- a/cc/resources/video_resource_updater.cc
+++ b/cc/resources/video_resource_updater.cc
@@ -20,7 +20,6 @@ namespace cc {
namespace {
-const ResourceFormat kYUVResourceFormat = LUMINANCE_8;
const ResourceFormat kRGBResourceFormat = RGBA_8888;
class SyncPointClientImpl : public media::VideoFrame::SyncPointClient {
@@ -133,16 +132,14 @@ bool VideoResourceUpdater::VerifyFrame(
// For frames that we receive in software format, determine the dimensions of
// each plane in the frame.
-static gfx::Size SoftwarePlaneDimension(
+static gfx::Size PlaneDimension(
danakj 2014/12/02 17:03:20 leave this name as is? It refers to the the video
const scoped_refptr<media::VideoFrame>& input_frame,
- ResourceFormat output_resource_format,
+ bool software_compositor,
size_t plane_index) {
- if (output_resource_format == kYUVResourceFormat) {
+ if (!software_compositor) {
return media::VideoFrame::PlaneSize(
input_frame->format(), plane_index, input_frame->coded_size());
}
-
- DCHECK_EQ(output_resource_format, kRGBResourceFormat);
return input_frame->coded_size();
}
@@ -176,7 +173,8 @@ VideoFrameExternalResources VideoResourceUpdater::CreateForSoftwarePlanes(
bool software_compositor = context_provider_ == NULL;
- ResourceFormat output_resource_format = kYUVResourceFormat;
+ ResourceFormat output_resource_format =
+ resource_provider_->yuv_resource_format();
size_t output_plane_count = media::VideoFrame::NumPlanes(input_frame_format);
// TODO(skaslev): If we're in software compositing mode, we do the YUV -> RGB
@@ -194,7 +192,7 @@ VideoFrameExternalResources VideoResourceUpdater::CreateForSoftwarePlanes(
for (size_t i = 0; i < output_plane_count; ++i) {
gfx::Size output_plane_resource_size =
- SoftwarePlaneDimension(video_frame, output_resource_format, i);
+ PlaneDimension(video_frame, software_compositor, i);
if (output_plane_resource_size.IsEmpty() ||
output_plane_resource_size.width() > max_resource_size ||
output_plane_resource_size.height() > max_resource_size) {
@@ -297,7 +295,8 @@ VideoFrameExternalResources VideoResourceUpdater::CreateForSoftwarePlanes(
for (size_t i = 0; i < plane_resources.size(); ++i) {
// Update each plane's resource id with its content.
- DCHECK_EQ(plane_resources[i].resource_format, kYUVResourceFormat);
+ DCHECK_EQ(plane_resources[i].resource_format,
+ resource_provider_->yuv_resource_format());
if (!PlaneResourceMatchesUniqueID(plane_resources[i], video_frame.get(),
i)) {
« no previous file with comments | « cc/resources/resource_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698