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

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

Issue 1154153003: Relanding 1143663007: VideoFrame: Separate Pixel Format from Storage Type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added NV12 support in CrOS Created 5 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/resources/video_resource_updater.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 "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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 color_space = YUVVideoDrawQuad::JPEG; 226 color_space = YUVVideoDrawQuad::JPEG;
227 } else if (videoframe_color_space == 227 } else if (videoframe_color_space ==
228 media::VideoFrame::COLOR_SPACE_HD_REC709) { 228 media::VideoFrame::COLOR_SPACE_HD_REC709) {
229 color_space = YUVVideoDrawQuad::REC_709; 229 color_space = YUVVideoDrawQuad::REC_709;
230 } 230 }
231 } 231 }
232 232
233 const gfx::Size ya_tex_size = coded_size; 233 const gfx::Size ya_tex_size = coded_size;
234 gfx::Size uv_tex_size; 234 gfx::Size uv_tex_size;
235 235
236 if (frame_->format() == media::VideoFrame::NATIVE_TEXTURE) { 236 if (frame_->storage_type() == media::VideoFrame::STORAGE_TEXTURE) {
237 DCHECK_EQ(media::VideoFrame::TEXTURE_YUV_420, frame_->texture_format()); 237 DCHECK_EQ(media::VideoFrame::I420, frame_->format());
238 DCHECK_EQ(3u, frame_resources_.size()); // Alpha is not supported yet. 238 DCHECK_EQ(3u, frame_resources_.size()); // Alpha is not supported yet.
239 DCHECK(visible_rect.origin().IsOrigin()); 239 DCHECK(visible_rect.origin().IsOrigin());
240 DCHECK(visible_rect.size() == coded_size); 240 DCHECK(visible_rect.size() == coded_size);
241 uv_tex_size.SetSize((ya_tex_size.width() + 1) / 2, 241 uv_tex_size.SetSize((ya_tex_size.width() + 1) / 2,
242 (ya_tex_size.height() + 1) / 2); 242 (ya_tex_size.height() + 1) / 2);
243 } else { 243 } else {
244 uv_tex_size = media::VideoFrame::PlaneSize( 244 uv_tex_size = media::VideoFrame::PlaneSize(
245 frame_->format(), media::VideoFrame::kUPlane, coded_size); 245 frame_->format(), media::VideoFrame::kUPlane, coded_size);
246 DCHECK(uv_tex_size == 246 DCHECK(uv_tex_size ==
247 media::VideoFrame::PlaneSize( 247 media::VideoFrame::PlaneSize(
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 void VideoLayerImpl::SetNeedsRedraw() { 407 void VideoLayerImpl::SetNeedsRedraw() {
408 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); 408 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds())));
409 layer_tree_impl()->SetNeedsRedraw(); 409 layer_tree_impl()->SetNeedsRedraw();
410 } 410 }
411 411
412 const char* VideoLayerImpl::LayerTypeAsString() const { 412 const char* VideoLayerImpl::LayerTypeAsString() const {
413 return "cc::VideoLayerImpl"; 413 return "cc::VideoLayerImpl";
414 } 414 }
415 415
416 } // namespace cc 416 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/resources/video_resource_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698