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(VideoFrameProvider* provider) { | 11 scoped_refptr<VideoLayer> VideoLayer::Create(VideoFrameProvider* provider) { |
12 return make_scoped_refptr(new VideoLayer(provider)); | 12 return make_scoped_refptr(new VideoLayer(provider)); |
13 } | 13 } |
14 | 14 |
15 VideoLayer::VideoLayer(VideoFrameProvider* provider) : provider_(provider) { | 15 VideoLayer::VideoLayer(VideoFrameProvider* provider) : provider_(provider) { |
16 DCHECK(provider_); | 16 DCHECK(provider_); |
17 } | 17 } |
18 | 18 |
19 VideoLayer::~VideoLayer() {} | 19 VideoLayer::~VideoLayer() {} |
20 | 20 |
21 scoped_ptr<LayerImpl> VideoLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) { | 21 scoped_ptr<LayerImpl> VideoLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) { |
22 return VideoLayerImpl::Create(tree_impl, id(), provider_).PassAs<LayerImpl>(); | 22 return VideoLayerImpl::Create(tree_impl, id(), provider_).PassAs<LayerImpl>(); |
23 } | 23 } |
24 | 24 |
25 bool VideoLayer::Update(ResourceUpdateQueue* queue, | |
26 const OcclusionTracker* occlusion) { | |
27 // Video layer doesn't update any resources from the main thread side, | |
28 // but repaint rects need to be sent to the VideoLayerImpl via commit. | |
29 // | |
30 // TODO(enne): Have the video frame provider communicate this directly | |
danakj
2013/08/01 20:22:01
While this will be good, I don't think we'll want
danakj
2013/08/01 20:22:55
I guess we could make this a DCHECK, but there is
| |
31 // to the compositor thread rather than via commit. http://crbug.com/267077 | |
32 return !update_rect_.IsEmpty(); | |
33 } | |
34 | |
25 } // namespace cc | 35 } // namespace cc |
OLD | NEW |