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

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

Issue 318183002: Fix repainting of composited RenderViews (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix *horrible* naming Created 6 years, 6 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 | « LayoutTests/fast/repaint/resources/composited-iframe-scroll-repaint-iframe.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderView.cpp
diff --git a/Source/core/rendering/RenderView.cpp b/Source/core/rendering/RenderView.cpp
index 42960837bc5481f1ba6ee1faf55608b045d45e00..f7c5cb63dffbc82ce3947bd167032c35c47472a7 100644
--- a/Source/core/rendering/RenderView.cpp
+++ b/Source/core/rendering/RenderView.cpp
@@ -460,32 +460,31 @@ void RenderView::invalidateTreeAfterLayout(const RenderLayerModelObject& paintIn
RenderBlock::invalidateTreeAfterLayout(paintInvalidationContainer);
}
-void RenderView::repaintViewRectangle(const LayoutRect& ur) const
+void RenderView::repaintViewRectangle(const LayoutRect& repaintRect) const
{
- ASSERT(!ur.isEmpty());
+ ASSERT(!repaintRect.isEmpty());
if (document().printing() || !m_frameView)
return;
// We always just invalidate the root view, since we could be an iframe that is clipped out
// or even invisible.
- Element* elt = document().ownerElement();
- if (!elt) {
- if (hasLayer() && layer()->compositingState() == PaintsIntoOwnBacking)
- layer()->repainter().setBackingNeedsRepaintInRect(ur);
- else
- m_frameView->contentRectangleForPaintInvalidation(pixelSnappedIntRect(ur));
- } else if (RenderBox* obj = elt->renderBox()) {
- LayoutRect vr = viewRect();
- LayoutRect r = intersection(ur, vr);
+ Element* owner = document().ownerElement();
+ if (layer()->compositingState() == PaintsIntoOwnBacking) {
+ layer()->repainter().setBackingNeedsRepaintInRect(repaintRect);
+ } else if (!owner) {
+ m_frameView->contentRectangleForPaintInvalidation(pixelSnappedIntRect(repaintRect));
+ } else if (RenderBox* obj = owner->renderBox()) {
+ LayoutRect viewRectangle = viewRect();
+ LayoutRect rectToRepaint = intersection(repaintRect, viewRectangle);
// Subtract out the contentsX and contentsY offsets to get our coords within the viewing
// rectangle.
- r.moveBy(-vr.location());
+ rectToRepaint.moveBy(-viewRectangle.location());
// FIXME: Hardcoded offsets here are not good.
- r.moveBy(obj->contentBoxRect().location());
- obj->repaintRectangle(r);
+ rectToRepaint.moveBy(obj->contentBoxRect().location());
+ obj->repaintRectangle(rectToRepaint);
}
}
« no previous file with comments | « LayoutTests/fast/repaint/resources/composited-iframe-scroll-repaint-iframe.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698