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

Unified Diff: third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp

Issue 2498823002: Paint invalidation of local attachment backgrounds (Closed)
Patch Set: Update test expectations Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp
diff --git a/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp b/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp
index 8d74cdc8a980a50ae2eadcce6aea9cf9b7a345b1..11c906d5c32caa9df58cc0f0c002a7b2d1982d47 100644
--- a/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp
+++ b/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp
@@ -286,20 +286,14 @@ void ObjectPaintInvalidator::setBackingNeedsPaintInvalidationInRect(
layer.compositedLayerMapping()->setScrollingContentsNeedDisplayInRect(
rect, reason, m_object);
} else if (paintInvalidationContainer.usesCompositedScrolling()) {
- if (layer.compositedLayerMapping()
- ->backgroundPaintsOntoScrollingContentsLayer()) {
- // TODO(flackr): Get a correct rect in the context of the scrolling
- // contents layer to update rather than updating the entire rect.
- const LayoutRect& scrollingContentsRect =
- toLayoutBox(m_object).layoutOverflowRect();
+ DCHECK(m_object == paintInvalidationContainer);
+ if (reason == PaintInvalidationBackgroundOnScrollingContentsLayer) {
layer.compositedLayerMapping()->setScrollingContentsNeedDisplayInRect(
- scrollingContentsRect, reason, m_object);
- layer.setNeedsRepaint();
- invalidateDisplayItemClient(
- *layer.compositedLayerMapping()->scrollingContentsLayer(), reason);
+ rect, reason, m_object);
+ } else {
+ layer.compositedLayerMapping()->setNonScrollingContentsNeedDisplayInRect(
+ rect, reason, m_object);
}
- layer.compositedLayerMapping()->setNonScrollingContentsNeedDisplayInRect(
- rect, reason, m_object);
} else {
// Otherwise invalidate everything.
layer.compositedLayerMapping()->setContentsNeedDisplayInRect(rect, reason,
@@ -345,14 +339,16 @@ void ObjectPaintInvalidator::invalidatePaintUsingContainer(
// This conditional handles situations where non-rooted (and hence
// non-composited) frames are painted, such as SVG images.
- if (!paintInvalidationContainer.isPaintInvalidationContainer())
+ if (!paintInvalidationContainer.isPaintInvalidationContainer()) {
invalidatePaintRectangleOnWindow(paintInvalidationContainer,
enclosingIntRect(dirtyRect));
+ }
if (paintInvalidationContainer.view()->usesCompositing() &&
- paintInvalidationContainer.isPaintInvalidationContainer())
+ paintInvalidationContainer.isPaintInvalidationContainer()) {
setBackingNeedsPaintInvalidationInRect(paintInvalidationContainer,
dirtyRect, invalidationReason);
+ }
}
LayoutRect ObjectPaintInvalidator::invalidatePaintRectangle(
@@ -488,8 +484,9 @@ ObjectPaintInvalidatorWithContext::computePaintInvalidationReason() {
// Incremental invalidation is only applicable to LayoutBoxes. Return
// PaintInvalidationIncremental no matter if oldVisualRect and newVisualRect
- // are equal
- // because a LayoutBox may need paint invalidation if its border box changes.
+ // are equal because a LayoutBox may need paint invalidation if its border box
+ // changes. BoxPaintInvalidator may also override this reason with a full
+ // paint invalidation reason if needed.
if (m_object.isBox())
return PaintInvalidationIncremental;

Powered by Google App Engine
This is Rietveld 408576698