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