Bug 1461203 - Use GetScrollbarMetrics() to access scrollbar metrics. r=jhorak, a=RyanVM
authorMartin Stransky <stransky@redhat.com>
Thu, 17 May 2018 14:40:21 +0200
changeset 473385 6e890ccae3ab700b89a64e3799eff1d45b6a413f
parent 473384 6b7ce6f146aba5250999edf11029ea63cfce4d57
child 473386 bbb2cb6e0d060048b665ebee80ce299d551087e0
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjhorak, RyanVM
bugs1461203
milestone61.0
Bug 1461203 - Use GetScrollbarMetrics() to access scrollbar metrics. r=jhorak, a=RyanVM MozReview-Commit-ID: 3gnFNfxQJZi
widget/gtk/gtk3drawing.cpp
--- a/widget/gtk/gtk3drawing.cpp
+++ b/widget/gtk/gtk3drawing.cpp
@@ -883,26 +883,24 @@ moz_gtk_scrollbar_button_paint(cairo_t *
       // box occupies the full width of the "contents" gadget content box.
       InsetByMargin(&rect, style);
     } else {
         // Scrollbar button has to be inset by trough_border because its DOM
         // element is filling width of vertical scrollbar's track (or height
         // in case of horizontal scrollbars).
         GtkOrientation orientation = flags & MOZ_GTK_STEPPER_VERTICAL ?
             GTK_ORIENTATION_VERTICAL : GTK_ORIENTATION_HORIZONTAL;
-        const auto& metrics = sScrollbarMetrics[orientation];
-        if (!metrics.initialized) {
-            NS_WARNING("Didn't measure before drawing?");
-        }
+
+        const ScrollbarGTKMetrics* metrics = GetScrollbarMetrics(orientation);
         if (flags & MOZ_GTK_STEPPER_VERTICAL) {
-            rect.x += metrics.border.track.left;
-            rect.width = metrics.size.thumb.width;
+            rect.x += metrics->border.track.left;
+            rect.width = metrics->size.thumb.width;
         } else {
-            rect.y += metrics.border.track.top;
-            rect.height = metrics.size.thumb.height;
+            rect.y += metrics->border.track.top;
+            rect.height = metrics->size.thumb.height;
         }
     }
 
     gtk_render_background(style, cr, rect.x, rect.y, rect.width, rect.height);
     gtk_render_frame(style, cr, rect.x, rect.y, rect.width, rect.height);
 
     arrow_rect.width = rect.width / 2;
     arrow_rect.height = rect.height / 2;