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

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

Issue 2421573002: Caches the scrollbar's thickness for the given theme and control size (Closed)
Patch Set: CL for src perf tryjob to run blink_perf.layout benchmark on all-mac platform(s) Created 4 years, 2 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
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/Scrollbar.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/scroll/Scrollbar.cpp
diff --git a/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp b/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp
index 84b5b4099679a7c7426243db0c27b62b94999579..253a1925ce53be4a27a18a31f9f621c7897d52a3 100644
--- a/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp
+++ b/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp
@@ -69,6 +69,7 @@ Scrollbar::Scrollbar(ScrollableArea* scrollableArea,
// scrollbars (rather than leaving one dimension of the scrollbar alone when
// sizing).
int thickness = m_theme.scrollbarThickness(controlSize);
+ m_themeScrollbarThickness = thickness;
oshima 2016/10/14 23:17:30 don't you have to cache for each controlSize?
malaykeshav 2016/10/14 23:18:54 For a given scrollbar instance the ControlSize doe
if (m_hostWindow)
thickness = m_hostWindow->windowToViewportScalar(thickness);
Widget::setFrameRect(IntRect(0, 0, thickness, thickness));
@@ -526,8 +527,7 @@ int Scrollbar::scrollbarThickness() const {
int thickness = orientation() == HorizontalScrollbar ? height() : width();
if (!thickness || !m_hostWindow)
return thickness;
- return m_hostWindow->windowToViewportScalar(
- m_theme.scrollbarThickness(controlSize()));
+ return m_hostWindow->windowToViewportScalar(m_themeScrollbarThickness);
}
bool Scrollbar::isOverlayScrollbar() const {
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/Scrollbar.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698