Canvas randomization is too slow
Categories
(Core :: Graphics: Canvas2D, enhancement)
Tracking
()
People
(Reporter: tjr, Assigned: fkilic)
References
Details
Attachments
(7 files, 7 obsolete files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
In Bug 1980261 we profiled some private canvas rendering examples that were causing bad performance due to randomization. It's been a long-standing problem that we calculate the canvaskey over the entire image data, causing us to read all the image data multiple times - we can make this more efficient moving it later in the pipeline. We should to implement it under a separate RFPTarget (call it 'Efficient' or something) so we can pull the escape cord if we misjudged things.
Comment 1•9 months ago
|
||
The severity field is not set for this bug.
:lsalzman, could you have a look please?
For more information, please visit BugBot documentation.
| Reporter | ||
Comment 2•9 months ago
|
||
We are targeting next cycle for this.
| Reporter | ||
Comment 3•8 months ago
|
||
The other place we return ImageExtraction::Randomize we have a
permission check - if you've granted the canvas permission
the result should not be randomized. It was missing in this
location though.
| Reporter | ||
Comment 4•8 months ago
|
||
ImageExtractionResult can be one of three values, soon to be four,
so do not call its result 'spoofing' as that's too specific.
| Reporter | ||
Comment 5•8 months ago
|
||
Image Encoders will be able to make use of a metadata
(aka randomization) key that will influence the resulting output
image.
This patch just adds that variable into all the API surfaces it
will need to be in to be accessible at the correct layer where
we will use it.
| Reporter | ||
Comment 6•8 months ago
|
||
In the RFPService we expose functions that let us get the
Randomization Key for a context, and then later to take that
key and mix it with the existing image data hash.
At the hottest paths for image randomization, switch from using
the old randomization to the new, more efficient version.
| Reporter | ||
Comment 7•8 months ago
|
||
As we read the resulting image, hash the bytes (eliminating the
need to read them twice), then modify the resulting image based
on the randomization key and the image hash.
| Reporter | ||
Comment 8•8 months ago
|
||
These weren't breaking things before, but they were incorrect and now they broke things.
| Reporter | ||
Comment 9•8 months ago
|
||
Updated•8 months ago
|
Updated•8 months ago
|
Updated•8 months ago
|
| Reporter | ||
Comment 10•8 months ago
|
||
The other place we return ImageExtraction::Randomize we have a
permission check - if you've granted the canvas permission
the result should not be randomized. It was missing in this
location though.
| Reporter | ||
Comment 11•8 months ago
|
||
ImageExtractionResult can be one of three values, soon to be four,
so do not call its result 'spoofing' as that's too specific.
| Reporter | ||
Comment 12•8 months ago
|
||
Image Encoders will be able to make use of a metadata
(aka randomization) key that will influence the resulting output
image.
This patch just adds that variable into all the API surfaces it
will need to be in to be accessible at the correct layer where
we will use it.
| Reporter | ||
Comment 13•8 months ago
|
||
In the RFPService we expose functions that let us get the
Randomization Key for a context, and then later to take that
key and mix it with the existing image data hash.
At the hottest paths for image randomization, switch from using
the old randomization to the new, more efficient version.
| Reporter | ||
Comment 14•8 months ago
|
||
As we read the resulting image, hash the bytes (eliminating the
need to read them twice), then modify the resulting image based
on the randomization key and the image hash.
| Reporter | ||
Comment 15•8 months ago
|
||
These weren't breaking things before, but they were incorrect and now they broke things.
| Reporter | ||
Comment 16•8 months ago
|
||
Comment 17•8 months ago
|
||
Comment on attachment 9517827 [details]
Bug 1980264: Clang Formatting and a missing Permission Check r?timhuang
Revision D265364 was moved to bug 1980261. Setting attachment 9517827 [details] to obsolete.
Comment 18•8 months ago
|
||
Comment on attachment 9517828 [details]
Bug 1980264: Rename a variable to be more generic r?timhuang
Revision D265365 was moved to bug 1980261. Setting attachment 9517828 [details] to obsolete.
Comment 19•8 months ago
|
||
Comment on attachment 9517829 [details]
Bug 1980264: Plumb metatadata down to the Image Encoders
Revision D265366 was moved to bug 1980261. Setting attachment 9517829 [details] to obsolete.
Comment 20•8 months ago
|
||
Comment on attachment 9517830 [details]
Bug 1980264: Wire up an alternate efficient randomization layer
Revision D265367 was moved to bug 1980261. Setting attachment 9517830 [details] to obsolete.
Comment 21•8 months ago
|
||
Comment on attachment 9517831 [details]
Bug 1980264: Implement a streaming randomization approach for PNG images
Revision D265368 was moved to bug 1980261. Setting attachment 9517831 [details] to obsolete.
Comment 22•8 months ago
|
||
Comment on attachment 9517832 [details]
Bug 1980264: Test Infra Fixes r?timhuang
Revision D267088 was moved to bug 1980261. Setting attachment 9517832 [details] to obsolete.
Comment 23•8 months ago
|
||
Comment on attachment 9517833 [details]
Bug 1980264: Add a test r?timhuang
Revision D267271 was moved to bug 1980261. Setting attachment 9517833 [details] to obsolete.
| Reporter | ||
Comment 24•7 months ago
|
||
Going to try and stick this - there were intermittent failures in try; but all of them worked on at least one run, and were completely unrelated tests so I think they're unrelated.
Comment 25•7 months ago
|
||
Comment 26•7 months ago
|
||
Comment 27•7 months ago
|
||
Backed out for causing xpcshell failures on test_encoder_png.js
Comment 28•7 months ago
|
||
Comment 29•7 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/22bb89149d6e
https://hg.mozilla.org/mozilla-central/rev/fbe5677a6f5e
https://hg.mozilla.org/mozilla-central/rev/895a17d730c5
https://hg.mozilla.org/mozilla-central/rev/ab828196a118
https://hg.mozilla.org/mozilla-central/rev/f11416295204
https://hg.mozilla.org/mozilla-central/rev/23a4f669a204
https://hg.mozilla.org/mozilla-central/rev/321202a9c030
Updated•7 months ago
|
| Assignee | ||
Updated•5 months ago
|
Description
•