Created attachment 648817 [details] [diff] [review] Add a serial number to images to identify them This is causing significant slow downs when panning around the homescreen on b2g. Attached patch adds serial numbers to Images and skips repainting the image if it hasn't changed.
Comment on attachment 648817 [details] [diff] [review] Add a serial number to images to identify them I would feel more comfortable with this if you used uint64_t. r=me with that. Nice patch :).
This took us from 40fps -> 44fps on the gaia homescreen.
It also appears to be leaking a single mutex in inbound.
I'm going to blame this for the "ASSERTION: reacquiring already acquired resource" assertions on linux64debug C/R too.
So, I guess we can't have a global Mutex object here :( Attempting to allocate one the first time we create an image seems like it would have the exact same race condition problems that we will be using it to avoid. Though it occurs to me that we'd never use images allocated on different threads with the same ImageLayer, so maybe we can remove the Mutex entirely and not worry about potential races.
Created attachment 654058 [details] [diff] [review] Add a serial number to images to identify them v2 Now using PR_ATOMIC_INCREMENT instead.