Adding a logging class to cast.
[chromium-blink-merge.git] / cc / layers / video_layer.cc
blob8d728e0a8e067a9298a06b427fffbee10df1771b
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
3 // found in the LICENSE file.
5 #include "cc/layers/video_layer.h"
7 #include "cc/layers/video_layer_impl.h"
9 namespace cc {
11 scoped_refptr<VideoLayer> VideoLayer::Create(VideoFrameProvider* provider) {
12 return make_scoped_refptr(new VideoLayer(provider));
15 VideoLayer::VideoLayer(VideoFrameProvider* provider) : provider_(provider) {
16 DCHECK(provider_);
19 VideoLayer::~VideoLayer() {}
21 scoped_ptr<LayerImpl> VideoLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) {
22 return VideoLayerImpl::Create(tree_impl, id(), provider_).PassAs<LayerImpl>();
25 bool VideoLayer::Update(ResourceUpdateQueue* queue,
26 const OcclusionTracker* occlusion) {
27 bool updated = Layer::Update(queue, occlusion);
29 // Video layer doesn't update any resources from the main thread side,
30 // but repaint rects need to be sent to the VideoLayerImpl via commit.
32 // This is the inefficient legacy redraw path for videos. It's better to
33 // communicate this directly to the VideoLayerImpl.
34 updated |= !update_rect_.IsEmpty();
36 return updated;
39 } // namespace cc