Closed Bug 881609 Opened 7 years ago Closed 4 years ago

Call gfxPlatform::InitLayersAccelerationPrefs eagerly from gfxPlatform::Init rather than lazily every time we check a pref

Categories

(Core :: Graphics, defect)

21 Branch
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla48
Tracking Status
firefox48 --- fixed

People

(Reporter: nrc, Assigned: milan)

Details

Attachments

(1 file)

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.
Assignee: nobody → milan
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+
https://hg.mozilla.org/mozilla-central/rev/2ba62e2e02b0
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in before you can comment on or make changes to this bug.