Closed Bug 881609 Opened 7 years ago Closed 4 years ago
Platform::Init Layers Acceleration Prefs eagerly from gfx Platform::Init rather than lazily every time we check a pref
58 bytes, text/x-review-board-request
I'm not 100% sure we want to do this (could it affect startup time?), but given we will always check the layers prefs it seems like a win to only call the init method once rather than every time and returning every time but the first. I guess we should assert the prefs have actually been initialised in the methods, but that is debug only. (Note we already do this for sDrawLayerBorders).
You're right, it's safe, but suboptimal, especially if that function doesn't get inlined. I left it that way because it wasn't clear to me gfxPlatform::Init() will always get called before we call these pref getting functions from nsBaseWidget.cpp. I'm not saying it won't, just that I couldn't find the code that was making sure that happens.
4 years ago
Assignee: nobody → milan
Review commit: https://reviewboard.mozilla.org/r/36869/diff/#index_header See other reviews: https://reviewboard.mozilla.org/r/36869/
Attachment #8724110 - Flags: review?(ncameron)
The code has changed enough that we can satisfy "don't call it each time" as well as "what if Init doesn't get called". Or come close enough (two calls total, instead of one + per preference check)
Sorry it took me a while to get to this - I've been on vacation for the past three weeks.
Comment on attachment 8724110 [details] MozReview Request: Bug 881609: Call InitLayersAccelerationPrefs only once. r?nrc https://reviewboard.mozilla.org/r/36869/#review36313
Attachment #8724110 - Flags: review?(ncameron) → review+
You need to log in before you can comment on or make changes to this bug.