OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/resources/video_resource_updater.h" | 5 #include "cc/resources/video_resource_updater.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "cc/output/gl_renderer.h" | 9 #include "cc/output/gl_renderer.h" |
10 #include "cc/resources/resource_provider.h" | 10 #include "cc/resources/resource_provider.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 input_frame_format == media::VideoFrame::YV16 || | 136 input_frame_format == media::VideoFrame::YV16 || |
137 input_frame_format == media::VideoFrame::YV24); | 137 input_frame_format == media::VideoFrame::YV24); |
138 if (input_frame_format != media::VideoFrame::YV12 && | 138 if (input_frame_format != media::VideoFrame::YV12 && |
139 input_frame_format != media::VideoFrame::I420 && | 139 input_frame_format != media::VideoFrame::I420 && |
140 input_frame_format != media::VideoFrame::YV12A && | 140 input_frame_format != media::VideoFrame::YV12A && |
141 input_frame_format != media::VideoFrame::YV12J && | 141 input_frame_format != media::VideoFrame::YV12J && |
142 input_frame_format != media::VideoFrame::YV16 && | 142 input_frame_format != media::VideoFrame::YV16 && |
143 input_frame_format != media::VideoFrame::YV24) | 143 input_frame_format != media::VideoFrame::YV24) |
144 return VideoFrameExternalResources(); | 144 return VideoFrameExternalResources(); |
145 | 145 |
146 bool software_compositor = context_provider_ == NULL; | 146 bool software_compositor = context_provider_ == nullptr; |
147 | 147 |
148 ResourceFormat output_resource_format = kYUVResourceFormat; | 148 ResourceFormat output_resource_format = kYUVResourceFormat; |
149 size_t output_plane_count = media::VideoFrame::NumPlanes(input_frame_format); | 149 size_t output_plane_count = media::VideoFrame::NumPlanes(input_frame_format); |
150 | 150 |
151 // TODO(skaslev): If we're in software compositing mode, we do the YUV -> RGB | 151 // TODO(skaslev): If we're in software compositing mode, we do the YUV -> RGB |
152 // conversion here. That involves an extra copy of each frame to a bitmap. | 152 // conversion here. That involves an extra copy of each frame to a bitmap. |
153 // Obviously, this is suboptimal and should be addressed once ubercompositor | 153 // Obviously, this is suboptimal and should be addressed once ubercompositor |
154 // starts shaping up. | 154 // starts shaping up. |
155 if (software_compositor) { | 155 if (software_compositor) { |
156 output_resource_format = kRGBResourceFormat; | 156 output_resource_format = kRGBResourceFormat; |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 } | 390 } |
391 | 391 |
392 PlaneResource recycled_resource(data.resource_id, | 392 PlaneResource recycled_resource(data.resource_id, |
393 data.resource_size, | 393 data.resource_size, |
394 data.resource_format, | 394 data.resource_format, |
395 data.mailbox); | 395 data.mailbox); |
396 updater->recycled_resources_.push_back(recycled_resource); | 396 updater->recycled_resources_.push_back(recycled_resource); |
397 } | 397 } |
398 | 398 |
399 } // namespace cc | 399 } // namespace cc |
OLD | NEW |