| 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/quad_sink.h" | 9 #include "cc/layers/quad_sink.h" |
| 10 #include "cc/layers/video_frame_provider_client_impl.h" | 10 #include "cc/layers/video_frame_provider_client_impl.h" |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 SK_ColorTRANSPARENT, | 166 SK_ColorTRANSPARENT, |
| 167 opacity, | 167 opacity, |
| 168 flipped); | 168 flipped); |
| 169 quad_sink->Append(texture_quad.PassAs<DrawQuad>(), append_quads_data); | 169 quad_sink->Append(texture_quad.PassAs<DrawQuad>(), append_quads_data); |
| 170 break; | 170 break; |
| 171 } | 171 } |
| 172 case VideoFrameExternalResources::YUV_RESOURCE: { | 172 case VideoFrameExternalResources::YUV_RESOURCE: { |
| 173 DCHECK_GE(frame_resources_.size(), 3u); | 173 DCHECK_GE(frame_resources_.size(), 3u); |
| 174 if (frame_resources_.size() < 3u) | 174 if (frame_resources_.size() < 3u) |
| 175 break; | 175 break; |
| 176 bool has_jpeg_color_range = frame_->format() == media::VideoFrame::YV12J; |
| 176 gfx::SizeF tex_scale(tex_width_scale, tex_height_scale); | 177 gfx::SizeF tex_scale(tex_width_scale, tex_height_scale); |
| 177 scoped_ptr<YUVVideoDrawQuad> yuv_video_quad = YUVVideoDrawQuad::Create(); | 178 scoped_ptr<YUVVideoDrawQuad> yuv_video_quad = YUVVideoDrawQuad::Create(); |
| 178 yuv_video_quad->SetNew(shared_quad_state, | 179 yuv_video_quad->SetNew(shared_quad_state, |
| 179 quad_rect, | 180 quad_rect, |
| 180 opaque_rect, | 181 opaque_rect, |
| 181 tex_scale, | 182 tex_scale, |
| 182 frame_resources_[0], | 183 frame_resources_[0], |
| 183 frame_resources_[1], | 184 frame_resources_[1], |
| 184 frame_resources_[2], | 185 frame_resources_[2], |
| 185 frame_resources_.size() > 3 ? | 186 frame_resources_.size() > 3 ? |
| 186 frame_resources_[3] : 0); | 187 frame_resources_[3] : 0, |
| 188 has_jpeg_color_range); |
| 187 quad_sink->Append(yuv_video_quad.PassAs<DrawQuad>(), append_quads_data); | 189 quad_sink->Append(yuv_video_quad.PassAs<DrawQuad>(), append_quads_data); |
| 188 break; | 190 break; |
| 189 } | 191 } |
| 190 case VideoFrameExternalResources::RGB_RESOURCE: { | 192 case VideoFrameExternalResources::RGB_RESOURCE: { |
| 191 DCHECK_EQ(frame_resources_.size(), 1u); | 193 DCHECK_EQ(frame_resources_.size(), 1u); |
| 192 if (frame_resources_.size() < 1u) | 194 if (frame_resources_.size() < 1u) |
| 193 break; | 195 break; |
| 194 bool premultiplied_alpha = true; | 196 bool premultiplied_alpha = true; |
| 195 gfx::PointF uv_top_left(0.f, 0.f); | 197 gfx::PointF uv_top_left(0.f, 0.f); |
| 196 gfx::PointF uv_bottom_right(tex_width_scale, tex_height_scale); | 198 gfx::PointF uv_bottom_right(tex_width_scale, tex_height_scale); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 void VideoLayerImpl::SetProviderClientImpl( | 311 void VideoLayerImpl::SetProviderClientImpl( |
| 310 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) { | 312 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) { |
| 311 provider_client_impl_ = provider_client_impl; | 313 provider_client_impl_ = provider_client_impl; |
| 312 } | 314 } |
| 313 | 315 |
| 314 const char* VideoLayerImpl::LayerTypeAsString() const { | 316 const char* VideoLayerImpl::LayerTypeAsString() const { |
| 315 return "cc::VideoLayerImpl"; | 317 return "cc::VideoLayerImpl"; |
| 316 } | 318 } |
| 317 | 319 |
| 318 } // namespace cc | 320 } // namespace cc |
| OLD | NEW |