| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 break; | 310 break; |
| 311 } | 311 } |
| 312 case VideoFrameExternalResources::STREAM_TEXTURE_RESOURCE: { | 312 case VideoFrameExternalResources::STREAM_TEXTURE_RESOURCE: { |
| 313 DCHECK_EQ(frame_resources_.size(), 1u); | 313 DCHECK_EQ(frame_resources_.size(), 1u); |
| 314 if (frame_resources_.size() < 1u) | 314 if (frame_resources_.size() < 1u) |
| 315 break; | 315 break; |
| 316 gfx::Transform scale; | 316 gfx::Transform scale; |
| 317 scale.Scale(tex_width_scale, tex_height_scale); | 317 scale.Scale(tex_width_scale, tex_height_scale); |
| 318 StreamVideoDrawQuad* stream_video_quad = | 318 StreamVideoDrawQuad* stream_video_quad = |
| 319 render_pass->CreateAndAppendDrawQuad<StreamVideoDrawQuad>(); | 319 render_pass->CreateAndAppendDrawQuad<StreamVideoDrawQuad>(); |
| 320 stream_video_quad->SetNew(shared_quad_state, quad_rect, opaque_rect, | 320 stream_video_quad->SetNew( |
| 321 visible_quad_rect, frame_resources_[0].id, | 321 shared_quad_state, quad_rect, opaque_rect, visible_quad_rect, |
| 322 frame_resources_[0].size_in_pixels, scale); | 322 frame_resources_[0].id, frame_resources_[0].size_in_pixels, |
| 323 scale * provider_client_impl_->StreamTextureMatrix()); |
| 323 ValidateQuadResources(stream_video_quad); | 324 ValidateQuadResources(stream_video_quad); |
| 324 break; | 325 break; |
| 325 } | 326 } |
| 326 #if defined(VIDEO_HOLE) | 327 #if defined(VIDEO_HOLE) |
| 327 // This block and other blocks wrapped around #if defined(VIDEO_HOLE) is not | 328 // This block and other blocks wrapped around #if defined(VIDEO_HOLE) is not |
| 328 // maintained by the general compositor team. Please contact the following | 329 // maintained by the general compositor team. Please contact the following |
| 329 // people instead: | 330 // people instead: |
| 330 // | 331 // |
| 331 // wonsik@chromium.org | 332 // wonsik@chromium.org |
| 332 // lcwu@chromium.org | 333 // lcwu@chromium.org |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 void VideoLayerImpl::SetNeedsRedraw() { | 397 void VideoLayerImpl::SetNeedsRedraw() { |
| 397 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); | 398 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); |
| 398 layer_tree_impl()->SetNeedsRedraw(); | 399 layer_tree_impl()->SetNeedsRedraw(); |
| 399 } | 400 } |
| 400 | 401 |
| 401 const char* VideoLayerImpl::LayerTypeAsString() const { | 402 const char* VideoLayerImpl::LayerTypeAsString() const { |
| 402 return "cc::VideoLayerImpl"; | 403 return "cc::VideoLayerImpl"; |
| 403 } | 404 } |
| 404 | 405 |
| 405 } // namespace cc | 406 } // namespace cc |
| OLD | NEW |