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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/paint/PaintController.h

Issue 2812103002: Don't allow the composited-alpha folding optimization to cross subsequences (Closed)
Patch Set: none Created 3 years, 8 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 PaintController_h 5 #ifndef PaintController_h
6 #define PaintController_h 6 #define PaintController_h
7 7
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 #include "platform/PlatformExport.h" 10 #include "platform/PlatformExport.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 void BeginShouldKeepAlive(const DisplayItemClient&); 202 void BeginShouldKeepAlive(const DisplayItemClient&);
203 203
204 void BeginSubsequence(const DisplayItemClient& client) { 204 void BeginSubsequence(const DisplayItemClient& client) {
205 current_subsequence_clients_.push_back(&client); 205 current_subsequence_clients_.push_back(&client);
206 BeginShouldKeepAlive(client); 206 BeginShouldKeepAlive(client);
207 } 207 }
208 208
209 void EndSubsequence() { current_subsequence_clients_.pop_back(); } 209 void EndSubsequence() { current_subsequence_clients_.pop_back(); }
210 #endif 210 #endif
211 211
212 bool LastDisplayItemIsSubsequenceEnd() const;
213
212 protected: 214 protected:
213 PaintController() 215 PaintController()
214 : new_display_item_list_(0), 216 : new_display_item_list_(0),
215 construction_disabled_(false), 217 construction_disabled_(false),
216 subsequence_caching_disabled_(false), 218 subsequence_caching_disabled_(false),
217 first_painted_(false), 219 first_painted_(false),
218 text_painted_(false), 220 text_painted_(false),
219 image_painted_(false), 221 image_painted_(false),
220 skipping_cache_count_(0), 222 skipping_cache_count_(0),
221 num_cached_new_items_(0), 223 num_cached_new_items_(0),
222 current_cached_subsequence_begin_index_in_new_list_(kNotFound), 224 current_cached_subsequence_begin_index_in_new_list_(kNotFound),
223 #ifndef NDEBUG 225 #ifndef NDEBUG
224 num_sequential_matches_(0), 226 num_sequential_matches_(0),
225 num_out_of_order_matches_(0), 227 num_out_of_order_matches_(0),
226 num_indexed_items_(0), 228 num_indexed_items_(0),
227 #endif 229 #endif
228 under_invalidation_checking_begin_(0), 230 under_invalidation_checking_begin_(0),
229 under_invalidation_checking_end_(0) { 231 under_invalidation_checking_end_(0),
232 last_cached_subsequence_end_(0) {
230 ResetCurrentListIndices(); 233 ResetCurrentListIndices();
231 SetTracksRasterInvalidations( 234 SetTracksRasterInvalidations(
232 RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()); 235 RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled());
233 } 236 }
234 237
235 private: 238 private:
236 friend class PaintControllerTestBase; 239 friend class PaintControllerTestBase;
237 friend class PaintControllerPaintTestBase; 240 friend class PaintControllerPaintTestBase;
238 241
239 bool LastDisplayItemIsNoopBegin() const; 242 bool LastDisplayItemIsNoopBegin() const;
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 415
413 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS 416 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS
414 // A stack recording subsequence clients that are currently painting. 417 // A stack recording subsequence clients that are currently painting.
415 Vector<const DisplayItemClient*> current_subsequence_clients_; 418 Vector<const DisplayItemClient*> current_subsequence_clients_;
416 #endif 419 #endif
417 420
418 typedef HashMap<const DisplayItemClient*, SubsequenceMarkers> 421 typedef HashMap<const DisplayItemClient*, SubsequenceMarkers>
419 CachedSubsequenceMap; 422 CachedSubsequenceMap;
420 CachedSubsequenceMap current_cached_subsequences_; 423 CachedSubsequenceMap current_cached_subsequences_;
421 CachedSubsequenceMap new_cached_subsequences_; 424 CachedSubsequenceMap new_cached_subsequences_;
425 size_t last_cached_subsequence_end_;
422 426
423 FRIEND_TEST_ALL_PREFIXES(PaintControllerTest, CachedSubsequenceSwapOrder); 427 FRIEND_TEST_ALL_PREFIXES(PaintControllerTest, CachedSubsequenceSwapOrder);
424 FRIEND_TEST_ALL_PREFIXES(PaintControllerTest, CachedNestedSubsequenceUpdate); 428 FRIEND_TEST_ALL_PREFIXES(PaintControllerTest, CachedNestedSubsequenceUpdate);
425 }; 429 };
426 430
427 } // namespace blink 431 } // namespace blink
428 432
429 #endif // PaintController_h 433 #endif // PaintController_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698