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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 case VideoFrameExternalResources::SOFTWARE_RESOURCE: { | 193 case VideoFrameExternalResources::SOFTWARE_RESOURCE: { |
194 DCHECK_EQ(frame_resources_.size(), 0u); | 194 DCHECK_EQ(frame_resources_.size(), 0u); |
195 DCHECK_EQ(software_resources_.size(), 1u); | 195 DCHECK_EQ(software_resources_.size(), 1u); |
196 if (software_resources_.size() < 1u) | 196 if (software_resources_.size() < 1u) |
197 break; | 197 break; |
198 bool premultiplied_alpha = true; | 198 bool premultiplied_alpha = true; |
199 gfx::PointF uv_top_left(0.f, 0.f); | 199 gfx::PointF uv_top_left(0.f, 0.f); |
200 gfx::PointF uv_bottom_right(tex_width_scale, tex_height_scale); | 200 gfx::PointF uv_bottom_right(tex_width_scale, tex_height_scale); |
201 float opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; | 201 float opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; |
202 bool flipped = false; | 202 bool flipped = false; |
| 203 bool nearest_neighbor = false; |
203 TextureDrawQuad* texture_quad = | 204 TextureDrawQuad* texture_quad = |
204 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); | 205 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); |
205 texture_quad->SetNew(shared_quad_state, | 206 texture_quad->SetNew(shared_quad_state, |
206 quad_rect, | 207 quad_rect, |
207 opaque_rect, | 208 opaque_rect, |
208 visible_quad_rect, | 209 visible_quad_rect, |
209 software_resources_[0], | 210 software_resources_[0], |
210 premultiplied_alpha, | 211 premultiplied_alpha, |
211 uv_top_left, | 212 uv_top_left, |
212 uv_bottom_right, | 213 uv_bottom_right, |
213 SK_ColorTRANSPARENT, | 214 SK_ColorTRANSPARENT, |
214 opacity, | 215 opacity, |
215 flipped); | 216 flipped, |
| 217 nearest_neighbor); |
216 break; | 218 break; |
217 } | 219 } |
218 case VideoFrameExternalResources::YUV_RESOURCE: { | 220 case VideoFrameExternalResources::YUV_RESOURCE: { |
219 DCHECK_GE(frame_resources_.size(), 3u); | 221 DCHECK_GE(frame_resources_.size(), 3u); |
220 if (frame_resources_.size() < 3u) | 222 if (frame_resources_.size() < 3u) |
221 break; | 223 break; |
222 YUVVideoDrawQuad::ColorSpace color_space = | 224 YUVVideoDrawQuad::ColorSpace color_space = |
223 frame_->format() == media::VideoFrame::YV12J | 225 frame_->format() == media::VideoFrame::YV12J |
224 ? YUVVideoDrawQuad::REC_601_JPEG | 226 ? YUVVideoDrawQuad::REC_601_JPEG |
225 : YUVVideoDrawQuad::REC_601; | 227 : YUVVideoDrawQuad::REC_601; |
(...skipping 16 matching lines...) Expand all Loading... |
242 } | 244 } |
243 case VideoFrameExternalResources::RGB_RESOURCE: { | 245 case VideoFrameExternalResources::RGB_RESOURCE: { |
244 DCHECK_EQ(frame_resources_.size(), 1u); | 246 DCHECK_EQ(frame_resources_.size(), 1u); |
245 if (frame_resources_.size() < 1u) | 247 if (frame_resources_.size() < 1u) |
246 break; | 248 break; |
247 bool premultiplied_alpha = true; | 249 bool premultiplied_alpha = true; |
248 gfx::PointF uv_top_left(0.f, 0.f); | 250 gfx::PointF uv_top_left(0.f, 0.f); |
249 gfx::PointF uv_bottom_right(tex_width_scale, tex_height_scale); | 251 gfx::PointF uv_bottom_right(tex_width_scale, tex_height_scale); |
250 float opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; | 252 float opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; |
251 bool flipped = false; | 253 bool flipped = false; |
| 254 bool nearest_neighbor = false; |
252 TextureDrawQuad* texture_quad = | 255 TextureDrawQuad* texture_quad = |
253 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); | 256 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); |
254 texture_quad->SetNew(shared_quad_state, | 257 texture_quad->SetNew(shared_quad_state, |
255 quad_rect, | 258 quad_rect, |
256 opaque_rect, | 259 opaque_rect, |
257 visible_quad_rect, | 260 visible_quad_rect, |
258 frame_resources_[0], | 261 frame_resources_[0], |
259 premultiplied_alpha, | 262 premultiplied_alpha, |
260 uv_top_left, | 263 uv_top_left, |
261 uv_bottom_right, | 264 uv_bottom_right, |
262 SK_ColorTRANSPARENT, | 265 SK_ColorTRANSPARENT, |
263 opacity, | 266 opacity, |
264 flipped); | 267 flipped, |
| 268 nearest_neighbor); |
265 break; | 269 break; |
266 } | 270 } |
267 case VideoFrameExternalResources::STREAM_TEXTURE_RESOURCE: { | 271 case VideoFrameExternalResources::STREAM_TEXTURE_RESOURCE: { |
268 DCHECK_EQ(frame_resources_.size(), 1u); | 272 DCHECK_EQ(frame_resources_.size(), 1u); |
269 if (frame_resources_.size() < 1u) | 273 if (frame_resources_.size() < 1u) |
270 break; | 274 break; |
271 gfx::Transform scale; | 275 gfx::Transform scale; |
272 scale.Scale(tex_width_scale, tex_height_scale); | 276 scale.Scale(tex_width_scale, tex_height_scale); |
273 StreamVideoDrawQuad* stream_video_quad = | 277 StreamVideoDrawQuad* stream_video_quad = |
274 render_pass->CreateAndAppendDrawQuad<StreamVideoDrawQuad>(); | 278 render_pass->CreateAndAppendDrawQuad<StreamVideoDrawQuad>(); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 void VideoLayerImpl::SetProviderClientImpl( | 369 void VideoLayerImpl::SetProviderClientImpl( |
366 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) { | 370 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) { |
367 provider_client_impl_ = provider_client_impl; | 371 provider_client_impl_ = provider_client_impl; |
368 } | 372 } |
369 | 373 |
370 const char* VideoLayerImpl::LayerTypeAsString() const { | 374 const char* VideoLayerImpl::LayerTypeAsString() const { |
371 return "cc::VideoLayerImpl"; | 375 return "cc::VideoLayerImpl"; |
372 } | 376 } |
373 | 377 |
374 } // namespace cc | 378 } // namespace cc |
OLD | NEW |