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

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

Issue 1220583004: Refactor DrawingRecorders to check for cached drawings earlier (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix some !'s and &&'s. De Morgan would be proud. 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
Index: Source/core/paint/ScrollableAreaPainter.cpp
diff --git a/Source/core/paint/ScrollableAreaPainter.cpp b/Source/core/paint/ScrollableAreaPainter.cpp
index 3ed22c54fd672e13beb75f57aab81680fc9fedda..67dbb422f3287a16225542daad385d20a24eb062 100644
--- a/Source/core/paint/ScrollableAreaPainter.cpp
+++ b/Source/core/paint/ScrollableAreaPainter.cpp
@@ -37,10 +37,11 @@ void ScrollableAreaPainter::paintResizer(GraphicsContext* context, const IntPoin
if (!RuntimeEnabledFeatures::slimmingPaintEnabled() && !absRect.intersects(damageRect))
return;
- LayoutObjectDrawingRecorder recorder(*context, m_scrollableArea.box(), DisplayItem::Resizer, absRect);
- if (recorder.canUseCachedDrawing())
+ if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*context, m_scrollableArea.box(), DisplayItem::Resizer))
return;
+ LayoutObjectDrawingRecorder recorder(*context, m_scrollableArea.box(), DisplayItem::Resizer, absRect);
+
drawPlatformResizerImage(context, absRect);
// Draw a frame around the resizer (1px grey line) if there are any scrollbars present.
@@ -191,10 +192,10 @@ void ScrollableAreaPainter::paintScrollCorner(GraphicsContext* context, const In
if (m_scrollableArea.hasOverlayScrollbars())
return;
- LayoutObjectDrawingRecorder recorder(*context, m_scrollableArea.box(), DisplayItem::ScrollbarCorner, absRect);
- if (recorder.canUseCachedDrawing())
+ if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*context, m_scrollableArea.box(), DisplayItem::ScrollbarCorner))
return;
+ LayoutObjectDrawingRecorder recorder(*context, m_scrollableArea.box(), DisplayItem::ScrollbarCorner, absRect);
context->fillRect(absRect, Color::white);
}

Powered by Google App Engine
This is Rietveld 408576698