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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 float opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; | 149 float opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; |
150 bool flipped = false; | 150 bool flipped = false; |
151 scoped_ptr<TextureDrawQuad> texture_quad = TextureDrawQuad::Create(); | 151 scoped_ptr<TextureDrawQuad> texture_quad = TextureDrawQuad::Create(); |
152 texture_quad->SetNew(shared_quad_state, | 152 texture_quad->SetNew(shared_quad_state, |
153 quad_rect, | 153 quad_rect, |
154 opaque_rect, | 154 opaque_rect, |
155 software_resources_[0], | 155 software_resources_[0], |
156 premultiplied_alpha, | 156 premultiplied_alpha, |
157 uv_top_left, | 157 uv_top_left, |
158 uv_bottom_right, | 158 uv_bottom_right, |
| 159 SK_ColorTRANSPARENT, |
159 opacity, | 160 opacity, |
160 flipped); | 161 flipped); |
161 quad_sink->Append(texture_quad.PassAs<DrawQuad>(), append_quads_data); | 162 quad_sink->Append(texture_quad.PassAs<DrawQuad>(), append_quads_data); |
162 break; | 163 break; |
163 } | 164 } |
164 case VideoFrameExternalResources::YUV_RESOURCE: { | 165 case VideoFrameExternalResources::YUV_RESOURCE: { |
165 DCHECK_GE(frame_resources_.size(), 3u); | 166 DCHECK_GE(frame_resources_.size(), 3u); |
166 if (frame_resources_.size() < 3u) | 167 if (frame_resources_.size() < 3u) |
167 break; | 168 break; |
168 gfx::SizeF tex_scale(tex_width_scale, tex_height_scale); | 169 gfx::SizeF tex_scale(tex_width_scale, tex_height_scale); |
(...skipping 20 matching lines...) Expand all Loading... |
189 float opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; | 190 float opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; |
190 bool flipped = false; | 191 bool flipped = false; |
191 scoped_ptr<TextureDrawQuad> texture_quad = TextureDrawQuad::Create(); | 192 scoped_ptr<TextureDrawQuad> texture_quad = TextureDrawQuad::Create(); |
192 texture_quad->SetNew(shared_quad_state, | 193 texture_quad->SetNew(shared_quad_state, |
193 quad_rect, | 194 quad_rect, |
194 opaque_rect, | 195 opaque_rect, |
195 frame_resources_[0], | 196 frame_resources_[0], |
196 premultiplied_alpha, | 197 premultiplied_alpha, |
197 uv_top_left, | 198 uv_top_left, |
198 uv_bottom_right, | 199 uv_bottom_right, |
| 200 SK_ColorTRANSPARENT, |
199 opacity, | 201 opacity, |
200 flipped); | 202 flipped); |
201 quad_sink->Append(texture_quad.PassAs<DrawQuad>(), append_quads_data); | 203 quad_sink->Append(texture_quad.PassAs<DrawQuad>(), append_quads_data); |
202 break; | 204 break; |
203 } | 205 } |
204 case VideoFrameExternalResources::STREAM_TEXTURE_RESOURCE: { | 206 case VideoFrameExternalResources::STREAM_TEXTURE_RESOURCE: { |
205 DCHECK_EQ(frame_resources_.size(), 1u); | 207 DCHECK_EQ(frame_resources_.size(), 1u); |
206 if (frame_resources_.size() < 1u) | 208 if (frame_resources_.size() < 1u) |
207 break; | 209 break; |
208 gfx::Transform transform( | 210 gfx::Transform transform( |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 void VideoLayerImpl::SetProviderClientImpl( | 302 void VideoLayerImpl::SetProviderClientImpl( |
301 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) { | 303 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) { |
302 provider_client_impl_ = provider_client_impl; | 304 provider_client_impl_ = provider_client_impl; |
303 } | 305 } |
304 | 306 |
305 const char* VideoLayerImpl::LayerTypeAsString() const { | 307 const char* VideoLayerImpl::LayerTypeAsString() const { |
306 return "cc::VideoLayerImpl"; | 308 return "cc::VideoLayerImpl"; |
307 } | 309 } |
308 | 310 |
309 } // namespace cc | 311 } // namespace cc |
OLD | NEW |