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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.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/layout/compositing/PaintLayerCompositor.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp b/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp
index 960e797a567a0e278c8e0bfb066efd0e17373b59..6426723396324ac22260716b896c3a59ba1c52d5 100644
--- a/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp
@@ -69,6 +69,7 @@
#include "platform/graphics/paint/TransformDisplayItem.h"
#include "platform/instrumentation/tracing/TraceEvent.h"
#include "platform/json/JSONValues.h"
+#include "platform/scroll/ScrollbarTheme.h"
namespace blink {
@@ -935,8 +936,9 @@ void PaintLayerCompositor::paintContents(const GraphicsLayer* graphicsLayer,
if (scrollbar) {
paintScrollbar(graphicsLayer, scrollbar, builder.context(), interestRect);
} else {
+ ScrollbarTheme& theme = scrollbarThemeOfScrollCorner();
FramePainter(*m_layoutView.frameView())
- .paintScrollCorner(builder.context(), interestRect);
+ .paintScrollCorner(builder.context(), theme, interestRect);
}
// Replay the painted scrollbar content with the GraphicsLayer backing as the
@@ -959,6 +961,17 @@ Scrollbar* PaintLayerCompositor::graphicsLayerToScrollbar(
return nullptr;
}
+ScrollbarTheme& PaintLayerCompositor::scrollbarThemeOfScrollCorner() const {
bokan 2017/03/13 13:52:09 FramePainter keeps a reference to frameView itself
+ if (m_layoutView.frameView()->horizontalScrollbar())
+ return m_layoutView.frameView()->horizontalScrollbar()->theme();
+
+ if (m_layoutView.frameView()->verticalScrollbar())
+ return m_layoutView.frameView()->verticalScrollbar()->theme();
+
+ NOTREACHED();
+ return ScrollbarTheme::theme();
+}
+
bool PaintLayerCompositor::supportsFixedRootBackgroundCompositing() const {
if (Settings* settings = m_layoutView.document().settings())
return settings->getPreferCompositingToLCDTextEnabled();

Powered by Google App Engine
This is Rietveld 408576698