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

Unified Diff: Source/core/rendering/RenderObject.cpp

Issue 374833007: Use reference for paintInvalidationContainer param of invalidatePaintIfNeeded (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 5 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 | « Source/core/rendering/RenderObject.h ('k') | Source/core/rendering/svg/RenderSVGModelObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderObject.cpp
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
index e64409dae9d267488180fecadf3e4268a53d5270..89d3bda34cb111e2d4ed16401290befe37887f44 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -1617,7 +1617,7 @@ static PassRefPtr<TraceEvent::ConvertableToTraceFormat> jsonObjectForOldAndNewRe
return value.finish();
}
-bool RenderObject::invalidatePaintIfNeeded(const RenderLayerModelObject* paintInvalidationContainer, const LayoutRect& oldBounds, const LayoutPoint& oldLocation)
+bool RenderObject::invalidatePaintIfNeeded(const RenderLayerModelObject& paintInvalidationContainer, const LayoutRect& oldBounds, const LayoutPoint& oldLocation)
{
RenderView* v = view();
if (v->document().printing())
@@ -1626,7 +1626,7 @@ bool RenderObject::invalidatePaintIfNeeded(const RenderLayerModelObject* paintIn
const LayoutRect& newBounds = previousPaintInvalidationRect();
const LayoutPoint& newLocation = previousPositionFromPaintInvalidationContainer();
- ASSERT(newBounds == boundsRectForPaintInvalidation(paintInvalidationContainer));
+ ASSERT(newBounds == boundsRectForPaintInvalidation(&paintInvalidationContainer));
// FIXME: This should use a ConvertableToTraceFormat when they are available in Blink.
TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "RenderObject::invalidatePaintIfNeeded()",
@@ -1647,7 +1647,7 @@ bool RenderObject::invalidatePaintIfNeeded(const RenderLayerModelObject* paintIn
return true;
}
-InvalidationReason RenderObject::getPaintInvalidationReason(const RenderLayerModelObject* paintInvalidationContainer,
+InvalidationReason RenderObject::getPaintInvalidationReason(const RenderLayerModelObject& paintInvalidationContainer,
const LayoutRect& oldBounds, const LayoutPoint& oldLocation, const LayoutRect& newBounds, const LayoutPoint& newLocation)
{
if (shouldDoFullPaintInvalidationAfterLayout())
@@ -1688,31 +1688,29 @@ InvalidationReason RenderObject::getPaintInvalidationReason(const RenderLayerMod
return InvalidationIncremental;
}
-void RenderObject::incrementallyInvalidatePaint(const RenderLayerModelObject* paintInvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds)
+void RenderObject::incrementallyInvalidatePaint(const RenderLayerModelObject& paintInvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds)
{
- ASSERT(paintInvalidationContainer);
-
ASSERT(oldBounds.location() == newBounds.location());
LayoutUnit deltaRight = newBounds.maxX() - oldBounds.maxX();
if (deltaRight > 0)
- invalidatePaintUsingContainer(paintInvalidationContainer, LayoutRect(oldBounds.maxX(), newBounds.y(), deltaRight, newBounds.height()), InvalidationIncremental);
+ invalidatePaintUsingContainer(&paintInvalidationContainer, LayoutRect(oldBounds.maxX(), newBounds.y(), deltaRight, newBounds.height()), InvalidationIncremental);
else if (deltaRight < 0)
- invalidatePaintUsingContainer(paintInvalidationContainer, LayoutRect(newBounds.maxX(), oldBounds.y(), -deltaRight, oldBounds.height()), InvalidationIncremental);
+ invalidatePaintUsingContainer(&paintInvalidationContainer, LayoutRect(newBounds.maxX(), oldBounds.y(), -deltaRight, oldBounds.height()), InvalidationIncremental);
LayoutUnit deltaBottom = newBounds.maxY() - oldBounds.maxY();
if (deltaBottom > 0)
- invalidatePaintUsingContainer(paintInvalidationContainer, LayoutRect(newBounds.x(), oldBounds.maxY(), newBounds.width(), deltaBottom), InvalidationIncremental);
+ invalidatePaintUsingContainer(&paintInvalidationContainer, LayoutRect(newBounds.x(), oldBounds.maxY(), newBounds.width(), deltaBottom), InvalidationIncremental);
else if (deltaBottom < 0)
- invalidatePaintUsingContainer(paintInvalidationContainer, LayoutRect(oldBounds.x(), newBounds.maxY(), oldBounds.width(), -deltaBottom), InvalidationIncremental);
+ invalidatePaintUsingContainer(&paintInvalidationContainer, LayoutRect(oldBounds.x(), newBounds.maxY(), oldBounds.width(), -deltaBottom), InvalidationIncremental);
}
-void RenderObject::fullyInvalidatePaint(const RenderLayerModelObject* paintInvalidationContainer, InvalidationReason invalidationReason, const LayoutRect& oldBounds, const LayoutRect& newBounds)
+void RenderObject::fullyInvalidatePaint(const RenderLayerModelObject& paintInvalidationContainer, InvalidationReason invalidationReason, const LayoutRect& oldBounds, const LayoutRect& newBounds)
{
// Otherwise do full paint invalidation.
- invalidatePaintUsingContainer(paintInvalidationContainer, oldBounds, invalidationReason);
+ invalidatePaintUsingContainer(&paintInvalidationContainer, oldBounds, invalidationReason);
if (newBounds != oldBounds)
- invalidatePaintUsingContainer(paintInvalidationContainer, newBounds, invalidationReason);
+ invalidatePaintUsingContainer(&paintInvalidationContainer, newBounds, invalidationReason);
}
void RenderObject::invalidatePaintForOverflow()
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | Source/core/rendering/svg/RenderSVGModelObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698