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

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

Issue 2410153007: Revert of Use enclosingLayoutRect instead of enclosingIntRect in SVGLayoutSupport::transformPaintInvalidation… (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
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp b/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
index 574c15651048ff64c0c10eb0ce5ce1bc13cba06e..8cf10b39826f004f5284137a1a6c6e1544b3275d 100644
--- a/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
@@ -20,14 +20,6 @@
namespace blink {
-// TODO(wangxianzhu): Avoid using function when possible. For example, we can
-// avoid it by avoiding unnecessary conversions between LayoutRects and
-// FloatRects.
-static LayoutRect enclosingLayoutRectIfNotEmpty(const FloatRect& floatRect) {
- return floatRect.isEmpty() ? LayoutRect(floatRect)
- : enclosingLayoutRect(floatRect);
-}
-
static LayoutRect slowMapToVisualRectInAncestorSpace(
const LayoutObject& object,
const LayoutBoxModelObject& ancestor,
@@ -39,7 +31,7 @@
return result;
}
- LayoutRect result = enclosingLayoutRectIfNotEmpty(rect);
+ LayoutRect result(rect);
if (object.isLayoutView())
toLayoutView(object).mapToVisualRectInAncestorSpace(
&ancestor, result, InputIsInFrameCoordinates, DefaultVisualRectFlags);
@@ -48,9 +40,7 @@
return result;
}
-// TODO(wangxianzhu): Combine this into
-// PaintInvalidator::mapLocalRectToPaintInvalidationBacking() when removing
-// PaintInvalidationState.
+// TODO(wangxianzhu): Combine this into PaintInvalidator::mapLocalRectToPaintInvalidationBacking() when removing PaintInvalidationState.
static LayoutRect mapLocalRectToPaintInvalidationBacking(
GeometryMapper& geometryMapper,
const LayoutObject& object,
@@ -80,7 +70,7 @@
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
// In SPv2, visual rects are in the space of their local transform node.
rect.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset));
- return enclosingLayoutRectIfNotEmpty(rect);
+ return LayoutRect(rect);
}
LayoutRect result;
@@ -89,7 +79,7 @@
result = slowMapToVisualRectInAncestorSpace(
object, *context.paintInvalidationContainer, rect);
} else if (object == context.paintInvalidationContainer) {
- result = enclosingLayoutRectIfNotEmpty(rect);
+ result = LayoutRect(rect);
} else {
rect.moveBy(FloatPoint(context.treeBuilderContext.current.paintOffset));
@@ -104,10 +94,9 @@
containerPaintProperties->contentsProperties();
bool success = false;
- result = enclosingLayoutRectIfNotEmpty(
- geometryMapper.mapToVisualRectInDestinationSpace(
- rect, currentTreeState,
- containerContentsProperties.propertyTreeState, success));
+ result = LayoutRect(geometryMapper.mapToVisualRectInDestinationSpace(
+ rect, currentTreeState, containerContentsProperties.propertyTreeState,
+ success));
DCHECK(success);
// Convert the result to the container's contents space.
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698