Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(884)

Side by Side Diff: cc/test/fake_picture_layer.h

Issue 19106007: cc: Allow the main thread to cancel commits (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix scheduler tests Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_TEST_FAKE_PICTURE_LAYER_H_ 5 #ifndef CC_TEST_FAKE_PICTURE_LAYER_H_
6 #define CC_TEST_FAKE_PICTURE_LAYER_H_ 6 #define CC_TEST_FAKE_PICTURE_LAYER_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "cc/layers/picture_layer.h" 10 #include "cc/layers/picture_layer.h"
11 11
12 namespace cc { 12 namespace cc {
13 13
14 class FakePictureLayer : public PictureLayer { 14 class FakePictureLayer : public PictureLayer {
15 public: 15 public:
16 static scoped_refptr<FakePictureLayer> Create(ContentLayerClient* client) { 16 static scoped_refptr<FakePictureLayer> Create(ContentLayerClient* client) {
17 return make_scoped_refptr(new FakePictureLayer(client)); 17 return make_scoped_refptr(new FakePictureLayer(client));
18 } 18 }
19 19
20 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) 20 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
21 OVERRIDE; 21 OVERRIDE;
22 22
23 size_t update_count() const { return update_count_; } 23 size_t update_count() const { return update_count_; }
24 void reset_update_count() { update_count_ = 0; } 24 void reset_update_count() { update_count_ = 0; }
25 25
26 size_t push_properties_count() const { return push_properties_count_; } 26 size_t push_properties_count() const { return push_properties_count_; }
27 void reset_push_properties_count() { push_properties_count_ = 0; } 27 void reset_push_properties_count() { push_properties_count_ = 0; }
28 28
29 void set_always_update_resources(bool always_update) {
30 always_update_ = always_update;
31 }
32
29 virtual bool Update( 33 virtual bool Update(
30 ResourceUpdateQueue* queue, 34 ResourceUpdateQueue* queue,
31 const OcclusionTracker* occlusion) OVERRIDE; 35 const OcclusionTracker* occlusion) OVERRIDE;
32 36
33 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; 37 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
34 38
35 private: 39 private:
36 explicit FakePictureLayer(ContentLayerClient* client); 40 explicit FakePictureLayer(ContentLayerClient* client);
37 virtual ~FakePictureLayer(); 41 virtual ~FakePictureLayer();
38 42
39 size_t update_count_; 43 size_t update_count_;
40 size_t push_properties_count_; 44 size_t push_properties_count_;
45 bool always_update_;
danakj 2013/07/17 20:53:24 nit: always_update_resources_ (match the function)
enne (OOO) 2013/07/18 17:36:37 Done.
41 }; 46 };
42 47
43 } // namespace cc 48 } // namespace cc
44 49
45 #endif // CC_TEST_FAKE_PICTURE_LAYER_H_ 50 #endif // CC_TEST_FAKE_PICTURE_LAYER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698