OLD | NEW |
1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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.h" | 5 #include "cc/layers/video_layer.h" |
6 | 6 |
7 #include "cc/layers/video_layer_impl.h" | 7 #include "cc/layers/video_layer_impl.h" |
8 | 8 |
9 namespace cc { | 9 namespace cc { |
10 | 10 |
11 scoped_refptr<VideoLayer> VideoLayer::Create( | 11 scoped_refptr<VideoLayer> VideoLayer::Create( |
12 const LayerSettings& settings, | |
13 VideoFrameProvider* provider, | 12 VideoFrameProvider* provider, |
14 media::VideoRotation video_rotation) { | 13 media::VideoRotation video_rotation) { |
15 return make_scoped_refptr(new VideoLayer(settings, provider, video_rotation)); | 14 return make_scoped_refptr(new VideoLayer(provider, video_rotation)); |
16 } | 15 } |
17 | 16 |
18 VideoLayer::VideoLayer(const LayerSettings& settings, | 17 VideoLayer::VideoLayer(VideoFrameProvider* provider, |
19 VideoFrameProvider* provider, | |
20 media::VideoRotation video_rotation) | 18 media::VideoRotation video_rotation) |
21 : Layer(settings), provider_(provider), video_rotation_(video_rotation) { | 19 : provider_(provider), video_rotation_(video_rotation) { |
22 DCHECK(provider_); | 20 DCHECK(provider_); |
23 } | 21 } |
24 | 22 |
25 VideoLayer::~VideoLayer() {} | 23 VideoLayer::~VideoLayer() {} |
26 | 24 |
27 scoped_ptr<LayerImpl> VideoLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) { | 25 scoped_ptr<LayerImpl> VideoLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) { |
28 return VideoLayerImpl::Create(tree_impl, id(), provider_, video_rotation_); | 26 return VideoLayerImpl::Create(tree_impl, id(), provider_, video_rotation_); |
29 } | 27 } |
30 | 28 |
31 bool VideoLayer::Update() { | 29 bool VideoLayer::Update() { |
32 bool updated = Layer::Update(); | 30 bool updated = Layer::Update(); |
33 | 31 |
34 // Video layer doesn't update any resources from the main thread side, | 32 // Video layer doesn't update any resources from the main thread side, |
35 // but repaint rects need to be sent to the VideoLayerImpl via commit. | 33 // but repaint rects need to be sent to the VideoLayerImpl via commit. |
36 // | 34 // |
37 // This is the inefficient legacy redraw path for videos. It's better to | 35 // This is the inefficient legacy redraw path for videos. It's better to |
38 // communicate this directly to the VideoLayerImpl. | 36 // communicate this directly to the VideoLayerImpl. |
39 updated |= !update_rect_.IsEmpty(); | 37 updated |= !update_rect_.IsEmpty(); |
40 | 38 |
41 return updated; | 39 return updated; |
42 } | 40 } |
43 | 41 |
44 } // namespace cc | 42 } // namespace cc |
OLD | NEW |