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

Unified Diff: Source/platform/scroll/ScrollbarThemeMacOverlayAPI.mm

Issue 1220583004: Refactor DrawingRecorders to check for cached drawings earlier (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 5 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/ScrollbarThemeMacOverlayAPI.mm
diff --git a/Source/platform/scroll/ScrollbarThemeMacOverlayAPI.mm b/Source/platform/scroll/ScrollbarThemeMacOverlayAPI.mm
index 829fb23bc947e20f5ed148ac91562739308b4384..f565bdbaa382b6280594746658727e87d269f2ee 100644
--- a/Source/platform/scroll/ScrollbarThemeMacOverlayAPI.mm
+++ b/Source/platform/scroll/ScrollbarThemeMacOverlayAPI.mm
@@ -86,10 +86,11 @@ ScrollbarPainter ScrollbarThemeMacOverlayAPI::painterForScrollbar(ScrollbarTheme
}
void ScrollbarThemeMacOverlayAPI::paintTrackBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect) {
- DrawingRecorder recorder(*context, *scrollbar, DisplayItem::ScrollbarTrackBackground, rect);
- if (recorder.canUseCachedDrawing())
+ if (DrawingRecorder::useCachedDrawingIfPossible(*context, *scrollbar, DisplayItem::ScrollbarTrackBackground))
return;
+ DrawingRecorder recorder(*context, *scrollbar, DisplayItem::ScrollbarTrackBackground, rect);
+
ASSERT(isOverlayAPIAvailable());
GraphicsContextStateSaver stateSaver(*context);
@@ -106,12 +107,13 @@ void ScrollbarThemeMacOverlayAPI::paintTrackBackground(GraphicsContext* context,
}
void ScrollbarThemeMacOverlayAPI::paintThumb(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect) {
+ if (DrawingRecorder::useCachedDrawingIfPossible(*context, *scrollbar, DisplayItem::ScrollbarThumb))
+ return;
+
// Expand dirty rect to allow for scroll thumb anti-aliasing in minimum thumb size case.
IntRect dirtyRect = IntRect(rect);
dirtyRect.inflate(1);
DrawingRecorder recorder(*context, *scrollbar, DisplayItem::ScrollbarThumb, dirtyRect);
- if (recorder.canUseCachedDrawing())
- return;
ASSERT(isOverlayAPIAvailable());
« no previous file with comments | « Source/platform/scroll/ScrollbarThemeMacNonOverlayAPI.mm ('k') | Source/platform/scroll/ScrollbarThemeMock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698