shadowBlur performance not inline with other browsers
Reported by
staley.d...@gmail.com,
May 20 2017
|
||||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Steps to reproduce the problem: 1. Open https://substantial-pilot.glitch.me/ 2. Wait for animation to finish. 3. Open console to view frame statistics. What is the expected behavior? The average time per frame should be about the same as Firefox or Safari. What went wrong? The average time per frame in Chrome is about 10x higher than the average time per frame in Safari and Firefox. Did this work before? N/A Does this work in other browsers? Yes Chrome version: 58.0.3029.110 Channel: stable OS Version: OS X 10.12.4 Flash Version:
,
May 23 2017
Able to reproduce the issue on windows 7 , Ubuntu 14.04 and Mac 10.12.4 using chrome version 58.0.3029.110 and canary 60.0.3106.0. Observed the Avg frame time is 15 to 18 on windows& Linux But seeing 20 to 25 on Mac. This issue is observed till M55. M54 and for M54 and prior versions the animation is not working. Marking it as Untriaged to get more inputs from dev team. Thanks,
,
May 23 2017
,
May 23 2017
When the canvas is GPU-accelerated, I am seeing a lot of CPU time spent in the renderer main thread, and a lot of texImage2D calls, which tells me that ganesh is probably rendering the shadow blurs on the CPU then uploading to the GPU. This could use an accelerated code path. Assigning to bsalomon for further triage.
,
May 23 2017
Passing the buck to the Skia gpu wrangler du jour, egdaniel@
,
May 23 2017
Ahem... he's a person, not a status. LOL.
,
May 23 2017
I was wondering why autocomplete wasn't working!
,
May 23 2017
So I'm trying to capture an SKP to investigate this, but I'm failing to be able to record the canvas2d draw commands. Anyone know how to get the canvas2d draws into an skp through chrome?
,
May 23 2017
There is no instrumentation for that because canvas content are not "painted" via blink regular paint phase. The GPU-accelerated implementation for 2D canvas does use SkPictures internally, but depending on the use case there can be multiple recordings/playbacks per animation frame. The SkPicture playback happens in Canvas2DLayerBridge::FlushRecordingOnly. That might be a good place to hack your local build to make it spit out an skp.
,
May 24 2017
So after some initial investigation, the issue is that from canvas we are drawing an arc with a sweep angle of 360. Skia does not current support drawing a sweep angle of >= 360, so in Path:AddEllipse, it breaks up the draw into two arcTo calls in skia 0-180 and 180-360. At this point Skia is not able to detect that the path it is drawing is a circle, so in the gpu backend we end up going down slow path drawing instead of fast circle draws/blurs. +caryclark@
,
May 24 2017
shadows in html canvas set SkBlurMaskFilter::kIgnoreTransform_BlurFlag; this causes Skia to give up on the GPU path and use the slower raster path. Changing ShadowAndForegroundDrawLooper() to kShadowRespectsTransforms and adding smarts to make the arc an oval draws correctly and draws as quickly as Safari. Next: why does canvas2d set kShadowIgnoresTransforms, and why does that cause Skia to give up on the GPU optimization.
,
May 24 2017
Re: #11: canvas sets that flag because that's canvas spec behaviour: shadow offset and radius are unaffected by CTM. I don't know why it's kicking us off the GPU path, though.
,
May 29 2017
,
May 30 2017
,
May 31 2017
The following revision refers to this bug: https://skia.googlesource.com/skia/+/aa28bfcc5aff5bac0a30c671db9301896d6849fe commit aa28bfcc5aff5bac0a30c671db9301896d6849fe Author: Greg Daniel <egdaniel@google.com> Date: Wed May 31 02:06:36 2017 Allow GPU blur fast path for circles and rects when using ignore xform Since the only thing it looks like we alter when using the ignore xform flag is the blur radius, this is already handled by the computeXformedSigma function call. Thus it should be safe to just use the current fps and draws for circle and rect. Bug: chromium:724735 Change-Id: I7a2f52dc965dcd875b8c2802141f30607a966347 Reviewed-on: https://skia-review.googlesource.com/18122 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> [modify] https://crrev.com/aa28bfcc5aff5bac0a30c671db9301896d6849fe/src/effects/SkBlurMaskFilter.cpp
,
Oct 5 2017
Is this work done?
,
Jul 25
,
Aug 2
|
||||||||||||
►
Sign in to add a comment |
||||||||||||
Comment 1 by staley.d...@gmail.com
, May 20 2017