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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
57 | 57 |
58 void SetLayerBounds(const gfx::Size& layer_bounds) { | 58 void SetLayerBounds(const gfx::Size& layer_bounds) { |
59 size_ = layer_bounds; | 59 size_ = layer_bounds; |
60 client_.set_bounds(layer_bounds); | 60 client_.set_bounds(layer_bounds); |
61 } | 61 } |
62 | 62 |
63 void SetClearCanvasWithDebugColor(bool clear) { | 63 void SetClearCanvasWithDebugColor(bool clear) { |
64 clear_canvas_with_debug_color_ = clear; | 64 clear_canvas_with_debug_color_ = clear; |
65 } | 65 } |
66 | 66 |
67 void set_fill_with_nonsolid_color(bool nonsolid) { | |
vmpstr
2017/04/20 20:59:32
nit: non_solid
Khushal
2017/04/20 21:54:21
I just made it match what was already on |client_|
| |
68 client_.set_fill_with_nonsolid_color(nonsolid); | |
69 } | |
70 | |
67 void Rerecord() { | 71 void Rerecord() { |
68 SetNeedsDisplayRect(recorded_viewport_); | 72 SetNeedsDisplayRect(recorded_viewport_); |
69 Region invalidation; | 73 Region invalidation; |
70 gfx::Rect new_recorded_viewport = client_.PaintableRegion(); | 74 gfx::Rect new_recorded_viewport = client_.PaintableRegion(); |
71 scoped_refptr<DisplayItemList> display_list = | 75 scoped_refptr<DisplayItemList> display_list = |
72 client_.PaintContentsToDisplayList( | 76 client_.PaintContentsToDisplayList( |
73 ContentLayerClient::PAINTING_BEHAVIOR_NORMAL); | 77 ContentLayerClient::PAINTING_BEHAVIOR_NORMAL); |
74 size_t painter_reported_memory_usage = | 78 size_t painter_reported_memory_usage = |
75 client_.GetApproximateUnsharedMemoryUsage(); | 79 client_.GetApproximateUnsharedMemoryUsage(); |
76 UpdateAndExpandInvalidation(&invalidation, size_, new_recorded_viewport); | 80 UpdateAndExpandInvalidation(&invalidation, size_, new_recorded_viewport); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
133 | 137 |
134 private: | 138 private: |
135 FakeContentLayerClient client_; | 139 FakeContentLayerClient client_; |
136 PaintFlags default_flags_; | 140 PaintFlags default_flags_; |
137 base::WaitableEvent* playback_allowed_event_; | 141 base::WaitableEvent* playback_allowed_event_; |
138 }; | 142 }; |
139 | 143 |
140 } // namespace cc | 144 } // namespace cc |
141 | 145 |
142 #endif // CC_TEST_FAKE_RECORDING_SOURCE_H_ | 146 #endif // CC_TEST_FAKE_RECORDING_SOURCE_H_ |
OLD | NEW |