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

Unified Diff: Source/core/paint/ScrollableAreaPainter.cpp

Issue 1154993004: Don't paint empty scrollbar parts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | « no previous file | Source/platform/scroll/ScrollbarTheme.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/ScrollableAreaPainter.cpp
diff --git a/Source/core/paint/ScrollableAreaPainter.cpp b/Source/core/paint/ScrollableAreaPainter.cpp
index d2ba3197894c23924ebd5bc7699fa46b04b245f5..6cfb3fbaa93a7def7c1457e78ffe77ba658b707c 100644
--- a/Source/core/paint/ScrollableAreaPainter.cpp
+++ b/Source/core/paint/ScrollableAreaPainter.cpp
@@ -23,15 +23,20 @@ void ScrollableAreaPainter::paintResizer(GraphicsContext* context, const IntPoin
return;
IntRect absRect = m_scrollableArea.resizerCornerRect(m_scrollableArea.box().pixelSnappedBorderBoxRect(), ResizerForPointer);
- absRect.moveBy(paintOffset);
- if (!absRect.intersects(damageRect))
+ if (absRect.isEmpty())
return;
+ absRect.moveBy(paintOffset);
if (m_scrollableArea.resizer()) {
+ if (!absRect.intersects(damageRect))
chrishtr 2015/06/05 22:50:09 Why is this ok? I thought we had to paint all or n
Xianzhu 2015/06/05 22:56:54 We paint all or none for non-custom parts. For cus
chrishtr 2015/06/05 22:59:11 OK, then...
+ return;
ScrollbarPainter::paintIntoRect(m_scrollableArea.resizer(), context, paintOffset, LayoutRect(absRect));
return;
}
+ if (!RuntimeEnabledFeatures::slimmingPaintEnabled() && !absRect.intersects(damageRect))
chrishtr 2015/06/05 22:59:11 Why condition on slimming paint here?
Xianzhu 2015/06/05 23:04:41 This is the non-custom path. In slimming paint mod
+ return;
+
DrawingRecorder recorder(*context, m_scrollableArea.box(), DisplayItem::Resizer, absRect);
if (recorder.canUseCachedDrawing())
return;
@@ -167,6 +172,8 @@ bool ScrollableAreaPainter::overflowControlsIntersectRect(const IntRect& localRe
void ScrollableAreaPainter::paintScrollCorner(GraphicsContext* context, const IntPoint& paintOffset, const IntRect& damageRect)
{
IntRect absRect = m_scrollableArea.scrollCornerRect();
+ if (absRect.isEmpty())
+ return;
absRect.moveBy(paintOffset);
if (m_scrollableArea.scrollCorner()) {
« no previous file with comments | « no previous file | Source/platform/scroll/ScrollbarTheme.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698