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

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

Issue 2699593006: Refactor to remove need for infiniteIntRect when computing rects in pre-paint (Closed)
Patch Set: none Created 3 years, 10 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/PrePaintTreeWalk.cpp
diff --git a/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp b/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp
index 75febdd86ee849471d1e547dbc582d2d28030457..cc5c551ef9dc8ba924630365ea05fb83580e61a4 100644
--- a/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp
+++ b/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp
@@ -105,7 +105,7 @@ static bool isAncestorOfOrEqualTo(const ClipPaintPropertyNode* a,
return b == a;
}
-ClipRect PrePaintTreeWalk::clipRectForContext(
+FloatClipRect PrePaintTreeWalk::clipRectForContext(
const PaintPropertyTreeBuilderContext::ContainingBlockContext& context,
const EffectPaintPropertyNode* effect,
const PropertyTreeState& ancestorState,
@@ -115,20 +115,16 @@ ClipRect PrePaintTreeWalk::clipRectForContext(
// actually an ancestor clip. This ensures no accuracy issues due to
// transforms applied to infinite rects.
if (isAncestorOfOrEqualTo(context.clip, ancestorState.clip()))
- return ClipRect(LayoutRect(LayoutRect::infiniteIntRect()));
+ return FloatClipRect();
hasClip = true;
PropertyTreeState localState(context.transform, context.clip, effect);
- // TODO(chrishtr): remove need for this.
- LayoutRect localRect(LayoutRect::infiniteIntRect());
+ FloatClipRect rect(
+ m_geometryMapper.sourceToDestinationClipRect(localState, ancestorState));
- LayoutRect rect(m_geometryMapper
- .sourceToDestinationVisualRect(FloatRect(localRect),
- localState, ancestorState)
- .rect());
- rect.moveBy(-ancestorPaintOffset);
+ rect.moveBy(-FloatPoint(ancestorPaintOffset));
return rect;
}
« no previous file with comments | « third_party/WebKit/Source/core/paint/PrePaintTreeWalk.h ('k') | third_party/WebKit/Source/platform/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698