Last Comment Bug 780260 - ShadowLayers repaint their image every transaction
: ShadowLayers repaint their image every transaction
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Graphics: Layers (show other bugs)
: unspecified
: x86 Linux
: -- normal (vote)
: mozilla17
Assigned To: Matt Woodrow (:mattwoodrow)
:
Mentors:
Depends on:
Blocks: 780341
  Show dependency treegraph
 
Reported: 2012-08-03 13:08 PDT by Matt Woodrow (:mattwoodrow)
Modified: 2012-08-24 10:46 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Add a serial number to images to identify them (2.63 KB, patch)
2012-08-03 13:08 PDT, Matt Woodrow (:mattwoodrow)
cjones.bugs: review+
Details | Diff | Review
Add a serial number to images to identify them v2 (4.43 KB, patch)
2012-08-21 20:09 PDT, Matt Woodrow (:mattwoodrow)
cjones.bugs: review+
Details | Diff | Review

Description Matt Woodrow (:mattwoodrow) 2012-08-03 13:08:25 PDT
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 1 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-03 16:09:24 PDT
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 :).
Comment 2 Matt Woodrow (:mattwoodrow) 2012-08-03 17:39:28 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/6609595c84eb
Comment 3 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-03 18:13:34 PDT
This took us from 40fps -> 44fps on the gaia homescreen.
Comment 4 Andrew McCreight [:mccr8] 2012-08-03 20:12:55 PDT
It also appears to be leaking a single mutex in inbound.
Comment 5 :Benjamin Peterson 2012-08-03 20:34:08 PDT
Backed out: https://hg.mozilla.org/integration/mozilla-inbound/rev/fd329615ef3e
Comment 6 :Ms2ger 2012-08-04 00:50:55 PDT
I'm going to blame this for the "ASSERTION: reacquiring already acquired resource" assertions on linux64debug C/R too.
Comment 7 Matt Woodrow (:mattwoodrow) 2012-08-08 17:54:57 PDT
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.
Comment 8 Matt Woodrow (:mattwoodrow) 2012-08-21 20:09:04 PDT
Created attachment 654058 [details] [diff] [review]
Add a serial number to images to identify them v2

Now using PR_ATOMIC_INCREMENT instead.
Comment 9 Matt Woodrow (:mattwoodrow) 2012-08-21 20:09:34 PDT
https://tbpl.mozilla.org/?tree=Try&rev=903405a03c6e
Comment 10 Matt Woodrow (:mattwoodrow) 2012-08-22 17:09:00 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/d76195e9e2b8
Comment 11 Matt Woodrow (:mattwoodrow) 2012-08-22 19:03:28 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/7dab8a726f44

Note You need to log in before you can comment on or make changes to this bug.