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.
5 #include "cc/test/fake_picture_layer.h"
7 #include "cc/test/fake_picture_layer_impl.h"
11 FakePictureLayer::FakePictureLayer(const LayerSettings
& settings
,
12 ContentLayerClient
* client
)
13 : PictureLayer(settings
, client
),
15 push_properties_count_(0),
16 always_update_resources_(false) {
17 SetBounds(gfx::Size(1, 1));
21 FakePictureLayer::FakePictureLayer(const LayerSettings
& settings
,
22 ContentLayerClient
* client
,
23 scoped_ptr
<RecordingSource
> source
)
24 : PictureLayer(settings
, client
, source
.Pass()),
26 push_properties_count_(0),
27 always_update_resources_(false) {
28 SetBounds(gfx::Size(1, 1));
32 FakePictureLayer::~FakePictureLayer() {}
34 scoped_ptr
<LayerImpl
> FakePictureLayer::CreateLayerImpl(
35 LayerTreeImpl
* tree_impl
) {
37 return FakePictureLayerImpl::CreateMask(tree_impl
, layer_id_
);
38 return FakePictureLayerImpl::Create(tree_impl
, layer_id_
);
41 bool FakePictureLayer::Update() {
42 bool updated
= PictureLayer::Update();
44 return updated
|| always_update_resources_
;
47 void FakePictureLayer::PushPropertiesTo(LayerImpl
* layer
) {
48 PictureLayer::PushPropertiesTo(layer
);
49 push_properties_count_
++;