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

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

Issue 1420943002: media: Compute proper VideoFrame::coded_rect for copies to GMBs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on master. Created 5 years, 2 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 | media/video/gpu_memory_buffer_video_frame_pool.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 if (frame_->metadata()->GetInteger(media::VideoFrameMetadata::COLOR_SPACE, 226 if (frame_->metadata()->GetInteger(media::VideoFrameMetadata::COLOR_SPACE,
227 &videoframe_color_space)) { 227 &videoframe_color_space)) {
228 if (videoframe_color_space == media::COLOR_SPACE_JPEG) { 228 if (videoframe_color_space == media::COLOR_SPACE_JPEG) {
229 color_space = YUVVideoDrawQuad::JPEG; 229 color_space = YUVVideoDrawQuad::JPEG;
230 } else if (videoframe_color_space == media::COLOR_SPACE_HD_REC709) { 230 } else if (videoframe_color_space == media::COLOR_SPACE_HD_REC709) {
231 color_space = YUVVideoDrawQuad::REC_709; 231 color_space = YUVVideoDrawQuad::REC_709;
232 } 232 }
233 } 233 }
234 234
235 const gfx::Size ya_tex_size = coded_size; 235 const gfx::Size ya_tex_size = coded_size;
236 gfx::Size uv_tex_size; 236 gfx::Size uv_tex_size = media::VideoFrame::PlaneSize(
237 frame_->format(), media::VideoFrame::kUPlane, coded_size);
237 238
238 if (frame_->HasTextures()) { 239 if (frame_->HasTextures()) {
239 DCHECK_EQ(media::PIXEL_FORMAT_I420, frame_->format()); 240 DCHECK_EQ(media::PIXEL_FORMAT_I420, frame_->format());
240 DCHECK_EQ(3u, frame_resources_.size()); // Alpha is not supported yet. 241 DCHECK_EQ(3u, frame_resources_.size()); // Alpha is not supported yet.
241 DCHECK(visible_rect.origin().IsOrigin());
242 DCHECK(visible_rect.size() == coded_size);
243 uv_tex_size.SetSize((ya_tex_size.width() + 1) / 2,
244 (ya_tex_size.height() + 1) / 2);
245 } else { 242 } else {
246 uv_tex_size = media::VideoFrame::PlaneSize(
247 frame_->format(), media::VideoFrame::kUPlane, coded_size);
248 DCHECK(uv_tex_size == 243 DCHECK(uv_tex_size ==
249 media::VideoFrame::PlaneSize( 244 media::VideoFrame::PlaneSize(
250 frame_->format(), media::VideoFrame::kVPlane, coded_size)); 245 frame_->format(), media::VideoFrame::kVPlane, coded_size));
251 DCHECK_IMPLIES( 246 DCHECK_IMPLIES(
252 frame_resources_.size() > 3, 247 frame_resources_.size() > 3,
253 ya_tex_size == 248 ya_tex_size ==
254 media::VideoFrame::PlaneSize( 249 media::VideoFrame::PlaneSize(
255 frame_->format(), media::VideoFrame::kAPlane, coded_size)); 250 frame_->format(), media::VideoFrame::kAPlane, coded_size));
256 } 251 }
257 252
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 void VideoLayerImpl::SetNeedsRedraw() { 398 void VideoLayerImpl::SetNeedsRedraw() {
404 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); 399 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds())));
405 layer_tree_impl()->SetNeedsRedraw(); 400 layer_tree_impl()->SetNeedsRedraw();
406 } 401 }
407 402
408 const char* VideoLayerImpl::LayerTypeAsString() const { 403 const char* VideoLayerImpl::LayerTypeAsString() const {
409 return "cc::VideoLayerImpl"; 404 return "cc::VideoLayerImpl";
410 } 405 }
411 406
412 } // namespace cc 407 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | media/video/gpu_memory_buffer_video_frame_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698