[email protected] | d98c024 | 2012-11-08 06:22:35 | [diff] [blame^] | 1 | // 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 | |
| 10 | namespace cc { |
| 11 | |
| 12 | scoped_refptr<PictureLayer> PictureLayer::create(ContentLayerClient* client) { |
| 13 | return make_scoped_refptr(new PictureLayer(client)); |
| 14 | } |
| 15 | |
| 16 | PictureLayer::PictureLayer(ContentLayerClient* client) : |
| 17 | client_(client) { |
| 18 | } |
| 19 | |
| 20 | PictureLayer::~PictureLayer() { |
| 21 | } |
| 22 | |
| 23 | bool PictureLayer::drawsContent() const { |
| 24 | return Layer::drawsContent() && client_; |
| 25 | } |
| 26 | |
| 27 | scoped_ptr<LayerImpl> PictureLayer::createLayerImpl() { |
| 28 | return PictureLayerImpl::create(id()).PassAs<LayerImpl>(); |
| 29 | } |
| 30 | |
| 31 | void PictureLayer::pushPropertiesTo(LayerImpl* baseLayerImpl) { |
| 32 | PictureLayerImpl* layerImpl = static_cast<PictureLayerImpl*>(baseLayerImpl); |
| 33 | pile_.pushPropertiesTo(layerImpl->pile_); |
| 34 | } |
| 35 | |
| 36 | } // namespace cc |