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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 scale.Scale(tex_width_scale, tex_height_scale); | 313 scale.Scale(tex_width_scale, tex_height_scale); |
314 StreamVideoDrawQuad* stream_video_quad = | 314 StreamVideoDrawQuad* stream_video_quad = |
315 render_pass->CreateAndAppendDrawQuad<StreamVideoDrawQuad>(); | 315 render_pass->CreateAndAppendDrawQuad<StreamVideoDrawQuad>(); |
316 stream_video_quad->SetNew( | 316 stream_video_quad->SetNew( |
317 shared_quad_state, quad_rect, opaque_rect, visible_quad_rect, | 317 shared_quad_state, quad_rect, opaque_rect, visible_quad_rect, |
318 frame_resources_[0], | 318 frame_resources_[0], |
319 scale * provider_client_impl_->StreamTextureMatrix()); | 319 scale * provider_client_impl_->StreamTextureMatrix()); |
320 ValidateQuadResources(stream_video_quad); | 320 ValidateQuadResources(stream_video_quad); |
321 break; | 321 break; |
322 } | 322 } |
| 323 case VideoFrameExternalResources::IO_SURFACE: { |
| 324 DCHECK_EQ(frame_resources_.size(), 1u); |
| 325 if (frame_resources_.size() < 1u) |
| 326 break; |
| 327 IOSurfaceDrawQuad* io_surface_quad = |
| 328 render_pass->CreateAndAppendDrawQuad<IOSurfaceDrawQuad>(); |
| 329 io_surface_quad->SetNew(shared_quad_state, |
| 330 quad_rect, |
| 331 opaque_rect, |
| 332 visible_quad_rect, |
| 333 visible_rect.size(), |
| 334 frame_resources_[0], |
| 335 IOSurfaceDrawQuad::UNFLIPPED); |
| 336 ValidateQuadResources(io_surface_quad); |
| 337 break; |
| 338 } |
323 #if defined(VIDEO_HOLE) | 339 #if defined(VIDEO_HOLE) |
324 // This block and other blocks wrapped around #if defined(VIDEO_HOLE) is not | 340 // This block and other blocks wrapped around #if defined(VIDEO_HOLE) is not |
325 // maintained by the general compositor team. Please contact the following | 341 // maintained by the general compositor team. Please contact the following |
326 // people instead: | 342 // people instead: |
327 // | 343 // |
328 // wonsik@chromium.org | 344 // wonsik@chromium.org |
329 // lcwu@chromium.org | 345 // lcwu@chromium.org |
330 case VideoFrameExternalResources::HOLE: { | 346 case VideoFrameExternalResources::HOLE: { |
331 DCHECK_EQ(frame_resources_.size(), 0u); | 347 DCHECK_EQ(frame_resources_.size(), 0u); |
332 SolidColorDrawQuad* solid_color_draw_quad = | 348 SolidColorDrawQuad* solid_color_draw_quad = |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 void VideoLayerImpl::SetNeedsRedraw() { | 407 void VideoLayerImpl::SetNeedsRedraw() { |
392 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); | 408 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); |
393 layer_tree_impl()->SetNeedsRedraw(); | 409 layer_tree_impl()->SetNeedsRedraw(); |
394 } | 410 } |
395 | 411 |
396 const char* VideoLayerImpl::LayerTypeAsString() const { | 412 const char* VideoLayerImpl::LayerTypeAsString() const { |
397 return "cc::VideoLayerImpl"; | 413 return "cc::VideoLayerImpl"; |
398 } | 414 } |
399 | 415 |
400 } // namespace cc | 416 } // namespace cc |
OLD | NEW |