| 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 "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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 DCHECK(visible_rect.origin().IsOrigin()); | 241 DCHECK(visible_rect.origin().IsOrigin()); |
| 242 DCHECK(visible_rect.size() == coded_size); | 242 DCHECK(visible_rect.size() == coded_size); |
| 243 uv_tex_size.SetSize((ya_tex_size.width() + 1) / 2, | 243 uv_tex_size.SetSize((ya_tex_size.width() + 1) / 2, |
| 244 (ya_tex_size.height() + 1) / 2); | 244 (ya_tex_size.height() + 1) / 2); |
| 245 } else { | 245 } else { |
| 246 uv_tex_size = media::VideoFrame::PlaneSize( | 246 uv_tex_size = media::VideoFrame::PlaneSize( |
| 247 frame_->format(), media::VideoFrame::kUPlane, coded_size); | 247 frame_->format(), media::VideoFrame::kUPlane, coded_size); |
| 248 DCHECK(uv_tex_size == | 248 DCHECK(uv_tex_size == |
| 249 media::VideoFrame::PlaneSize( | 249 media::VideoFrame::PlaneSize( |
| 250 frame_->format(), media::VideoFrame::kVPlane, coded_size)); | 250 frame_->format(), media::VideoFrame::kVPlane, coded_size)); |
| 251 DCHECK_IMPLIES( | 251 DCHECK(frame_resources_.size() <= 3 || |
| 252 frame_resources_.size() > 3, | 252 ya_tex_size == media::VideoFrame::PlaneSize( |
| 253 ya_tex_size == | 253 frame_->format(), media::VideoFrame::kAPlane, |
| 254 media::VideoFrame::PlaneSize( | 254 coded_size)); |
| 255 frame_->format(), media::VideoFrame::kAPlane, coded_size)); | |
| 256 } | 255 } |
| 257 | 256 |
| 258 // Compute the UV sub-sampling factor based on the ratio between | 257 // Compute the UV sub-sampling factor based on the ratio between |
| 259 // |ya_tex_size| and |uv_tex_size|. | 258 // |ya_tex_size| and |uv_tex_size|. |
| 260 float uv_subsampling_factor_x = | 259 float uv_subsampling_factor_x = |
| 261 static_cast<float>(ya_tex_size.width()) / uv_tex_size.width(); | 260 static_cast<float>(ya_tex_size.width()) / uv_tex_size.width(); |
| 262 float uv_subsampling_factor_y = | 261 float uv_subsampling_factor_y = |
| 263 static_cast<float>(ya_tex_size.height()) / uv_tex_size.height(); | 262 static_cast<float>(ya_tex_size.height()) / uv_tex_size.height(); |
| 264 gfx::RectF ya_tex_coord_rect(visible_rect); | 263 gfx::RectF ya_tex_coord_rect(visible_rect); |
| 265 gfx::RectF uv_tex_coord_rect( | 264 gfx::RectF uv_tex_coord_rect( |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 void VideoLayerImpl::SetNeedsRedraw() { | 402 void VideoLayerImpl::SetNeedsRedraw() { |
| 404 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); | 403 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); |
| 405 layer_tree_impl()->SetNeedsRedraw(); | 404 layer_tree_impl()->SetNeedsRedraw(); |
| 406 } | 405 } |
| 407 | 406 |
| 408 const char* VideoLayerImpl::LayerTypeAsString() const { | 407 const char* VideoLayerImpl::LayerTypeAsString() const { |
| 409 return "cc::VideoLayerImpl"; | 408 return "cc::VideoLayerImpl"; |
| 410 } | 409 } |
| 411 | 410 |
| 412 } // namespace cc | 411 } // namespace cc |
| OLD | NEW |