| 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 float opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; | 301 float opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; |
| 302 bool flipped = false; | 302 bool flipped = false; |
| 303 bool nearest_neighbor = false; | 303 bool nearest_neighbor = false; |
| 304 TextureDrawQuad* texture_quad = | 304 TextureDrawQuad* texture_quad = |
| 305 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); | 305 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); |
| 306 texture_quad->SetNew(shared_quad_state, quad_rect, opaque_rect, | 306 texture_quad->SetNew(shared_quad_state, quad_rect, opaque_rect, |
| 307 visible_quad_rect, frame_resources_[0].id, | 307 visible_quad_rect, frame_resources_[0].id, |
| 308 premultiplied_alpha, uv_top_left, uv_bottom_right, | 308 premultiplied_alpha, uv_top_left, uv_bottom_right, |
| 309 SK_ColorTRANSPARENT, opacity, flipped, | 309 SK_ColorTRANSPARENT, opacity, flipped, |
| 310 nearest_neighbor, false); | 310 nearest_neighbor, false); |
| 311 texture_quad->set_resource_size_in_pixels(coded_size); |
| 311 ValidateQuadResources(texture_quad); | 312 ValidateQuadResources(texture_quad); |
| 312 break; | 313 break; |
| 313 } | 314 } |
| 314 case VideoFrameExternalResources::STREAM_TEXTURE_RESOURCE: { | 315 case VideoFrameExternalResources::STREAM_TEXTURE_RESOURCE: { |
| 315 DCHECK_EQ(frame_resources_.size(), 1u); | 316 DCHECK_EQ(frame_resources_.size(), 1u); |
| 316 if (frame_resources_.size() < 1u) | 317 if (frame_resources_.size() < 1u) |
| 317 break; | 318 break; |
| 318 gfx::Transform scale; | 319 gfx::Transform scale; |
| 319 scale.Scale(tex_width_scale, tex_height_scale); | 320 scale.Scale(tex_width_scale, tex_height_scale); |
| 320 StreamVideoDrawQuad* stream_video_quad = | 321 StreamVideoDrawQuad* stream_video_quad = |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 void VideoLayerImpl::SetNeedsRedraw() { | 374 void VideoLayerImpl::SetNeedsRedraw() { |
| 374 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); | 375 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); |
| 375 layer_tree_impl()->SetNeedsRedraw(); | 376 layer_tree_impl()->SetNeedsRedraw(); |
| 376 } | 377 } |
| 377 | 378 |
| 378 const char* VideoLayerImpl::LayerTypeAsString() const { | 379 const char* VideoLayerImpl::LayerTypeAsString() const { |
| 379 return "cc::VideoLayerImpl"; | 380 return "cc::VideoLayerImpl"; |
| 380 } | 381 } |
| 381 | 382 |
| 382 } // namespace cc | 383 } // namespace cc |
| OLD | NEW |