OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PAINT_DISPLAY_ITEM_LIST_H_ | 5 #ifndef CC_PAINT_DISPLAY_ITEM_LIST_H_ |
6 #define CC_PAINT_DISPLAY_ITEM_LIST_H_ | 6 #define CC_PAINT_DISPLAY_ITEM_LIST_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 } | 122 } |
123 | 123 |
124 bool HasDiscardableImages() const { | 124 bool HasDiscardableImages() const { |
125 return paint_op_buffer_.HasDiscardableImages(); | 125 return paint_op_buffer_.HasDiscardableImages(); |
126 } | 126 } |
127 | 127 |
128 // Generate a PaintRecord from this DisplayItemList, leaving |this| in | 128 // Generate a PaintRecord from this DisplayItemList, leaving |this| in |
129 // an empty state. | 129 // an empty state. |
130 sk_sp<PaintRecord> ReleaseAsRecord(); | 130 sk_sp<PaintRecord> ReleaseAsRecord(); |
131 | 131 |
| 132 bool pixel_canvas_enabled() const { return pixel_canvas_enabled_; } |
| 133 void set_pixel_canvas_enabled(bool value) { pixel_canvas_enabled_ = value; } |
| 134 |
132 private: | 135 private: |
133 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, AsValueWithNoOps); | 136 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, AsValueWithNoOps); |
134 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, AsValueWithOps); | 137 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, AsValueWithOps); |
135 | 138 |
136 ~DisplayItemList(); | 139 ~DisplayItemList(); |
137 | 140 |
138 void Reset(); | 141 void Reset(); |
139 | 142 |
140 std::unique_ptr<base::trace_event::TracedValue> CreateTracedValue( | 143 std::unique_ptr<base::trace_event::TracedValue> CreateTracedValue( |
141 bool include_items) const; | 144 bool include_items) const; |
(...skipping 26 matching lines...) Expand all Loading... |
168 int in_paired_begin_count_ = 0; | 171 int in_paired_begin_count_ = 0; |
169 // For debugging, tracks if we're painting a visual rect range, to prevent | 172 // For debugging, tracks if we're painting a visual rect range, to prevent |
170 // nesting. | 173 // nesting. |
171 bool in_painting_ = false; | 174 bool in_painting_ = false; |
172 | 175 |
173 size_t op_count_ = 0u; | 176 size_t op_count_ = 0u; |
174 // For testing purposes only. Whether to keep visual rects across calls to | 177 // For testing purposes only. Whether to keep visual rects across calls to |
175 // Finalize(). | 178 // Finalize(). |
176 bool retain_visual_rects_ = false; | 179 bool retain_visual_rects_ = false; |
177 | 180 |
| 181 // Set true if we are using pixel canvas. This mode allows us to records all |
| 182 // canvas draw commands in pixel aligned measurements and scale elements using |
| 183 // the corner points. |
| 184 bool pixel_canvas_enabled_ = false; |
| 185 |
178 friend class base::RefCountedThreadSafe<DisplayItemList>; | 186 friend class base::RefCountedThreadSafe<DisplayItemList>; |
179 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, BytesUsed); | 187 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, BytesUsed); |
180 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); | 188 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); |
181 }; | 189 }; |
182 | 190 |
183 } // namespace cc | 191 } // namespace cc |
184 | 192 |
185 #endif // CC_PAINT_DISPLAY_ITEM_LIST_H_ | 193 #endif // CC_PAINT_DISPLAY_ITEM_LIST_H_ |
OLD | NEW |