Revert "Fix broken channel icon in chrome://help on CrOS" and try again
[chromium-blink-merge.git] / cc / test / fake_picture_layer.cc
blob2423ac51972946eba0797164463e73355d5630f2
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"
9 namespace cc {
11 FakePictureLayer::FakePictureLayer(const LayerSettings& settings,
12 ContentLayerClient* client)
13 : PictureLayer(settings, client),
14 update_count_(0),
15 push_properties_count_(0),
16 always_update_resources_(false),
17 disable_lcd_text_(false) {
18 SetBounds(gfx::Size(1, 1));
19 SetIsDrawable(true);
22 FakePictureLayer::FakePictureLayer(const LayerSettings& settings,
23 ContentLayerClient* client,
24 scoped_ptr<RecordingSource> source)
25 : PictureLayer(settings, client, source.Pass()),
26 update_count_(0),
27 push_properties_count_(0),
28 always_update_resources_(false),
29 disable_lcd_text_(false) {
30 SetBounds(gfx::Size(1, 1));
31 SetIsDrawable(true);
34 FakePictureLayer::~FakePictureLayer() {}
36 scoped_ptr<LayerImpl> FakePictureLayer::CreateLayerImpl(
37 LayerTreeImpl* tree_impl) {
38 if (is_mask())
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();
47 update_count_++;
48 return updated || always_update_resources_;
51 void FakePictureLayer::PushPropertiesTo(LayerImpl* layer) {
52 PictureLayer::PushPropertiesTo(layer);
53 push_properties_count_++;
56 } // namespace cc