Closed
Bug 962517
Opened 11 years ago
Closed 11 years ago
add a way to create canvas without hardware acceleration (chrome only)
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 884226
People
(Reporter: gal, Assigned: gal)
References
Details
Attachments
(1 file, 1 obsolete file)
2.63 KB,
patch
|
Details | Diff | Splinter Review |
We use skiaGL on FFOS by default. As a result every 2d canvas we create is hardware accelerated. In some cases that doesn't pay off. For example, we snapshot an app during app switching. For this we create a canvas which forces the GL library to be loaded during a very GPU resource intensive animation moment (old app is fading out, new app is being drawn). Spinning up a GL canvas doesn't help here actually. We are repainting the content right now in software and then blit it onto the gralloc-backed canvas.
I propose a simple fix here to allow chrome to create a software-backed canvas. I want to do this instead of demote() to avoid loading the GL libraries, especially during the transition itself.
syntax: canvas.getContext("software-2d")
Again, this is chrome only and won't affect content. For content we probably should queue draw calls and then device whether using GL is worth it and do all of this on a separate thread to boot.
Assignee | ||
Comment 1•11 years ago
|
||
Assignee: nobody → gal
Assignee | ||
Comment 2•11 years ago
|
||
Attachment #8363581 -
Attachment is obsolete: true
Assignee | ||
Comment 3•11 years ago
|
||
This makes the app transition animation homescreen -> settings app butter smooth on my nexus 5. The problem here was really loading the GL drivers into the content process and/or creating the new GL canvas for the snapshot. That was locking the GPU somehow. This will likely also hurt on other GPUs and drivers.
Assignee | ||
Updated•11 years ago
|
Attachment #8363590 -
Flags: review?(bgirard)
Comment 4•11 years ago
|
||
Comment on attachment 8363590 [details] [diff] [review]
Allow chrome to create a software-only canvas.
Review of attachment 8363590 [details] [diff] [review]:
-----------------------------------------------------------------
bjacob is a better fit for Canvas reviews.
Attachment #8363590 -
Flags: review?(bgirard) → review?(bjacob)
Comment 5•11 years ago
|
||
According to hg log, I've only ever reviewed 3 patches touching that file, all specific to Skia/GL :-)
This piqued my curiosity though, as I had previously been wondering who would be a good reviewer for general Canvas2D change, so here are the 10 top reviewers for this file over the past year:
$ hg log -d -365 content/canvas/src/CanvasRenderingContext2D.cpp | grep ^summary | grep 'r=' | sed 's|.*r=||g' | sort |uniq -c | sort -rn | head -n10
21 roc
18 bz
15 mattwoodrow
10 smaug
6 Ms2ger
5 peterv
5 Bas
4 roc,bz
4 bz.
3 snorp
Given the contents of the present patch, adding a new canvas context ID, Roc would probably be the right reviewer.
That said, adding a new context ID is a really important basic change that needs agreeing on on the conceptual level before reviewing. Roc is again a person to be asked about that, but I would also suggest involving :jrmuizel in this conversation.
Updated•11 years ago
|
Attachment #8363590 -
Flags: review?(bjacob)
Comment 6•11 years ago
|
||
It seems like this just a dup of bug 884226
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
Comment 7•11 years ago
|
||
Yes, we're using this in particular to avoid creating SkiaGL canvas in the scenario where doing so would have us OOM, without much benefit if we don't, because we have to read back.
Comment 8•11 years ago
|
||
This has been uplifted to 1.2.
Assignee | ||
Comment 9•11 years ago
|
||
Can someone land the rest of the patch please that uses this for screenshots? Might be worth using this elsewhere too in Gaia. Milan please find the right help if your team can't do the changes.
Updated•11 years ago
|
Flags: needinfo?(milan)
Comment 10•11 years ago
|
||
Sure, I'll create a Gaia bug for this, so that we don't try and morph this into it.
Updated•11 years ago
|
Flags: needinfo?(milan)
You need to log in
before you can comment on or make changes to this bug.
Description
•