Closed Bug 1401063 Opened 2 years ago Closed 2 years ago

gtk nsLookAndFeel::NativeGetColor should cache colors to avoid on-demand gtk_ calls

Categories

(Core :: CSS Parsing and Computation, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: bradwerth, Assigned: bradwerth)

References

Details

(Keywords: perf)

Attachments

(1 file)

For some colors, the gtk implementation of nsLookAndFeel::NativeGetColor requests a GtkStyleContext and makes individual calls to retrieve colors. One example is http://searchfox.org/mozilla-central/rev/05c4c3bc0cfb9b0fc66bdfc8c47cac674e45f151/widget/gtk/nsLookAndFeel.cpp#303

Instead, those colors should be retrieved in ::EnsureInit() and cached. This will reduce synchronization into the single-threaded gtk library, useful for Stylo.
Keywords: perf
Priority: -- → P3
Attachment #8909962 - Flags: review?(karlt)
Comment on attachment 8909962 [details]
Bug 1401063: Cache remaining gtk window and button colors to eliminate on-demand gtk calls in ::NativeGetColor.

https://reviewboard.mozilla.org/r/181444/#review187008

Thank you!
Attachment #8909962 - Flags: review?(karlt) → review+
Pushed by bwerth@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cd4bfa0b73b3
Cache remaining gtk window and button colors to eliminate on-demand gtk calls in ::NativeGetColor. r=karlt
https://hg.mozilla.org/mozilla-central/rev/cd4bfa0b73b3
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.