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

Unified Diff: third_party/WebKit/Source/core/paint/FramePainter.cpp

Issue 2741223002: Use correct ScrollbarTheme to paintScrollCorner (Closed)
Patch Set: Created 3 years, 9 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: third_party/WebKit/Source/core/paint/FramePainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/FramePainter.cpp b/third_party/WebKit/Source/core/paint/FramePainter.cpp
index 447f20c8db45d7eb37087094a254490b83302eac..a5c0b076f1f0910caeba18a8b17adc8a3fe54256 100644
--- a/third_party/WebKit/Source/core/paint/FramePainter.cpp
+++ b/third_party/WebKit/Source/core/paint/FramePainter.cpp
@@ -196,20 +196,28 @@ void FramePainter::paintContents(GraphicsContext& context,
void FramePainter::paintScrollbars(GraphicsContext& context,
const IntRect& rect) {
+ ScrollbarTheme* scrollbarTheme = nullptr;
if (frameView().horizontalScrollbar() &&
- !frameView().layerForHorizontalScrollbar())
+ !frameView().layerForHorizontalScrollbar()) {
paintScrollbar(context, *frameView().horizontalScrollbar(), rect);
+ scrollbarTheme = &frameView().horizontalScrollbar()->theme();
+ }
if (frameView().verticalScrollbar() &&
- !frameView().layerForVerticalScrollbar())
+ !frameView().layerForVerticalScrollbar()) {
paintScrollbar(context, *frameView().verticalScrollbar(), rect);
+ scrollbarTheme = &frameView().horizontalScrollbar()->theme();
+ }
if (frameView().layerForScrollCorner())
return;
- paintScrollCorner(context, frameView().scrollCornerRect());
+ DCHECK(scrollbarTheme);
+ scrollbarTheme = scrollbarTheme ? scrollbarTheme : &ScrollbarTheme::theme();
+ paintScrollCorner(context, *scrollbarTheme, frameView().scrollCornerRect());
}
void FramePainter::paintScrollCorner(GraphicsContext& context,
+ ScrollbarTheme& theme,
bokan 2017/03/13 13:52:09 Rather than passing the theme in, just computed it
const IntRect& cornerRect) {
if (frameView().scrollCorner()) {
bool needsBackground = frameView().frame().isMainFrame();
@@ -228,8 +236,7 @@ void FramePainter::paintScrollCorner(GraphicsContext& context,
return;
}
- ScrollbarTheme::theme().paintScrollCorner(context, *frameView().layoutView(),
- cornerRect);
+ theme.paintScrollCorner(context, *frameView().layoutView(), cornerRect);
}
void FramePainter::paintScrollbar(GraphicsContext& context,

Powered by Google App Engine
This is Rietveld 408576698