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

Unified Diff: third_party/WebKit/Source/platform/scroll/ScrollbarThemeMock.cpp

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/ScrollbarThemeMock.cpp
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeMock.cpp b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeMock.cpp
index 61d91d468921f0cc99e1d238f8fde26182891e51..4007cbb6655e4ff942f4ac47e0c4a8f342b44e58 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeMock.cpp
+++ b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeMock.cpp
@@ -33,13 +33,15 @@
namespace blink {
-static int cScrollbarThickness[] = { 15, 11 };
+static bool gShouldRepaintAllPartsOnInvalidation = true;
-IntRect ScrollbarThemeMock::trackRect(const ScrollbarThemeClient* scrollbar, bool)
+void ScrollbarThemeMock::setShouldRepaintAllPartsOnInvalidation(bool shouldRepaint)
{
- return scrollbar->frameRect();
+ gShouldRepaintAllPartsOnInvalidation = shouldRepaint;
}
+static int cScrollbarThickness[] = { 15, 11 };
+
int ScrollbarThemeMock::scrollbarThickness(ScrollbarControlSize controlSize)
{
return cScrollbarThickness[controlSize];
@@ -50,6 +52,17 @@ bool ScrollbarThemeMock::usesOverlayScrollbars() const
return RuntimeEnabledFeatures::overlayScrollbarsEnabled();
}
+bool ScrollbarThemeMock::shouldRepaintAllPartsOnInvalidation() const
+{
+ return gShouldRepaintAllPartsOnInvalidation;
+}
+
+IntRect ScrollbarThemeMock::trackRect(const ScrollbarThemeClient* scrollbar, bool)
+{
+ return scrollbar->frameRect();
+}
+
+
void ScrollbarThemeMock::paintTrackBackground(GraphicsContext* context, const ScrollbarThemeClient* scrollbar, const IntRect& trackRect)
{
if (DrawingRecorder::useCachedDrawingIfPossible(*context, *scrollbar, DisplayItem::ScrollbarTrackBackground))

Powered by Google App Engine
This is Rietveld 408576698