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

Unified Diff: third_party/WebKit/Source/platform/scroll/ScrollbarThemeMock.cpp

Issue 1511003003: Use refs for non-null GraphicsContext, Scrollbar, etc. in scrollbar related code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarRemove
Patch Set: yet another mac fix Created 5 years 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/platform/scroll/ScrollbarThemeMock.cpp
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeMock.cpp b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeMock.cpp
index 4007cbb6655e4ff942f4ac47e0c4a8f342b44e58..8a7d2d9d050c61805088827925fd1d6ef53db1de 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeMock.cpp
+++ b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeMock.cpp
@@ -57,31 +57,30 @@ bool ScrollbarThemeMock::shouldRepaintAllPartsOnInvalidation() const
return gShouldRepaintAllPartsOnInvalidation;
}
-IntRect ScrollbarThemeMock::trackRect(const ScrollbarThemeClient* scrollbar, bool)
+IntRect ScrollbarThemeMock::trackRect(const ScrollbarThemeClient& scrollbar, bool)
{
- return scrollbar->frameRect();
+ return scrollbar.frameRect();
}
-
-void ScrollbarThemeMock::paintTrackBackground(GraphicsContext* context, const ScrollbarThemeClient* scrollbar, const IntRect& trackRect)
+void ScrollbarThemeMock::paintTrackBackground(GraphicsContext& context, const ScrollbarThemeClient& scrollbar, const IntRect& trackRect)
{
- if (DrawingRecorder::useCachedDrawingIfPossible(*context, *scrollbar, DisplayItem::ScrollbarTrackBackground))
+ if (DrawingRecorder::useCachedDrawingIfPossible(context, scrollbar, DisplayItem::ScrollbarTrackBackground))
return;
- DrawingRecorder recorder(*context, *scrollbar, DisplayItem::ScrollbarTrackBackground, trackRect);
- context->fillRect(trackRect, scrollbar->enabled() ? Color::lightGray : Color(0xFFE0E0E0));
+ DrawingRecorder recorder(context, scrollbar, DisplayItem::ScrollbarTrackBackground, trackRect);
+ context.fillRect(trackRect, scrollbar.enabled() ? Color::lightGray : Color(0xFFE0E0E0));
}
-void ScrollbarThemeMock::paintThumb(GraphicsContext* context, const ScrollbarThemeClient* scrollbar, const IntRect& thumbRect)
+void ScrollbarThemeMock::paintThumb(GraphicsContext& context, const ScrollbarThemeClient& scrollbar, const IntRect& thumbRect)
{
- if (!scrollbar->enabled())
+ if (!scrollbar.enabled())
return;
- if (DrawingRecorder::useCachedDrawingIfPossible(*context, *scrollbar, DisplayItem::ScrollbarThumb))
+ if (DrawingRecorder::useCachedDrawingIfPossible(context, scrollbar, DisplayItem::ScrollbarThumb))
return;
- DrawingRecorder recorder(*context, *scrollbar, DisplayItem::ScrollbarThumb, thumbRect);
- context->fillRect(thumbRect, Color::darkGray);
+ DrawingRecorder recorder(context, scrollbar, DisplayItem::ScrollbarThumb, thumbRect);
+ context.fillRect(thumbRect, Color::darkGray);
}
}

Powered by Google App Engine
This is Rietveld 408576698