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 ea53d0f3d2be5f51ed6b6161b3c55e4500a51efc..011a4a1cf0222cfdfffa55218da42fc6a920d49c 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 @@ static LayoutRect slowMapToVisualRectInAncestorSpace( |
return result; |
} |
- LayoutRect result = enclosingLayoutRectIfNotEmpty(rect); |
+ LayoutRect result(rect); |
if (object.isLayoutView()) |
toLayoutView(object).mapToVisualRectInAncestorSpace( |
&ancestor, result, InputIsInFrameCoordinates, DefaultVisualRectFlags); |
@@ -80,7 +72,7 @@ static LayoutRect mapLocalRectToPaintInvalidationBacking( |
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 +81,7 @@ static LayoutRect mapLocalRectToPaintInvalidationBacking( |
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 +96,9 @@ static LayoutRect mapLocalRectToPaintInvalidationBacking( |
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. |