Chromium Code Reviews| 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)) { |