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 disable_lcd_text_(false) {
18 SetBounds(gfx::Size(1, 1));
22 FakePictureLayer::FakePictureLayer(const LayerSettings
& settings
,
23 ContentLayerClient
* client
,
24 scoped_ptr
<RecordingSource
> source
)
25 : PictureLayer(settings
, client
, source
.Pass()),
27 push_properties_count_(0),
28 always_update_resources_(false),
29 disable_lcd_text_(false) {
30 SetBounds(gfx::Size(1, 1));
34 FakePictureLayer::~FakePictureLayer() {}
36 scoped_ptr
<LayerImpl
> FakePictureLayer::CreateLayerImpl(
37 LayerTreeImpl
* tree_impl
) {
39 return FakePictureLayerImpl::CreateMask(tree_impl
, layer_id_
);
40 return FakePictureLayerImpl::Create(tree_impl
, layer_id_
);
43 bool FakePictureLayer::Update() {
44 if (disable_lcd_text_
)
45 draw_properties().can_use_lcd_text
= false;
46 bool updated
= PictureLayer::Update();
48 return updated
|| always_update_resources_
;
51 void FakePictureLayer::PushPropertiesTo(LayerImpl
* layer
) {
52 PictureLayer::PushPropertiesTo(layer
);
53 push_properties_count_
++;