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

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

Issue 2877483003: Implements core logic for Pixel Canvas (Closed)
Patch Set: Updated GetContextScaleType() from public to protected 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 } 135 }
136 136
137 bool HasDiscardableImages() const { 137 bool HasDiscardableImages() const {
138 return paint_op_buffer_.HasDiscardableImages(); 138 return paint_op_buffer_.HasDiscardableImages();
139 } 139 }
140 140
141 // Generate a PaintRecord from this DisplayItemList, leaving |this| in 141 // Generate a PaintRecord from this DisplayItemList, leaving |this| in
142 // an empty state. 142 // an empty state.
143 sk_sp<PaintRecord> ReleaseAsRecord(); 143 sk_sp<PaintRecord> ReleaseAsRecord();
144 144
145 bool pixel_canvas_enabled() const { return pixel_canvas_enabled_; }
146 void set_pixel_canvas_enabled(bool value) { pixel_canvas_enabled_ = value; }
147
145 private: 148 private:
146 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, AsValueWithNoOps); 149 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, AsValueWithNoOps);
147 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, AsValueWithOps); 150 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, AsValueWithOps);
148 151
149 ~DisplayItemList(); 152 ~DisplayItemList();
150 153
151 void Reset(); 154 void Reset();
152 155
153 std::unique_ptr<base::trace_event::TracedValue> CreateTracedValue( 156 std::unique_ptr<base::trace_event::TracedValue> CreateTracedValue(
154 bool include_items) const; 157 bool include_items) const;
(...skipping 23 matching lines...) Expand all
178 int in_paired_begin_count_ = 0; 181 int in_paired_begin_count_ = 0;
179 // For debugging, tracks if we're painting a visual rect range, to prevent 182 // For debugging, tracks if we're painting a visual rect range, to prevent
180 // nesting. 183 // nesting.
181 bool in_painting_ = false; 184 bool in_painting_ = false;
182 185
183 size_t op_count_ = 0u; 186 size_t op_count_ = 0u;
184 // For testing purposes only. Whether to keep visual rects across calls to 187 // For testing purposes only. Whether to keep visual rects across calls to
185 // Finalize(). 188 // Finalize().
186 bool retain_visual_rects_ = false; 189 bool retain_visual_rects_ = false;
187 190
191 // Set true if we are using pixel canvas. This mode allows us to records all
192 // canvas draw commands in pixel aligned measurements and scale elements using
193 // the corner points.
194 bool pixel_canvas_enabled_ = false;
195
188 friend class base::RefCountedThreadSafe<DisplayItemList>; 196 friend class base::RefCountedThreadSafe<DisplayItemList>;
189 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, BytesUsed); 197 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, BytesUsed);
190 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); 198 DISALLOW_COPY_AND_ASSIGN(DisplayItemList);
191 }; 199 };
192 200
193 } // namespace cc 201 } // namespace cc
194 202
195 #endif // CC_PAINT_DISPLAY_ITEM_LIST_H_ 203 #endif // CC_PAINT_DISPLAY_ITEM_LIST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698