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

Unified Diff: third_party/WebKit/Source/platform/exported/WebScrollbarThemePainter.cpp

Issue 1458703010: Mac: Don't repaint scrollbars every frame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master2
Patch Set: Sprinkle in some tests Created 5 years, 1 month 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/exported/WebScrollbarThemePainter.cpp
diff --git a/third_party/WebKit/Source/platform/exported/WebScrollbarThemePainter.cpp b/third_party/WebKit/Source/platform/exported/WebScrollbarThemePainter.cpp
index 8b63bbffefa025a5c11808b04db7e8dfe09f394b..a170f59258d2b83d2f7c616991b85829a985bb6e 100644
--- a/third_party/WebKit/Source/platform/exported/WebScrollbarThemePainter.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebScrollbarThemePainter.cpp
@@ -68,6 +68,8 @@ void WebScrollbarThemePainter::paintTrackBackground(WebCanvas* canvas, const Web
pictureBuilder.context().setDeviceScaleFactor(m_deviceScaleFactor);
m_theme->paintTrackBackground(&pictureBuilder.context(), m_scrollbar.get(), intRect);
pictureBuilder.endRecording()->playback(canvas);
+ if (!m_theme->shouldRepaintAllPartsOnInvalidation())
+ m_scrollbar->setNeedsPaintTrack(false);
}
void WebScrollbarThemePainter::paintBackTrackPart(WebCanvas* canvas, const WebRect& rect)
@@ -140,6 +142,8 @@ void WebScrollbarThemePainter::paintThumb(WebCanvas* canvas, const WebRect& rect
pictureBuilder.context().setDeviceScaleFactor(m_deviceScaleFactor);
m_theme->paintThumb(&pictureBuilder.context(), m_scrollbar.get(), intRect);
pictureBuilder.endRecording()->playback(canvas);
+ if (!m_theme->shouldRepaintAllPartsOnInvalidation())
+ m_scrollbar->setNeedsPaintThumb(false);
}
WebScrollbarThemePainter::WebScrollbarThemePainter(ScrollbarTheme* theme, Scrollbar* scrollbar, float deviceScaleFactor)
@@ -149,4 +153,24 @@ WebScrollbarThemePainter::WebScrollbarThemePainter(ScrollbarTheme* theme, Scroll
{
}
+float WebScrollbarThemePainter::thumbOpacity() const
+{
+ return m_theme->thumbOpacity(m_scrollbar.get());
+}
+
+float WebScrollbarThemePainter::trackOpacity() const
+{
+ return m_theme->trackOpacity(m_scrollbar.get());
+}
+
+bool WebScrollbarThemePainter::needsPaintTrack() const
+{
+ return m_scrollbar->needsPaintTrack();
+}
+
+bool WebScrollbarThemePainter::needsPaintThumb() const
+{
+ return m_scrollbar->needsPaintThumb();
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698