Shadows Part Deux

43 views
Skip to first unread message

Corey Lucier

unread,
May 15, 2015, 3:52:35 PM5/15/15
to skia-d...@googlegroups.com
So running into a bit of a performance puzzle with SkDropShadowImageFilter.

See attached image.  We're seeing very slow render times when zoomed in very far (400+%) to our skia surface. As you can tell we're using a tiled (raster) renderer. So each tile clips to it's bounds and renders the rectangle in this case using SkDropShadowImageFilter, and then another pass for the foreground.  

Basic approach per (256x256) tile is :

    Transform viewport to account for zoom
    Clip to tile bounds
    Attach drop shadow filter to Paint
    canvas->saveLayer(nullptr, Paint);
    Draw Rectangle
    canvas->restore()
    Draw Rectangle

Any suggestions on how to make the blur filter faster, or at least this scenario faster?

NOTE: The reason we use a layer here is because we can be drawing any number of things (hierarchy of paths, shapes, etc. with their strokes and fills), not just a single rectangle.

99.9% profiler time is being spent in SkBoxBlur_SSE4.

We can't really cache the shadow per say between frames in this scenario because in this case the user is resizing/morphing the rectangle interactively, so of course the shadow needs to be recomputed.






bb.png
Reply all
Reply to author
Forward
0 new messages