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

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

Issue 2763833003: Optimize PaintInvalidatorContext::mapLocalRectToVisualRectInBacking() (Closed)
Patch Set: - Created 3 years, 9 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/PaintInvalidator.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp b/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
index d0089dc295ef8d7d014671ea53c16e0cae93edea..10d4fed99f6cda4a6b32fd9c112ed8373985279a 100644
--- a/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp
@@ -52,8 +52,7 @@ template <typename Rect, typename Point>
static LayoutRect mapLocalRectToVisualRectInBacking(
const LayoutObject& object,
const Rect& localRect,
- const PaintInvalidatorContext& context,
- GeometryMapper& geometryMapper) {
+ const PaintInvalidatorContext& context) {
if (localRect.isEmpty())
return LayoutRect();
@@ -130,7 +129,7 @@ static LayoutRect mapLocalRectToVisualRectInBacking(
context.treeBuilderContext.current.clip, nullptr);
FloatRect floatRect(rect);
- geometryMapper.sourceToDestinationVisualRect(
+ context.geometryMapper.sourceToDestinationVisualRect(
currentTreeState, *containerContentsProperties, floatRect);
result = LayoutRect(floatRect);
}
@@ -153,9 +152,8 @@ static LayoutRect mapLocalRectToVisualRectInBacking(
void PaintInvalidatorContext::mapLocalRectToVisualRectInBacking(
const LayoutObject& object,
LayoutRect& rect) const {
- std::unique_ptr<GeometryMapper> geometryMapper = GeometryMapper::create();
rect = blink::mapLocalRectToVisualRectInBacking<LayoutRect, LayoutPoint>(
- object, rect, *this, *geometryMapper);
+ object, rect, *this);
}
LayoutRect PaintInvalidator::computeVisualRectInBacking(
@@ -164,10 +162,10 @@ LayoutRect PaintInvalidator::computeVisualRectInBacking(
if (object.isSVGChild()) {
FloatRect localRect = SVGLayoutSupport::localVisualRect(object);
return mapLocalRectToVisualRectInBacking<FloatRect, FloatPoint>(
- object, localRect, context, m_geometryMapper);
+ object, localRect, context);
}
return mapLocalRectToVisualRectInBacking<LayoutRect, LayoutPoint>(
- object, object.localVisualRect(), context, m_geometryMapper);
+ object, object.localVisualRect(), context);
}
LayoutPoint PaintInvalidator::computeLocationInBacking(
@@ -187,7 +185,7 @@ LayoutPoint PaintInvalidator::computeLocationInBacking(
->transform();
if (context.treeBuilderContext.current.transform != containerTransform) {
FloatRect rect = FloatRect(FloatPoint(point), FloatSize());
- m_geometryMapper.sourceToDestinationRect(
+ context.geometryMapper.sourceToDestinationRect(
context.treeBuilderContext.current.transform, containerTransform,
rect);
point = LayoutPoint(rect.location());
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintInvalidator.h ('k') | third_party/WebKit/Source/core/paint/PrePaintTreeWalk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698