blob: b55d82acfcc1531b0df1c8312e34a54f2d5155ba [file] [log] [blame]
[email protected]94f206c12012-08-25 00:09:141// Copyright 2010 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]cc3cfaa2013-03-18 09:05:525#include "cc/layers/video_layer.h"
[email protected]94f206c12012-08-25 00:09:146
[email protected]cc3cfaa2013-03-18 09:05:527#include "cc/layers/video_layer_impl.h"
[email protected]94f206c12012-08-25 00:09:148
[email protected]9c88e562012-09-14 22:21:309namespace cc {
[email protected]94f206c12012-08-25 00:09:1410
[email protected]f78c3e82014-08-08 01:24:4711scoped_refptr<VideoLayer> VideoLayer::Create(
12 VideoFrameProvider* provider,
13 media::VideoRotation video_rotation) {
loyso0940d412016-03-14 01:30:3114 return make_scoped_refptr(new VideoLayer(provider, video_rotation));
[email protected]94f206c12012-08-25 00:09:1415}
16
loyso0940d412016-03-14 01:30:3117VideoLayer::VideoLayer(VideoFrameProvider* provider,
[email protected]f78c3e82014-08-08 01:24:4718 media::VideoRotation video_rotation)
loyso0940d412016-03-14 01:30:3119 : provider_(provider), video_rotation_(video_rotation) {
[email protected]50657802013-03-13 06:43:3520 DCHECK(provider_);
[email protected]94f206c12012-08-25 00:09:1421}
22
[email protected]50657802013-03-13 06:43:3523VideoLayer::~VideoLayer() {}
[email protected]94f206c12012-08-25 00:09:1424
[email protected]50657802013-03-13 06:43:3525scoped_ptr<LayerImpl> VideoLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) {
danakja04855a2015-11-18 20:39:1026 return VideoLayerImpl::Create(tree_impl, id(), provider_, video_rotation_);
[email protected]94f206c12012-08-25 00:09:1427}
28
danakj5f46636a2015-06-19 00:01:4029bool VideoLayer::Update() {
30 bool updated = Layer::Update();
[email protected]c50b997292013-08-03 18:44:3031
[email protected]41084bf2013-08-02 00:36:3332 // Video layer doesn't update any resources from the main thread side,
33 // but repaint rects need to be sent to the VideoLayerImpl via commit.
34 //
35 // This is the inefficient legacy redraw path for videos. It's better to
36 // communicate this directly to the VideoLayerImpl.
[email protected]c50b997292013-08-03 18:44:3037 updated |= !update_rect_.IsEmpty();
38
39 return updated;
[email protected]41084bf2013-08-02 00:36:3340}
41
[email protected]59cb7b352012-10-30 06:45:4842} // namespace cc