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

Unified Diff: third_party/WebKit/Source/platform/scroll/ScrollbarTheme.h

Issue 1458703010: Mac: Don't repaint scrollbars every frame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master2
Patch Set: Rebase and resolve 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/scroll/ScrollbarTheme.h
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollbarTheme.h b/third_party/WebKit/Source/platform/scroll/ScrollbarTheme.h
index f078c02a657b570e851d0aad5a1982ea0f4d0a91..11a38e527cc006345a12db6c6a9532c5cac858d1 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollbarTheme.h
+++ b/third_party/WebKit/Source/platform/scroll/ScrollbarTheme.h
@@ -38,6 +38,7 @@ class CullRect;
class GraphicsContext;
class PlatformMouseEvent;
class ScrollbarThemeClient;
+class ScrollbarThemePaintParams;
class PLATFORM_EXPORT ScrollbarTheme {
WTF_MAKE_NONCOPYABLE(ScrollbarTheme); USING_FAST_MALLOC(ScrollbarTheme);
@@ -45,6 +46,13 @@ public:
ScrollbarTheme() { }
virtual ~ScrollbarTheme() { }
+ // If true, then scrollbars with this theme will be painted every time
+ // Scrollbar::setNeedsPaintInvalidation is called. If false, then scrollbar
+ // thumb and track part painting results will be cached and not repainted
+ // unless requested by Scrollbar::setThumbNeedsRepaint or
+ // Scrollbar::setTrackNeedsRepaint.
+ virtual bool shouldRepaintAllPartsOnInvalidation() const { return true; }
+
virtual void updateEnabledState(const ScrollbarThemeClient*) { }
virtual bool paint(const ScrollbarThemeClient*, GraphicsContext*, const CullRect&);
@@ -77,6 +85,8 @@ public:
virtual int trackPosition(const ScrollbarThemeClient*);
// The length of the track along the axis of the scrollbar.
virtual int trackLength(const ScrollbarThemeClient*);
+ // The opacity to be applied to the thumb.
+ virtual float thumbOpacity(const ScrollbarThemeClient*) const { return 1.0f; }
virtual bool hasButtons(const ScrollbarThemeClient*) = 0;
virtual bool hasThumb(const ScrollbarThemeClient*) = 0;

Powered by Google App Engine
This is Rietveld 408576698