OLD | NEW |
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_SCROLLBAR_LAYER_H_ | 5 #ifndef CC_TEST_FAKE_SCROLLBAR_LAYER_H_ |
6 #define CC_TEST_FAKE_SCROLLBAR_LAYER_H_ | 6 #define CC_TEST_FAKE_SCROLLBAR_LAYER_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "cc/layers/scrollbar_layer.h" | 9 #include "cc/layers/scrollbar_layer.h" |
10 | 10 |
11 namespace base { template<typename T> class AutoReset; } | 11 namespace base { template<typename T> class AutoReset; } |
12 | 12 |
13 namespace cc { | 13 namespace cc { |
14 | 14 |
15 class FakeScrollbarLayer : public ScrollbarLayer { | 15 class FakeScrollbarLayer : public ScrollbarLayer { |
16 public: | 16 public: |
17 static scoped_refptr<FakeScrollbarLayer> Create(bool paint_during_update, | 17 static scoped_refptr<FakeScrollbarLayer> Create(bool paint_during_update, |
18 bool has_thumb, | 18 bool has_thumb, |
19 int scrolling_layer_id) { | 19 int scrolling_layer_id) { |
20 return make_scoped_refptr(new FakeScrollbarLayer( | 20 return make_scoped_refptr(new FakeScrollbarLayer( |
21 paint_during_update, has_thumb, scrolling_layer_id)); | 21 paint_during_update, has_thumb, scrolling_layer_id)); |
22 } | 22 } |
23 | 23 |
24 int update_count() const { return update_count_; } | 24 int update_count() const { return update_count_; } |
25 void reset_update_count() { update_count_ = 0; } | 25 void reset_update_count() { update_count_ = 0; } |
| 26 size_t last_update_full_upload_size() const { |
| 27 return last_update_full_upload_size_; |
| 28 } |
| 29 size_t last_update_partial_upload_size() const { |
| 30 return last_update_partial_upload_size_; |
| 31 } |
26 | 32 |
27 virtual bool Update(ResourceUpdateQueue* queue, | 33 virtual bool Update(ResourceUpdateQueue* queue, |
28 const OcclusionTracker* occlusion) OVERRIDE; | 34 const OcclusionTracker* occlusion) OVERRIDE; |
29 | 35 |
30 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; | 36 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; |
31 | 37 |
32 scoped_ptr<base::AutoReset<bool> > IgnoreSetNeedsCommit(); | 38 scoped_ptr<base::AutoReset<bool> > IgnoreSetNeedsCommit(); |
33 | 39 |
34 size_t push_properties_count() const { return push_properties_count_; } | 40 size_t push_properties_count() const { return push_properties_count_; } |
35 void reset_push_properties_count() { push_properties_count_ = 0; } | 41 void reset_push_properties_count() { push_properties_count_ = 0; } |
36 | 42 |
37 private: | 43 private: |
38 FakeScrollbarLayer(bool paint_during_update, | 44 FakeScrollbarLayer(bool paint_during_update, |
39 bool has_thumb, | 45 bool has_thumb, |
40 int scrolling_layer_id); | 46 int scrolling_layer_id); |
41 virtual ~FakeScrollbarLayer(); | 47 virtual ~FakeScrollbarLayer(); |
42 | 48 |
43 int update_count_; | 49 int update_count_; |
44 size_t push_properties_count_; | 50 size_t push_properties_count_; |
| 51 size_t last_update_full_upload_size_; |
| 52 size_t last_update_partial_upload_size_; |
45 }; | 53 }; |
46 | 54 |
47 } // namespace cc | 55 } // namespace cc |
48 | 56 |
49 #endif // CC_TEST_FAKE_SCROLLBAR_LAYER_H_ | 57 #endif // CC_TEST_FAKE_SCROLLBAR_LAYER_H_ |
OLD | NEW |