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

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

Issue 1134643002: Add distinction between RGB and RGBA native texture video frames and resources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit test breakage from bad merge Created 5 years, 7 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/resources/video_resource_updater.h » ('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 "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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 YUVVideoDrawQuad* yuv_video_quad = 254 YUVVideoDrawQuad* yuv_video_quad =
255 render_pass->CreateAndAppendDrawQuad<YUVVideoDrawQuad>(); 255 render_pass->CreateAndAppendDrawQuad<YUVVideoDrawQuad>();
256 yuv_video_quad->SetNew( 256 yuv_video_quad->SetNew(
257 shared_quad_state, quad_rect, opaque_rect, visible_quad_rect, 257 shared_quad_state, quad_rect, opaque_rect, visible_quad_rect,
258 ya_tex_coord_rect, uv_tex_coord_rect, ya_tex_size, uv_tex_size, 258 ya_tex_coord_rect, uv_tex_coord_rect, ya_tex_size, uv_tex_size,
259 frame_resources_[0], frame_resources_[1], frame_resources_[2], 259 frame_resources_[0], frame_resources_[1], frame_resources_[2],
260 frame_resources_.size() > 3 ? frame_resources_[3] : 0, color_space); 260 frame_resources_.size() > 3 ? frame_resources_[3] : 0, color_space);
261 ValidateQuadResources(yuv_video_quad); 261 ValidateQuadResources(yuv_video_quad);
262 break; 262 break;
263 } 263 }
264 case VideoFrameExternalResources::RGBA_RESOURCE:
264 case VideoFrameExternalResources::RGB_RESOURCE: { 265 case VideoFrameExternalResources::RGB_RESOURCE: {
265 DCHECK_EQ(frame_resources_.size(), 1u); 266 DCHECK_EQ(frame_resources_.size(), 1u);
266 if (frame_resources_.size() < 1u) 267 if (frame_resources_.size() < 1u)
267 break; 268 break;
268 bool premultiplied_alpha = true; 269 bool premultiplied_alpha =
270 (frame_resource_type_ == VideoFrameExternalResources::RGBA_RESOURCE);
269 gfx::PointF uv_top_left(0.f, 0.f); 271 gfx::PointF uv_top_left(0.f, 0.f);
270 gfx::PointF uv_bottom_right(tex_width_scale, tex_height_scale); 272 gfx::PointF uv_bottom_right(tex_width_scale, tex_height_scale);
271 float opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; 273 float opacity[] = {1.0f, 1.0f, 1.0f, 1.0f};
272 bool flipped = false; 274 bool flipped = false;
273 bool nearest_neighbor = false; 275 bool nearest_neighbor = false;
274 TextureDrawQuad* texture_quad = 276 TextureDrawQuad* texture_quad =
275 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); 277 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>();
276 texture_quad->SetNew(shared_quad_state, 278 texture_quad->SetNew(shared_quad_state,
277 quad_rect, 279 quad_rect,
278 opaque_rect, 280 opaque_rect,
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 void VideoLayerImpl::SetNeedsRedraw() { 385 void VideoLayerImpl::SetNeedsRedraw() {
384 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); 386 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds())));
385 layer_tree_impl()->SetNeedsRedraw(); 387 layer_tree_impl()->SetNeedsRedraw();
386 } 388 }
387 389
388 const char* VideoLayerImpl::LayerTypeAsString() const { 390 const char* VideoLayerImpl::LayerTypeAsString() const {
389 return "cc::VideoLayerImpl"; 391 return "cc::VideoLayerImpl";
390 } 392 }
391 393
392 } // namespace cc 394 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/resources/video_resource_updater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698