If an image is slow to decode (e.g. very large), it will call SourceSurfaceSharedData::Invalidate many times while it is already being displayed by WebRender. As implemented today, this causes us to regenerate the ImageKey key and reupload the entire texture, when only a few rows may have changed. Instead we should: 1) Use UpdateExternalImage when we need to invalidate instead of deleting the ImageKey and calling AddExternalImage again. While UpdateExternalImage exists in the compositor process, this needs to be exposed via IpcResourceUpdateQueue. 2) Add expose a dirty rect parameter for UpdateExternalImage. Imagelib already knows at the time it calls SourceSurfaceSharedData::Invalidate the region of the image which invalidated. This will allow WebRender to only reupload the rows that changed.
Assignee: nobody → aosmond
Status: NEW → ASSIGNED
Still a work in progress, as I am hitting the "BUG: handle not requested earlier in frame" panic after switching to UpdateExternalImage. I also suspect progressive images may have some trouble with how I tried to avoid reuploading the entire image again when decoding has completed (mDecoded == mFrameRect, but we may still need to post an invalid rect for the rewritten rows in imgFrame::Finish...).
Priority: -- → P1
This doesn't sound like a user-facing bug. At best it's going to be a perf improvement; dropping to P2.
Priority: P1 → P2
(In reply to Kartikaya Gupta (email:email@example.com) from comment #3) > This doesn't sound like a user-facing bug. At best it's going to be a perf > improvement; dropping to P2. Yes, there is no correctness aspect to this, just performance.
Attachment #8991013 - Flags: review?(nical.bugzilla) → review+
Attachment #8991014 - Flags: review?(nical.bugzilla) → review+
Looks like I have a few failures to fix: try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=4c4e88af19efcbbd5448f922fbe06fe5687ac41b&selectedJob=187815192
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/6ac886d5a6ad Part 1. Expose WebRender plumbing for partial updates for external images. r=nical https://hg.mozilla.org/integration/mozilla-inbound/rev/b91599130fba Part 2. Make shared surfaces use external image update mechanism. r=nical
You need to log in before you can comment on or make changes to this bug.