blob: ff69a2c886953671125a9a9102aa7c07ff9c72ca [file] [log] [blame]
[email protected]d98c0242012-11-08 06:22:351// Copyright 2012 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
5#include "config.h"
6
7#include "cc/picture_layer.h"
8#include "cc/picture_layer_impl.h"
9
10namespace cc {
11
12scoped_refptr<PictureLayer> PictureLayer::create(ContentLayerClient* client) {
13 return make_scoped_refptr(new PictureLayer(client));
14}
15
16PictureLayer::PictureLayer(ContentLayerClient* client) :
17 client_(client) {
18}
19
20PictureLayer::~PictureLayer() {
21}
22
23bool PictureLayer::drawsContent() const {
24 return Layer::drawsContent() && client_;
25}
26
27scoped_ptr<LayerImpl> PictureLayer::createLayerImpl() {
28 return PictureLayerImpl::create(id()).PassAs<LayerImpl>();
29}
30
31void PictureLayer::pushPropertiesTo(LayerImpl* baseLayerImpl) {
32 PictureLayerImpl* layerImpl = static_cast<PictureLayerImpl*>(baseLayerImpl);
33 pile_.pushPropertiesTo(layerImpl->pile_);
34}
35
36} // namespace cc