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

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

Issue 2392443009: reflow comments in core/paint (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/PaintInvalidationCapableScrollableArea.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintInvalidationCapableScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintInvalidationCapableScrollableArea.cpp
index 6167374ed40bdd2cdd41b7883b582ffeb01da649..56e49df56e4d84f92c83f66154d6d26d329950f2 100644
--- a/third_party/WebKit/Source/core/paint/PaintInvalidationCapableScrollableArea.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintInvalidationCapableScrollableArea.cpp
@@ -34,8 +34,9 @@ static LayoutRect scrollControlPaintInvalidationRect(
const LayoutBox& box,
const PaintInvalidatorContext& context) {
LayoutRect paintInvalidationRect(scrollControlRect);
- // No need to apply any paint offset. Scroll controls paint in a different transform space than their contained box
- // (the scrollbarPaintOffset transform node).
+ // No need to apply any paint offset. Scroll controls paint in a different
+ // transform space than their contained box (the scrollbarPaintOffset
+ // transform node).
if (!paintInvalidationRect.isEmpty() &&
!RuntimeEnabledFeatures::slimmingPaintV2Enabled())
context.mapLocalRectToPaintInvalidationBacking(box, paintInvalidationRect);
@@ -75,7 +76,8 @@ static void invalidatePaintOfScrollbarIfNeeded(
const PaintInvalidatorContext& context) {
bool isOverlay = scrollbar && scrollbar->isOverlayScrollbar();
- // Calculate paint invalidation rect of the scrollbar, except overlay composited scrollbars because we invalidate the graphics layer only.
+ // Calculate paint invalidation rect of the scrollbar, except overlay
+ // composited scrollbars because we invalidate the graphics layer only.
LayoutRect newPaintInvalidationRect;
if (scrollbar && !(graphicsLayer && isOverlay))
newPaintInvalidationRect = scrollControlPaintInvalidationRect(
@@ -83,22 +85,26 @@ static void invalidatePaintOfScrollbarIfNeeded(
bool needsPaintInvalidation = needsPaintInvalidationArg;
if (needsPaintInvalidation && graphicsLayer) {
- // If the scrollbar needs paint invalidation but didn't change location/size or the scrollbar is an
- // overlay scrollbar (paint invalidation rect is empty), invalidating the graphics layer is enough
- // (which has been done in ScrollableArea::setScrollbarNeedsPaintInvalidation()).
- // Otherwise invalidatePaintOfScrollControlIfNeeded() below will invalidate the old and new location
- // of the scrollbar on the box's paint invalidation container to ensure newly expanded/shrunk areas
- // of the box to be invalidated.
+ // If the scrollbar needs paint invalidation but didn't change location/size
+ // or the scrollbar is an overlay scrollbar (paint invalidation rect is
+ // empty), invalidating the graphics layer is enough (which has been done in
+ // ScrollableArea::setScrollbarNeedsPaintInvalidation()).
+ // Otherwise invalidatePaintOfScrollControlIfNeeded() below will invalidate
+ // the old and new location of the scrollbar on the box's paint invalidation
+ // container to ensure newly expanded/shrunk areas of the box to be
+ // invalidated.
needsPaintInvalidation = false;
DCHECK(!graphicsLayer->drawsContent() ||
graphicsLayer->getPaintController().cacheIsEmpty());
}
- // Invalidate the box's display item client if the box's padding box size is affected by change of the
- // non-overlay scrollbar width. We detect change of paint invalidation rect size instead of change of
- // scrollbar width change, which may have some false-positives (e.g. the scrollbar changed length but
- // not width) but won't invalidate more than expected because in the false-positive case the box must
- // have changed size and have been invalidated.
+ // Invalidate the box's display item client if the box's padding box size is
+ // affected by change of the non-overlay scrollbar width. We detect change of
+ // paint invalidation rect size instead of change of scrollbar width change,
+ // which may have some false-positives (e.g. the scrollbar changed length but
+ // not width) but won't invalidate more than expected because in the
+ // false-positive case the box must have changed size and have been
+ // invalidated.
const LayoutBoxModelObject& paintInvalidationContainer =
*context.paintInvalidationContainer;
LayoutSize newScrollbarUsedSpaceInBox;

Powered by Google App Engine
This is Rietveld 408576698