| 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 software_resources_[0], | 166 software_resources_[0], |
| 167 premultiplied_alpha, | 167 premultiplied_alpha, |
| 168 uv_top_left, | 168 uv_top_left, |
| 169 uv_bottom_right, | 169 uv_bottom_right, |
| 170 opacity, | 170 opacity, |
| 171 flipped); | 171 flipped); |
| 172 quad_sink->Append(texture_quad.PassAs<DrawQuad>(), append_quads_data); | 172 quad_sink->Append(texture_quad.PassAs<DrawQuad>(), append_quads_data); |
| 173 break; | 173 break; |
| 174 } | 174 } |
| 175 case VideoFrameExternalResources::YUV_RESOURCE: { | 175 case VideoFrameExternalResources::YUV_RESOURCE: { |
| 176 DCHECK_EQ(frame_resources_.size(), 3u); | 176 DCHECK_GE(frame_resources_.size(), 3u); |
| 177 if (frame_resources_.size() < 3u) | 177 if (frame_resources_.size() < 3u) |
| 178 break; | 178 break; |
| 179 gfx::SizeF tex_scale(tex_width_scale, tex_height_scale); | 179 gfx::SizeF tex_scale(tex_width_scale, tex_height_scale); |
| 180 scoped_ptr<YUVVideoDrawQuad> yuv_video_quad = YUVVideoDrawQuad::Create(); | 180 scoped_ptr<YUVVideoDrawQuad> yuv_video_quad = YUVVideoDrawQuad::Create(); |
| 181 yuv_video_quad->SetNew(shared_quad_state, | 181 yuv_video_quad->SetNew(shared_quad_state, |
| 182 quad_rect, | 182 quad_rect, |
| 183 opaque_rect, | 183 opaque_rect, |
| 184 tex_scale, | 184 tex_scale, |
| 185 frame_resources_[0], | 185 frame_resources_[0], |
| 186 frame_resources_[1], | 186 frame_resources_[1], |
| 187 frame_resources_[2]); | 187 frame_resources_[2], |
| 188 frame_resources_.size() > 3 ? |
| 189 frame_resources_[3] : 0); |
| 188 quad_sink->Append(yuv_video_quad.PassAs<DrawQuad>(), append_quads_data); | 190 quad_sink->Append(yuv_video_quad.PassAs<DrawQuad>(), append_quads_data); |
| 189 break; | 191 break; |
| 190 } | 192 } |
| 191 case VideoFrameExternalResources::RGB_RESOURCE: { | 193 case VideoFrameExternalResources::RGB_RESOURCE: { |
| 192 if (!hardware_resource_) { | 194 if (!hardware_resource_) { |
| 193 DCHECK_EQ(frame_resources_.size(), 1u); | 195 DCHECK_EQ(frame_resources_.size(), 1u); |
| 194 if (frame_resources_.size() < 1u) | 196 if (frame_resources_.size() < 1u) |
| 195 break; | 197 break; |
| 196 } | 198 } |
| 197 bool premultiplied_alpha = true; | 199 bool premultiplied_alpha = true; |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 void VideoLayerImpl::SetProviderClientImpl( | 324 void VideoLayerImpl::SetProviderClientImpl( |
| 323 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) { | 325 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) { |
| 324 provider_client_impl_ = provider_client_impl; | 326 provider_client_impl_ = provider_client_impl; |
| 325 } | 327 } |
| 326 | 328 |
| 327 const char* VideoLayerImpl::LayerTypeAsString() const { | 329 const char* VideoLayerImpl::LayerTypeAsString() const { |
| 328 return "cc::VideoLayerImpl"; | 330 return "cc::VideoLayerImpl"; |
| 329 } | 331 } |
| 330 | 332 |
| 331 } // namespace cc | 333 } // namespace cc |
| OLD | NEW |