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

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

Issue 2877483003: Implements core logic for Pixel Canvas (Closed)
Patch Set: Update unittests for RasterSource 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 void GatherDiscardableImages(DiscardableImageStore* image_store) const; 119 void GatherDiscardableImages(DiscardableImageStore* image_store) const;
120 const DiscardableImageMap& discardable_image_map_for_testing() const { 120 const DiscardableImageMap& discardable_image_map_for_testing() const {
121 return image_map_; 121 return image_map_;
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 bool pixel_canvas_enabled() const { return pixel_canvas_enabled_; }
129 void set_pixel_canvas_enabled(bool value) { pixel_canvas_enabled_ = value; }
130
128 private: 131 private:
129 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, AsValueWithNoOps); 132 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, AsValueWithNoOps);
130 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, AsValueWithOps); 133 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, AsValueWithOps);
131 134
132 ~DisplayItemList(); 135 ~DisplayItemList();
133 136
134 std::unique_ptr<base::trace_event::TracedValue> CreateTracedValue( 137 std::unique_ptr<base::trace_event::TracedValue> CreateTracedValue(
135 bool include_items) const; 138 bool include_items) const;
136 139
137 // If we're currently within a paired display item block, unions the 140 // If we're currently within a paired display item block, unions the
(...skipping 24 matching lines...) Expand all
162 int in_paired_begin_count_ = 0; 165 int in_paired_begin_count_ = 0;
163 // For debugging, tracks if we're painting a visual rect range, to prevent 166 // For debugging, tracks if we're painting a visual rect range, to prevent
164 // nesting. 167 // nesting.
165 bool in_painting_ = false; 168 bool in_painting_ = false;
166 169
167 size_t op_count_ = 0u; 170 size_t op_count_ = 0u;
168 // For testing purposes only. Whether to keep visual rects across calls to 171 // For testing purposes only. Whether to keep visual rects across calls to
169 // Finalize(). 172 // Finalize().
170 bool retain_visual_rects_ = false; 173 bool retain_visual_rects_ = false;
171 174
175 // Set true if we are using pixel canvas. This mode allows us to records all
176 // canvas draw commands in pixel aligned measurements and scale elements using
177 // the corner points. Use compositor switch --enable-pixel-canvas-recording to
oshima 2017/06/15 22:59:12 remove the reference to command line
malaykeshav 2017/06/16 20:41:57 Done
178 // enable this mode.
179 bool pixel_canvas_enabled_ = false;
180
172 friend class base::RefCountedThreadSafe<DisplayItemList>; 181 friend class base::RefCountedThreadSafe<DisplayItemList>;
173 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, BytesUsed); 182 FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, BytesUsed);
174 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); 183 DISALLOW_COPY_AND_ASSIGN(DisplayItemList);
175 }; 184 };
176 185
177 } // namespace cc 186 } // namespace cc
178 187
179 #endif // CC_PAINT_DISPLAY_ITEM_LIST_H_ 188 #endif // CC_PAINT_DISPLAY_ITEM_LIST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698