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

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

Issue 908453003: Blink changes to record interest rects for http://w3c.github.io/frame-timing/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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/RenderView.cpp
diff --git a/Source/core/rendering/RenderView.cpp b/Source/core/rendering/RenderView.cpp
index 55b16e741275b455a4eb3547caa2a5cae790331c..0d9dfd5ed81cff2c4cd781d687a373bca3074b5b 100644
--- a/Source/core/rendering/RenderView.cpp
+++ b/Source/core/rendering/RenderView.cpp
@@ -333,6 +333,29 @@ void RenderView::invalidateTreeIfNeeded(const PaintInvalidationState& paintInval
RenderBlock::invalidateTreeIfNeeded(paintInvalidationState);
}
+LayoutRect RenderView::rectForPaintInvalidation(const LayoutRect* paintInvalidationRectPtr) const
enne (OOO) 2015/02/10 00:17:49 I see your comment about this existing before and
MikeB 2015/03/18 21:18:34 I updated this to be more in-line with using prope
+{
+ LayoutRect paintInvalidationRect =
+ paintInvalidationRectPtr ? *paintInvalidationRectPtr : viewRect();
+ Element* owner = document().ownerElement();
+ if (document().printing() || !m_frameView
+ || layer()->compositingState() == PaintsIntoOwnBacking || !owner)
+ return paintInvalidationRect;
+ if (RenderBox* obj = owner->renderBox()) {
+ // Intersect the viewport with the paint invalidation rect.
+ LayoutRect viewRectangle = viewRect();
+ LayoutRect rectToInvalidate = intersection(paintInvalidationRect, viewRectangle);
+
+ // Adjust for scroll offset of the view.
+ rectToInvalidate.moveBy(-viewRectangle.location());
+
+ // Adjust for frame border.
+ rectToInvalidate.moveBy(obj->contentBoxRect().location());
+ return rectToInvalidate;
+ }
+ return paintInvalidationRect;
+}
+
void RenderView::invalidatePaintForRectangle(const LayoutRect& paintInvalidationRect, PaintInvalidationReason invalidationReason) const
{
ASSERT(!paintInvalidationRect.isEmpty());

Powered by Google App Engine
This is Rietveld 408576698