Custom Skia Build For Chrome Web App

38 views
Skip to first unread message

Joe Eagar

unread,
Jul 26, 2017, 11:40:54 PM7/26/17
to skia-discuss
Hi.  I have a vector graphics app I'm developing as a Chrome web app.  Right now it uses Skia indirectly (through either Canvas2D or SVG), but I'm a little worried about being dependent on Chrome here (lately it seems my app uses a lot more graphics memory than it did before).

I'd like to use Skia directly, presumably via a Native Client build.  Has anyone ever done this before?  Does it work on mobile devices?

Thanks,
Joe

Shawn Riordan

unread,
Jul 27, 2017, 1:59:35 AM7/27/17
to skia-discuss
How do you use Skia indirectly through Canvas2D?
Do you mean you just use Canvas2D and assume that, on Chrome, it is using Skia?

Mike Klein

unread,
Jul 27, 2017, 8:20:44 AM7/27/17
to skia-discuss
I don't know of anyone using Skia built for Native Client.  There was a time when Native Client builds were part of our continuous integration, but I don't recall anyone ever actually seeing if they ran.  I certainly don't think it'd be any faster than the version of Skia you find in Chrome, and likely much slower due to a lack of CPU-specific optimizations and access to the GPU backend.

Last I heard Native Client in Chrome is deprecated and slated for removal in a few months: https://developer.chrome.com/native-client/migration.  You might want to keep that in mind as you look into investing in Native Client.  I suspect the same speed caveats apply to any replacement like WebAssembly.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To post to this group, send email to skia-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.

Joe Eagar

unread,
Jul 27, 2017, 8:40:11 PM7/27/17
to skia-discuss
@Shawn Yes, I'm assuming Chrome uses Skia for Canvas2D.  Remember that this is a Chrome web app, not a HTML5 site.

@Mike I just don't want to have to worry about my app suddenly using impossible amounts of GPU RAM after a Chrome update.Any

Thanks
Joe

Joe Eagar

unread,
Jul 27, 2017, 8:45:48 PM7/27/17
to skia-discuss
Here's a screenshot of my app.  The shading effects are done via blur.  At this point, my primary concern is limiting GPU ram usage.



Cary Clark

unread,
Jul 28, 2017, 8:45:49 AM7/28/17
to skia-d...@googlegroups.com
I defer to the GPU team, but I would imagine that gradients would use fewer resources than blur. Also, convex paths are cheaper than convex ones, although for the scene in your example, it makes sense to use the primitive that best fits what you're trying to draw.

On Thu, Jul 27, 2017 at 8:45 PM, Joe Eagar <joe...@gmail.com> wrote:
Here's a screenshot of my app.  The shading effects are done via blur.  At this point, my primary concern is limiting GPU ram usage.



--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss+unsubscribe@googlegroups.com.

Joe Eagar

unread,
Aug 2, 2017, 6:17:19 PM8/2/17
to skia-d...@googlegroups.com
Convex paths are better than *concave*?

Cary Clark

unread,
Aug 2, 2017, 6:20:26 PM8/2/17
to skia-d...@googlegroups.com
Nice catch. Typed a bit too fast on that one. Thanks
Reply all
Reply to author
Forward
0 new messages