Chromium Code Reviews| 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, |