Disable flaky SelectFileDialogExtensionBrowserTest tests
[chromium-blink-merge.git] / cc / test / fake_picture_layer.cc
blob25953cfb40add70259ad83e347cfd492cbcbba27
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(ContentLayerClient* client)
12 : PictureLayer(client),
13 update_count_(0),
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));
19 SetIsDrawable(true);
22 FakePictureLayer::FakePictureLayer(ContentLayerClient* client,
23 scoped_ptr<RecordingSource> source)
24 : PictureLayer(client, source.Pass()),
25 update_count_(0),
26 push_properties_count_(0),
27 output_surface_created_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(ResourceUpdateQueue* queue,
44 const OcclusionTracker<Layer>* occlusion) {
45 if (disable_lcd_text_)
46 draw_properties().can_use_lcd_text = false;
47 bool updated = PictureLayer::Update(queue, occlusion);
48 update_count_++;
49 return updated || always_update_resources_;
52 void FakePictureLayer::PushPropertiesTo(LayerImpl* layer) {
53 PictureLayer::PushPropertiesTo(layer);
54 push_properties_count_++;
57 void FakePictureLayer::OnOutputSurfaceCreated() {
58 PictureLayer::OnOutputSurfaceCreated();
59 output_surface_created_count_++;
62 } // namespace cc