OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_RECORDING_SOURCE_H_ | 5 #ifndef CC_TEST_FAKE_RECORDING_SOURCE_H_ |
6 #define CC_TEST_FAKE_RECORDING_SOURCE_H_ | 6 #define CC_TEST_FAKE_RECORDING_SOURCE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "cc/base/region.h" | 10 #include "cc/base/region.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 112 |
113 void set_reported_memory_usage(size_t reported_memory_usage) { | 113 void set_reported_memory_usage(size_t reported_memory_usage) { |
114 client_.set_reported_memory_usage(reported_memory_usage); | 114 client_.set_reported_memory_usage(reported_memory_usage); |
115 } | 115 } |
116 | 116 |
117 void reset_draws() { | 117 void reset_draws() { |
118 client_ = FakeContentLayerClient(); | 118 client_ = FakeContentLayerClient(); |
119 client_.set_bounds(size_); | 119 client_.set_bounds(size_); |
120 } | 120 } |
121 | 121 |
122 void SetUnsuitableForGpuRasterization() { | 122 void SetForceUnsuitableForGpuRasterization(bool flag) { |
123 force_unsuitable_for_gpu_rasterization_ = true; | 123 force_unsuitable_for_gpu_rasterization_ = flag; |
124 } | 124 } |
125 | 125 |
126 void SetPlaybackAllowedEvent(base::WaitableEvent* event) { | 126 void SetPlaybackAllowedEvent(base::WaitableEvent* event) { |
127 playback_allowed_event_ = event; | 127 playback_allowed_event_ = event; |
128 } | 128 } |
129 | 129 |
130 DisplayItemList* display_list() const { return display_list_.get(); } | 130 DisplayItemList* display_list() const { return display_list_.get(); } |
131 | 131 |
132 // Checks that the basic properties of the |other| match |this|. For the | 132 // Checks that the basic properties of the |other| match |this|. For the |
133 // DisplayItemList, it checks that the painted result matches the painted | 133 // DisplayItemList, it checks that the painted result matches the painted |
134 // result of |other|. | 134 // result of |other|. |
135 bool EqualsTo(const FakeRecordingSource& other); | 135 bool EqualsTo(const FakeRecordingSource& other); |
136 | 136 |
137 private: | 137 private: |
138 FakeContentLayerClient client_; | 138 FakeContentLayerClient client_; |
139 SkPaint default_paint_; | 139 SkPaint default_paint_; |
140 bool force_unsuitable_for_gpu_rasterization_; | 140 bool force_unsuitable_for_gpu_rasterization_; |
141 base::WaitableEvent* playback_allowed_event_; | 141 base::WaitableEvent* playback_allowed_event_; |
142 }; | 142 }; |
143 | 143 |
144 } // namespace cc | 144 } // namespace cc |
145 | 145 |
146 #endif // CC_TEST_FAKE_RECORDING_SOURCE_H_ | 146 #endif // CC_TEST_FAKE_RECORDING_SOURCE_H_ |
OLD | NEW |