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(ContentLayerClient
* client
)
12 : PictureLayer(client
),
14 push_properties_count_(0),
15 output_surface_created_count_(0),
16 always_update_resources_(false),
17 disable_lcd_text_(false) {
18 SetBounds(gfx::Size(1, 1));
22 FakePictureLayer::FakePictureLayer(ContentLayerClient
* client
,
23 scoped_ptr
<RecordingSource
> source
)
24 : PictureLayer(client
, source
.Pass()),
26 push_properties_count_(0),
27 output_surface_created_count_(0),
28 always_update_resources_(false) {
29 SetBounds(gfx::Size(1, 1));
33 FakePictureLayer::~FakePictureLayer() {}
35 scoped_ptr
<LayerImpl
> FakePictureLayer::CreateLayerImpl(
36 LayerTreeImpl
* tree_impl
) {
37 return FakePictureLayerImpl::Create(tree_impl
, layer_id_
);
40 bool FakePictureLayer::Update(ResourceUpdateQueue
* queue
,
41 const OcclusionTracker
<Layer
>* occlusion
) {
42 if (disable_lcd_text_
)
43 draw_properties().can_use_lcd_text
= false;
44 bool updated
= PictureLayer::Update(queue
, occlusion
);
46 return updated
|| always_update_resources_
;
49 void FakePictureLayer::PushPropertiesTo(LayerImpl
* layer
) {
50 PictureLayer::PushPropertiesTo(layer
);
51 push_properties_count_
++;
54 void FakePictureLayer::OnOutputSurfaceCreated() {
55 PictureLayer::OnOutputSurfaceCreated();
56 output_surface_created_count_
++;