Create an initial chrome://supervised-user-internals page
[chromium-blink-merge.git] / cc / test / fake_picture_layer.cc
blob0732b307314cf567e7ae875aee8065328abe6b65
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 output_surface_created_count_(0),
17 always_update_resources_(false),
18 disable_lcd_text_(false) {
19 SetBounds(gfx::Size(1, 1));
20 SetIsDrawable(true);
23 FakePictureLayer::FakePictureLayer(const LayerSettings& settings,
24 ContentLayerClient* client,
25 scoped_ptr<RecordingSource> source)
26 : PictureLayer(settings, client, source.Pass()),
27 update_count_(0),
28 push_properties_count_(0),
29 output_surface_created_count_(0),
30 always_update_resources_(false),
31 disable_lcd_text_(false) {
32 SetBounds(gfx::Size(1, 1));
33 SetIsDrawable(true);
36 FakePictureLayer::~FakePictureLayer() {}
38 scoped_ptr<LayerImpl> FakePictureLayer::CreateLayerImpl(
39 LayerTreeImpl* tree_impl) {
40 if (is_mask())
41 return FakePictureLayerImpl::CreateMask(tree_impl, layer_id_);
42 return FakePictureLayerImpl::Create(tree_impl, layer_id_);
45 bool FakePictureLayer::Update() {
46 if (disable_lcd_text_)
47 draw_properties().can_use_lcd_text = false;
48 bool updated = PictureLayer::Update();
49 update_count_++;
50 return updated || always_update_resources_;
53 void FakePictureLayer::PushPropertiesTo(LayerImpl* layer) {
54 PictureLayer::PushPropertiesTo(layer);
55 push_properties_count_++;
58 void FakePictureLayer::OnOutputSurfaceCreated() {
59 PictureLayer::OnOutputSurfaceCreated();
60 output_surface_created_count_++;
63 } // namespace cc