Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: cc/layers/video_layer_impl.cc

Issue 2892423004: cc: make texture draw quad of video overlay candidate. (Closed)
Patch Set: add unittests Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | cc/layers/video_layer_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | cc/layers/video_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698