Linux: Depend on liberation-fonts package for RPMs.
[chromium-blink-merge.git] / cc / test / fake_picture_layer.h
blob2b2649880fa7a75678ff8cdcf2d02dbd50bb4586
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 #ifndef CC_TEST_FAKE_PICTURE_LAYER_H_
6 #define CC_TEST_FAKE_PICTURE_LAYER_H_
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "cc/layers/picture_layer.h"
11 #include "cc/playback/recording_source.h"
13 namespace cc {
14 class FakePictureLayer : public PictureLayer {
15 public:
16 static scoped_refptr<FakePictureLayer> Create(const LayerSettings& settings,
17 ContentLayerClient* client) {
18 return make_scoped_refptr(new FakePictureLayer(settings, client));
21 static scoped_refptr<FakePictureLayer> CreateWithRecordingSource(
22 const LayerSettings& settings,
23 ContentLayerClient* client,
24 scoped_ptr<RecordingSource> source) {
25 return make_scoped_refptr(
26 new FakePictureLayer(settings, client, source.Pass()));
29 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
31 int update_count() const { return update_count_; }
32 void reset_update_count() { update_count_ = 0; }
34 size_t push_properties_count() const { return push_properties_count_; }
35 void reset_push_properties_count() { push_properties_count_ = 0; }
37 void set_always_update_resources(bool always_update_resources) {
38 always_update_resources_ = always_update_resources;
41 bool Update() override;
43 void PushPropertiesTo(LayerImpl* layer) override;
45 private:
46 FakePictureLayer(const LayerSettings& settings, ContentLayerClient* client);
47 FakePictureLayer(const LayerSettings& settings,
48 ContentLayerClient* client,
49 scoped_ptr<RecordingSource> source);
50 ~FakePictureLayer() override;
52 int update_count_;
53 size_t push_properties_count_;
54 bool always_update_resources_;
57 } // namespace cc
59 #endif // CC_TEST_FAKE_PICTURE_LAYER_H_