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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp

Issue 1441973003: Use recomputed interest rect only if it changed enough (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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: third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp b/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp
index aa46e43940742b229900fa201650938a29b61626..7ce69eb6d7f25f0affdd2e3390a9f58aa5afadf3 100644
--- a/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp
@@ -800,21 +800,23 @@ static void paintScrollbar(const Scrollbar* scrollbar, GraphicsContext& context,
scrollbar->paint(&context, CullRect(transformedClip));
}
-void PaintLayerCompositor::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& context, GraphicsLayerPaintingPhase, const IntRect* clip) const
+IntRect PaintLayerCompositor::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& context, GraphicsLayerPaintingPhase, const IntRect* interestRect) const
{
- IntRect defaultClip;
- if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled() && !clip) {
- defaultClip.setSize(m_layoutView.layoutSize(IncludeScrollbars));
- clip = &defaultClip;
+ IntRect defaultInterestRect;
+ if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled() && !interestRect) {
+ defaultInterestRect.setSize(m_layoutView.layoutSize(IncludeScrollbars));
+ interestRect = &defaultInterestRect;
}
- ASSERT(clip);
+ ASSERT(interestRect);
if (graphicsLayer == layerForHorizontalScrollbar())
- paintScrollbar(m_layoutView.frameView()->horizontalScrollbar(), context, *clip);
+ paintScrollbar(m_layoutView.frameView()->horizontalScrollbar(), context, *interestRect);
else if (graphicsLayer == layerForVerticalScrollbar())
- paintScrollbar(m_layoutView.frameView()->verticalScrollbar(), context, *clip);
+ paintScrollbar(m_layoutView.frameView()->verticalScrollbar(), context, *interestRect);
else if (graphicsLayer == layerForScrollCorner())
- FramePainter(*m_layoutView.frameView()).paintScrollCorner(&context, *clip);
+ FramePainter(*m_layoutView.frameView()).paintScrollCorner(&context, *interestRect);
+
+ return *interestRect;
}
bool PaintLayerCompositor::supportsFixedRootBackgroundCompositing() const

Powered by Google App Engine
This is Rietveld 408576698