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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintInvalidator.cpp

Issue 2733773004: Add check for missing visual rect updates and fix failures (Closed)
Patch Set: Created 3 years, 9 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "core/paint/PaintInvalidator.h" 5 #include "core/paint/PaintInvalidator.h"
6 6
7 #include "core/editing/FrameSelection.h" 7 #include "core/editing/FrameSelection.h"
8 #include "core/frame/FrameView.h" 8 #include "core/frame/FrameView.h"
9 #include "core/frame/LocalFrame.h" 9 #include "core/frame/LocalFrame.h"
10 #include "core/frame/Settings.h" 10 #include "core/frame/Settings.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 return mapLocalRectToPaintInvalidationBacking<FloatRect, FloatPoint>( 162 return mapLocalRectToPaintInvalidationBacking<FloatRect, FloatPoint>(
163 object, localRect, context, m_geometryMapper); 163 object, localRect, context, m_geometryMapper);
164 } 164 }
165 return mapLocalRectToPaintInvalidationBacking<LayoutRect, LayoutPoint>( 165 return mapLocalRectToPaintInvalidationBacking<LayoutRect, LayoutPoint>(
166 object, object.localVisualRect(), context, m_geometryMapper); 166 object, object.localVisualRect(), context, m_geometryMapper);
167 } 167 }
168 168
169 LayoutPoint PaintInvalidator::computeLocationInBacking( 169 LayoutPoint PaintInvalidator::computeLocationInBacking(
170 const LayoutObject& object, 170 const LayoutObject& object,
171 const PaintInvalidatorContext& context) { 171 const PaintInvalidatorContext& context) {
172 // In SPv2, locationInBacking is in the space of their local transform node.
173 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled())
174 return object.paintOffset();
175
172 LayoutPoint point; 176 LayoutPoint point;
173 if (object != context.paintInvalidationContainer) { 177 if (object != context.paintInvalidationContainer) {
174 point.moveBy(object.paintOffset()); 178 point.moveBy(object.paintOffset());
175 179
176 const auto* containerTransform = 180 const auto* containerTransform =
177 context.paintInvalidationContainer->paintProperties() 181 context.paintInvalidationContainer->paintProperties()
178 ->contentsProperties() 182 ->contentsProperties()
179 ->transform(); 183 ->transform();
180 if (context.treeBuilderContext.current.transform != containerTransform) { 184 if (context.treeBuilderContext.current.transform != containerTransform) {
181 point = LayoutPoint(m_geometryMapper 185 point = LayoutPoint(m_geometryMapper
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 if (object.document().printing() && 422 if (object.document().printing() &&
419 !RuntimeEnabledFeatures::printBrowserEnabled()) 423 !RuntimeEnabledFeatures::printBrowserEnabled())
420 return; // Don't invalidate paints if we're printing. 424 return; // Don't invalidate paints if we're printing.
421 425
422 updatePaintInvalidationContainer(object, context); 426 updatePaintInvalidationContainer(object, context);
423 427
424 bool objectShouldCheckForPaintInvalidation = 428 bool objectShouldCheckForPaintInvalidation =
425 object 429 object
426 .shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState(); 430 .shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState();
427 if (!context.forcedSubtreeInvalidationFlags && 431 if (!context.forcedSubtreeInvalidationFlags &&
428 !objectShouldCheckForPaintInvalidation) 432 !objectShouldCheckForPaintInvalidation) {
433 #if DCHECK_IS_ON()
434 updateVisualRect(object, context);
435 DCHECK(enclosingIntRect(context.oldVisualRect) ==
436 enclosingIntRect(context.newVisualRect))
437 << "Visual rect changed without needing paint invalidation:"
438 << " old=" << context.oldVisualRect.toString()
439 << " new=" << context.newVisualRect.toString();
440 DCHECK(context.oldLocation == context.newLocation)
441 << "Location changed without needing paint invalidation:"
442 << " old=" << context.oldLocation.toString()
443 << " new=" << context.newLocation.toString();
444 #endif
429 return; 445 return;
446 }
430 447
431 updateVisualRect(object, context); 448 updateVisualRect(object, context);
432 449
433 if (!objectShouldCheckForPaintInvalidation && 450 if (!objectShouldCheckForPaintInvalidation &&
434 context.forcedSubtreeInvalidationFlags == 451 context.forcedSubtreeInvalidationFlags ==
435 PaintInvalidatorContext::ForcedSubtreeInvalidationRectUpdate) { 452 PaintInvalidatorContext::ForcedSubtreeInvalidationRectUpdate) {
436 // We are done updating the visual rect. No other paint invalidation work to 453 // We are done updating the visual rect. No other paint invalidation work to
437 // do for this object. 454 // do for this object.
438 return; 455 return;
439 } 456 }
(...skipping 28 matching lines...) Expand all
468 } 485 }
469 } 486 }
470 487
471 void PaintInvalidator::processPendingDelayedPaintInvalidations() { 488 void PaintInvalidator::processPendingDelayedPaintInvalidations() {
472 for (auto target : m_pendingDelayedPaintInvalidations) 489 for (auto target : m_pendingDelayedPaintInvalidations)
473 target->getMutableForPainting().setShouldDoFullPaintInvalidation( 490 target->getMutableForPainting().setShouldDoFullPaintInvalidation(
474 PaintInvalidationDelayedFull); 491 PaintInvalidationDelayedFull);
475 } 492 }
476 493
477 } // namespace blink 494 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698