OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/layers/video_layer_impl.h" | 5 #include "cc/layers/video_layer_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "cc/layers/video_frame_provider_client_impl.h" | 9 #include "cc/layers/video_frame_provider_client_impl.h" |
10 #include "cc/quads/io_surface_draw_quad.h" | 10 #include "cc/quads/io_surface_draw_quad.h" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 break; | 223 break; |
224 YUVVideoDrawQuad::ColorSpace color_space = | 224 YUVVideoDrawQuad::ColorSpace color_space = |
225 frame_->format() == media::VideoFrame::YV12J | 225 frame_->format() == media::VideoFrame::YV12J |
226 ? YUVVideoDrawQuad::REC_601_JPEG | 226 ? YUVVideoDrawQuad::REC_601_JPEG |
227 : YUVVideoDrawQuad::REC_601; | 227 : YUVVideoDrawQuad::REC_601; |
228 gfx::RectF tex_coord_rect( | 228 gfx::RectF tex_coord_rect( |
229 tex_x_offset, tex_y_offset, tex_width_scale, tex_height_scale); | 229 tex_x_offset, tex_y_offset, tex_width_scale, tex_height_scale); |
230 YUVVideoDrawQuad* yuv_video_quad = | 230 YUVVideoDrawQuad* yuv_video_quad = |
231 render_pass->CreateAndAppendDrawQuad<YUVVideoDrawQuad>(); | 231 render_pass->CreateAndAppendDrawQuad<YUVVideoDrawQuad>(); |
232 yuv_video_quad->SetNew( | 232 yuv_video_quad->SetNew( |
233 shared_quad_state, | 233 shared_quad_state, quad_rect, opaque_rect, visible_quad_rect, |
234 quad_rect, | 234 tex_coord_rect, coded_size, frame_resources_[0], frame_resources_[1], |
235 opaque_rect, | |
236 visible_quad_rect, | |
237 tex_coord_rect, | |
238 frame_resources_[0], | |
239 frame_resources_[1], | |
240 frame_resources_[2], | 235 frame_resources_[2], |
241 frame_resources_.size() > 3 ? frame_resources_[3] : 0, | 236 frame_resources_.size() > 3 ? frame_resources_[3] : 0, color_space); |
242 color_space); | |
243 break; | 237 break; |
244 } | 238 } |
245 case VideoFrameExternalResources::RGB_RESOURCE: { | 239 case VideoFrameExternalResources::RGB_RESOURCE: { |
246 DCHECK_EQ(frame_resources_.size(), 1u); | 240 DCHECK_EQ(frame_resources_.size(), 1u); |
247 if (frame_resources_.size() < 1u) | 241 if (frame_resources_.size() < 1u) |
248 break; | 242 break; |
249 bool premultiplied_alpha = true; | 243 bool premultiplied_alpha = true; |
250 gfx::PointF uv_top_left(0.f, 0.f); | 244 gfx::PointF uv_top_left(0.f, 0.f); |
251 gfx::PointF uv_bottom_right(tex_width_scale, tex_height_scale); | 245 gfx::PointF uv_bottom_right(tex_width_scale, tex_height_scale); |
252 float opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; | 246 float opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 void VideoLayerImpl::SetProviderClientImpl( | 363 void VideoLayerImpl::SetProviderClientImpl( |
370 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) { | 364 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) { |
371 provider_client_impl_ = provider_client_impl; | 365 provider_client_impl_ = provider_client_impl; |
372 } | 366 } |
373 | 367 |
374 const char* VideoLayerImpl::LayerTypeAsString() const { | 368 const char* VideoLayerImpl::LayerTypeAsString() const { |
375 return "cc::VideoLayerImpl"; | 369 return "cc::VideoLayerImpl"; |
376 } | 370 } |
377 | 371 |
378 } // namespace cc | 372 } // namespace cc |
OLD | NEW |