blob: fcb549b82bbe0e40d2bdd16b9d9dfd1955808719 [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
danakj60bc3bc2016-04-09 00:24:4825std::unique_ptr<LayerImpl> VideoLayer::CreateLayerImpl(
26 LayerTreeImpl* tree_impl) {
danakja04855a2015-11-18 20:39:1027 return VideoLayerImpl::Create(tree_impl, id(), provider_, video_rotation_);
[email protected]94f206c12012-08-25 00:09:1428}
29
danakj5f46636a2015-06-19 00:01:4030bool VideoLayer::Update() {
31 bool updated = Layer::Update();
[email protected]c50b997292013-08-03 18:44:3032
[email protected]41084bf2013-08-02 00:36:3333 // Video layer doesn't update any resources from the main thread side,
34 // but repaint rects need to be sent to the VideoLayerImpl via commit.
35 //
36 // This is the inefficient legacy redraw path for videos. It's better to
37 // communicate this directly to the VideoLayerImpl.
[email protected]c50b997292013-08-03 18:44:3038 updated |= !update_rect_.IsEmpty();
39
40 return updated;
[email protected]41084bf2013-08-02 00:36:3341}
42
[email protected]59cb7b352012-10-30 06:45:4843} // namespace cc