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

Side by Side Diff: cc/paint/display_item_list.h

Issue 2877483003: Implements core logic for Pixel Canvas (Closed)
Patch Set: nit Created 3 years, 6 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
OLDNEW
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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 } 131 }
132 132
133 bool HasDiscardableImages() const { 133 bool HasDiscardableImages() const {
134 return paint_op_buffer_.HasDiscardableImages(); 134 return paint_op_buffer_.HasDiscardableImages();
135 } 135 }
136 136
137 // Generate a PaintRecord from this DisplayItemList, leaving |this| in 137 // Generate a PaintRecord from this DisplayItemList, leaving |this| in
138 // an empty state. 138 // an empty state.
139 sk_sp<PaintRecord> ReleaseAsRecord(); 139 sk_sp<PaintRecord> ReleaseAsRecord();
140 140
141 bool pixel_canvas_enabled() const { return pixel_canvas_enabled_; }
142 void set_pixel_canvas_enabled(bool value) { pixel_canvas_enabled_ = value; }
143
141 private: 144 private:
142 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, AsValueWithNoOps); 145 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, AsValueWithNoOps);
143 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, AsValueWithOps); 146 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, AsValueWithOps);
144 147
145 ~DisplayItemList(); 148 ~DisplayItemList();
146 149
147 void Reset(); 150 void Reset();
148 151
149 std::unique_ptr<base::trace_event::TracedValue> CreateTracedValue( 152 std::unique_ptr<base::trace_event::TracedValue> CreateTracedValue(
150 bool include_items) const; 153 bool include_items) const;
(...skipping 20 matching lines...) Expand all
171 size_t current_range_start_ = 0; 174 size_t current_range_start_ = 0;
172 // For debugging, tracks the number of currently nested visual rects being 175 // For debugging, tracks the number of currently nested visual rects being
173 // added. 176 // added.
174 int in_paired_begin_count_ = 0; 177 int in_paired_begin_count_ = 0;
175 // For debugging, tracks if we're painting a visual rect range, to prevent 178 // For debugging, tracks if we're painting a visual rect range, to prevent
176 // nesting. 179 // nesting.
177 bool in_painting_ = false; 180 bool in_painting_ = false;
178 181
179 size_t op_count_ = 0u; 182 size_t op_count_ = 0u;
180 183
184 // Set true if we are using pixel canvas. This mode allows us to records all
185 // canvas draw commands in pixel aligned measurements and scale elements using
186 // the corner points.
187 bool pixel_canvas_enabled_ = false;
188
181 friend class base::RefCountedThreadSafe<DisplayItemList>; 189 friend class base::RefCountedThreadSafe<DisplayItemList>;
182 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, BytesUsed); 190 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, BytesUsed);
183 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); 191 DISALLOW_COPY_AND_ASSIGN(DisplayItemList);
184 }; 192 };
185 193
186 } // namespace cc 194 } // namespace cc
187 195
188 #endif // CC_PAINT_DISPLAY_ITEM_LIST_H_ 196 #endif // CC_PAINT_DISPLAY_ITEM_LIST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698