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 } | |
339 #if defined(VIDEO_HOLE) | 323 #if defined(VIDEO_HOLE) |
340 // This block and other blocks wrapped around #if defined(VIDEO_HOLE) is not | 324 // This block and other blocks wrapped around #if defined(VIDEO_HOLE) is not |
341 // maintained by the general compositor team. Please contact the following | 325 // maintained by the general compositor team. Please contact the following |
342 // people instead: | 326 // people instead: |
343 // | 327 // |
344 // wonsik@chromium.org | 328 // wonsik@chromium.org |
345 // lcwu@chromium.org | 329 // lcwu@chromium.org |
346 case VideoFrameExternalResources::HOLE: { | 330 case VideoFrameExternalResources::HOLE: { |
347 DCHECK_EQ(frame_resources_.size(), 0u); | 331 DCHECK_EQ(frame_resources_.size(), 0u); |
348 SolidColorDrawQuad* solid_color_draw_quad = | 332 SolidColorDrawQuad* solid_color_draw_quad = |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 void VideoLayerImpl::SetNeedsRedraw() { | 391 void VideoLayerImpl::SetNeedsRedraw() { |
408 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); | 392 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); |
409 layer_tree_impl()->SetNeedsRedraw(); | 393 layer_tree_impl()->SetNeedsRedraw(); |
410 } | 394 } |
411 | 395 |
412 const char* VideoLayerImpl::LayerTypeAsString() const { | 396 const char* VideoLayerImpl::LayerTypeAsString() const { |
413 return "cc::VideoLayerImpl"; | 397 return "cc::VideoLayerImpl"; |
414 } | 398 } |
415 | 399 |
416 } // namespace cc | 400 } // namespace cc |
OLD | NEW |