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

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: Changed name. 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
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | Source/core/rendering/RenderReplaced.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 336efebfd33999b7f863d51446c583ff5476e64b..edcb1c94870370845552b44c62254c97e361c6cd 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -1411,12 +1411,7 @@ static PassRefPtr<JSONValue> jsonObjectForRepaintInfo(const IntRect& rect, const
return object.release();
}
-LayoutRect RenderObject::computeRepaintRect() const
-{
- return computeRepaintRectInternal(containerForRepaint());
-}
-
-LayoutRect RenderObject::computeRepaintRectInternal(const RenderLayerModelObject* repaintContainer) const
+LayoutRect RenderObject::computeRepaintRect(const RenderLayerModelObject* repaintContainer) const
{
return clippedOverflowRectForRepaint(repaintContainer);
}
@@ -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);
+ 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()->mapRectToRepaintBacking(repaintContainer, dirtyRect);
+ else
+ mapRectToRepaintBacking(repaintContainer, dirtyRect);
repaintUsingContainer(repaintContainer, pixelSnappedIntRect(dirtyRect), InvalidationRepaintRectangle);
}
@@ -1746,7 +1752,7 @@ LayoutRect RenderObject::clippedOverflowRectForRepaint(const RenderLayerModelObj
return LayoutRect();
}
-void RenderObject::computeRectForRepaint(const RenderLayerModelObject* repaintContainer, LayoutRect& rect, bool fixed) const
+void RenderObject::mapRectToRepaintBacking(const RenderLayerModelObject* repaintContainer, LayoutRect& rect, bool fixed) const
{
if (repaintContainer == this)
return;
@@ -1765,7 +1771,7 @@ void RenderObject::computeRectForRepaint(const RenderLayerModelObject* repaintCo
return;
}
- o->computeRectForRepaint(repaintContainer, rect, fixed);
+ o->mapRectToRepaintBacking(repaintContainer, rect, fixed);
}
}
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | Source/core/rendering/RenderReplaced.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698