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 25 matching lines...) Expand all Loading... |
36 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl = | 36 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl = |
37 VideoFrameProviderClientImpl::Create(provider); | 37 VideoFrameProviderClientImpl::Create(provider); |
38 | 38 |
39 return make_scoped_ptr( | 39 return make_scoped_ptr( |
40 new VideoLayerImpl(tree_impl, id, provider_client_impl, video_rotation)); | 40 new VideoLayerImpl(tree_impl, id, provider_client_impl, video_rotation)); |
41 } | 41 } |
42 | 42 |
43 VideoLayerImpl::VideoLayerImpl( | 43 VideoLayerImpl::VideoLayerImpl( |
44 LayerTreeImpl* tree_impl, | 44 LayerTreeImpl* tree_impl, |
45 int id, | 45 int id, |
46 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl, | 46 const scoped_refptr<VideoFrameProviderClientImpl>& provider_client_impl, |
47 media::VideoRotation video_rotation) | 47 media::VideoRotation video_rotation) |
48 : LayerImpl(tree_impl, id), | 48 : LayerImpl(tree_impl, id), |
49 provider_client_impl_(provider_client_impl), | 49 provider_client_impl_(provider_client_impl), |
50 frame_(nullptr), | 50 frame_(nullptr), |
51 video_rotation_(video_rotation) { | 51 video_rotation_(video_rotation) { |
52 } | 52 } |
53 | 53 |
54 VideoLayerImpl::~VideoLayerImpl() { | 54 VideoLayerImpl::~VideoLayerImpl() { |
55 if (!provider_client_impl_->Stopped()) { | 55 if (!provider_client_impl_->Stopped()) { |
56 // In impl side painting, we may have a pending and active layer | 56 // In impl side painting, we may have a pending and active layer |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 void VideoLayerImpl::SetNeedsRedraw() { | 370 void VideoLayerImpl::SetNeedsRedraw() { |
371 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); | 371 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); |
372 layer_tree_impl()->SetNeedsRedraw(); | 372 layer_tree_impl()->SetNeedsRedraw(); |
373 } | 373 } |
374 | 374 |
375 const char* VideoLayerImpl::LayerTypeAsString() const { | 375 const char* VideoLayerImpl::LayerTypeAsString() const { |
376 return "cc::VideoLayerImpl"; | 376 return "cc::VideoLayerImpl"; |
377 } | 377 } |
378 | 378 |
379 } // namespace cc | 379 } // namespace cc |
OLD | NEW |