| 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/logging.h" | 7 #include "base/logging.h" |
| 8 #include "cc/base/math_util.h" | 8 #include "cc/base/math_util.h" |
| 9 #include "cc/layers/quad_sink.h" | 9 #include "cc/layers/quad_sink.h" |
| 10 #include "cc/layers/video_frame_provider_client_impl.h" | 10 #include "cc/layers/video_frame_provider_client_impl.h" |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 video_renderer_->Paint(frame_, | 424 video_renderer_->Paint(frame_, |
| 425 lock.sk_canvas(), | 425 lock.sk_canvas(), |
| 426 frame_->visible_rect(), | 426 frame_->visible_rect(), |
| 427 0xff); | 427 0xff); |
| 428 return true; | 428 return true; |
| 429 } | 429 } |
| 430 | 430 |
| 431 for (size_t plane_index = 0; plane_index < plane_count; ++plane_index) { | 431 for (size_t plane_index = 0; plane_index < plane_count; ++plane_index) { |
| 432 const VideoLayerImpl::FramePlane& plane = frame_planes_[plane_index]; | 432 const VideoLayerImpl::FramePlane& plane = frame_planes_[plane_index]; |
| 433 // Only planar formats planes should need upload. | 433 // Only planar formats planes should need upload. |
| 434 DCHECK_EQ(plane.format, GL_LUMINANCE); | 434 DCHECK_EQ(plane.format, static_cast<unsigned>(GL_LUMINANCE)); |
| 435 const uint8_t* software_plane_pixels = frame_->data(plane_index); | 435 const uint8_t* software_plane_pixels = frame_->data(plane_index); |
| 436 gfx::Rect image_rect(0, | 436 gfx::Rect image_rect(0, |
| 437 0, | 437 0, |
| 438 frame_->stride(plane_index), | 438 frame_->stride(plane_index), |
| 439 plane.size.height()); | 439 plane.size.height()); |
| 440 gfx::Rect source_rect(plane.size); | 440 gfx::Rect source_rect(plane.size); |
| 441 resource_provider->SetPixels(plane.resource_id, | 441 resource_provider->SetPixels(plane.resource_id, |
| 442 software_plane_pixels, | 442 software_plane_pixels, |
| 443 image_rect, | 443 image_rect, |
| 444 source_rect, | 444 source_rect, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 471 void VideoLayerImpl::SetProviderClientImpl( | 471 void VideoLayerImpl::SetProviderClientImpl( |
| 472 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) { | 472 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) { |
| 473 provider_client_impl_ = provider_client_impl; | 473 provider_client_impl_ = provider_client_impl; |
| 474 } | 474 } |
| 475 | 475 |
| 476 const char* VideoLayerImpl::LayerTypeAsString() const { | 476 const char* VideoLayerImpl::LayerTypeAsString() const { |
| 477 return "VideoLayer"; | 477 return "VideoLayer"; |
| 478 } | 478 } |
| 479 | 479 |
| 480 } // namespace cc | 480 } // namespace cc |
| OLD | NEW |