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

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

Issue 301843002: Store repaint rects in the coordinate space of their backing GraphicsLayer. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix comment. Created 6 years, 7 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: Source/core/rendering/RenderObject.cpp
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
index 336efebfd33999b7f863d51446c583ff5476e64b..8d2b45f8afe5275fa503a80f9da07f5f3e087cdf 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -1411,14 +1411,9 @@ static PassRefPtr<JSONValue> jsonObjectForRepaintInfo(const IntRect& rect, const
return object.release();
}
-LayoutRect RenderObject::computeRepaintRect() const
+LayoutRect RenderObject::computeRepaintRect(const RenderLayerModelObject* repaintContainer) const
{
- return computeRepaintRectInternal(containerForRepaint());
-}
-
-LayoutRect RenderObject::computeRepaintRectInternal(const RenderLayerModelObject* repaintContainer) const
-{
- return clippedOverflowRectForRepaint(repaintContainer);
+ return clippedOverflowRectForRepaint(repaintContainer ? repaintContainer: containerForRepaint());
leviw_travelin_and_unemployed 2014/05/29 18:27:08 I don't really want this ternary to exist, but you
chrishtr 2014/05/29 18:34:11 Done.
}
void RenderObject::repaintUsingContainer(const RenderLayerModelObject* repaintContainer, const IntRect& r, InvalidationReason invalidationReason) const
@@ -1485,7 +1480,15 @@ void RenderObject::repaint() const
// Until those states are fully fledged, I'll just disable the ASSERTS.
DisableCompositingQueryAsserts disabler;
const RenderLayerModelObject* repaintContainer = containerForRepaint();
- repaintUsingContainer(repaintContainer, pixelSnappedIntRect(computeRepaintRectInternal(repaintContainer)), InvalidationRepaint);
+ LayoutRect repaintRect = boundsRectForRepaint(repaintContainer);
leviw_travelin_and_unemployed 2014/05/29 18:27:08 Why add the local?
+ repaintUsingContainer(repaintContainer, pixelSnappedIntRect(repaintRect), InvalidationRepaint);
+}
+
+LayoutRect RenderObject::boundsRectForRepaint(const RenderLayerModelObject* repaintContainer) const
+{
+ if (hasLayer())
+ return toRenderLayerModelObject(this)->layer()->computeRepaintRect(repaintContainer);
+ return computeRepaintRect(repaintContainer);
}
void RenderObject::repaintRectangle(const LayoutRect& r) const
@@ -1505,7 +1508,10 @@ void RenderObject::repaintRectangle(const LayoutRect& r) const
}
const RenderLayerModelObject* repaintContainer = containerForRepaint();
- computeRectForRepaint(repaintContainer, dirtyRect);
+ if (hasLayer())
+ toRenderLayerModelObject(this)->layer()->computeRectForRepaint(repaintContainer, dirtyRect);
+ else
+ computeRectForRepaint(repaintContainer, dirtyRect);
repaintUsingContainer(repaintContainer, pixelSnappedIntRect(dirtyRect), InvalidationRepaintRectangle);
}
« Source/core/rendering/RenderObject.h ('K') | « Source/core/rendering/RenderObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698