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

Unified Diff: Source/platform/scroll/ScrollbarThemeOverlay.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/platform/scroll/ScrollbarThemeOverlay.cpp
diff --git a/Source/platform/scroll/ScrollbarThemeOverlay.cpp b/Source/platform/scroll/ScrollbarThemeOverlay.cpp
index e0d76116fd329c3f8500dc26d5805bd2f40b92d9..be49135a253f135c5709608882140cc103c273ee 100644
--- a/Source/platform/scroll/ScrollbarThemeOverlay.cpp
+++ b/Source/platform/scroll/ScrollbarThemeOverlay.cpp
@@ -128,10 +128,11 @@ int ScrollbarThemeOverlay::thumbThickness(ScrollbarThemeClient*)
void ScrollbarThemeOverlay::paintThumb(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect)
{
- DrawingRecorder recorder(*context, *scrollbar, DisplayItem::ScrollbarThumb, rect);
- if (recorder.canUseCachedDrawing())
+ if (DrawingRecorder::useCachedDrawingIfPossible(*context, *scrollbar, DisplayItem::ScrollbarThumb))
return;
+ DrawingRecorder recorder(*context, *scrollbar, DisplayItem::ScrollbarThumb, rect);
+
IntRect thumbRect = rect;
if (scrollbar->orientation() == HorizontalScrollbar) {
thumbRect.setHeight(thumbRect.height() - m_scrollbarMargin);

Powered by Google App Engine
This is Rietveld 408576698