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

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

Issue 390193003: [not for review] Add Draw entries to window Performance Timeline (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Git pull syncup Created 6 years, 3 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/RenderView.h ('k') | Source/core/timing/Performance.h » ('j') | 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 2beeea11ee7261838a72bb2cf995f77944d25141..035817f404140ec0a98d3f76cc6988a36a6a0287 100644
--- a/Source/core/rendering/RenderView.cpp
+++ b/Source/core/rendering/RenderView.cpp
@@ -442,6 +442,29 @@ void RenderView::invalidateTreeIfNeeded(const PaintInvalidationState& paintInval
RenderBlock::invalidateTreeIfNeeded(paintInvalidationState);
}
+LayoutRect RenderView::rectForPaintInvalidation(const LayoutRect* paintInvalidationRectPtr) const
+{
+ 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) const
{
ASSERT(!paintInvalidationRect.isEmpty());
« no previous file with comments | « Source/core/rendering/RenderView.h ('k') | Source/core/timing/Performance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698