Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(417)

Issue 2000423007: Expose SkPicture::numSlowPaths() in the public API.

Created:
4 years, 7 months ago by Stephen White
Modified:
4 years, 7 months ago
Reviewers:
bsalomon, f(malita), reed1
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Expose SkPicture::numSlowPaths() in the public API. BUG=614724 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2000423007

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -3 lines) Patch
M include/core/SkPicture.h View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M src/core/SkBigPicture.h View 1 2 chunks +1 line, -1 line 0 comments Download

Messages

Total messages: 19 (7 generated)
Stephen White
Brian: PTAL. Thanks! Feel free to bikeshed on the name, etc.
4 years, 7 months ago (2016-05-25 15:20:17 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2000423007/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2000423007/40001
4 years, 7 months ago (2016-05-25 15:27:04 UTC) #6
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-05-25 15:40:45 UTC) #8
commit-bot: I haz the power
Dry run: None
4 years, 7 months ago (2016-05-25 15:40:54 UTC) #9
Stephen White
Mike: PTAL. Thanks! Feel free to bikeshed on the public name, etc.
4 years, 7 months ago (2016-05-25 20:36:44 UTC) #11
reed1
What is the use-case for this externally, and how does it want to define "slow"? ...
4 years, 7 months ago (2016-05-25 20:40:35 UTC) #13
Stephen White
On 2016/05/25 20:40:35, reed1 wrote: > What is the use-case for this externally, and how ...
4 years, 7 months ago (2016-05-26 00:04:50 UTC) #14
f(malita)
On 2016/05/26 00:04:50, Stephen White wrote: > The question we're trying to answer is "why ...
4 years, 7 months ago (2016-05-26 12:36:00 UTC) #15
Stephen White
On 2016/05/26 12:36:00, f(malita) wrote: > On 2016/05/26 00:04:50, Stephen White wrote: > > > ...
4 years, 7 months ago (2016-05-26 15:11:21 UTC) #16
f(malita)
On 2016/05/26 15:11:21, Stephen White wrote: > On 2016/05/26 12:36:00, f(malita) wrote: > > On ...
4 years, 7 months ago (2016-05-26 15:55:59 UTC) #17
Stephen White
On 2016/05/26 15:55:59, f(malita) wrote: > On 2016/05/26 15:11:21, Stephen White wrote: > > On ...
4 years, 7 months ago (2016-05-26 16:11:35 UTC) #18
f(malita)
4 years, 7 months ago (2016-05-26 16:51:32 UTC) #19
On 2016/05/26 16:11:35, Stephen White wrote:
> On 2016/05/26 15:55:59, f(malita) wrote:
> > On 2016/05/26 15:11:21, Stephen White wrote:
> > > On 2016/05/26 12:36:00, f(malita) wrote:
> > > > On 2016/05/26 00:04:50, Stephen White wrote:
> > > > 
> > > > > The question we're trying to answer is "why did this page get
vetoed?".
> > > > 
> > > > The current feedback mechanism is the optional outparam in
> > > > SkPictureGpuAnalyzer::suitableForGpuRasterization(), but yeah - that
> doesn't
> > > > tell you the individual contribution to the veto.
> > > > 
> > > > 
> > > > > And given that more stuff is moving out of SkPicture and into display
> list
> > > > items
> > > > > (e.g.,
> > > > > ClipPathDisplayItem), we already have to replicate this logic a bit
for
> > the
> > > > > items which
> > > > > aren't in pictures. So it seemed like it would be clearer to move the
> guts
> > > of 
> > > > > SkPictureAnalyzer into cc, and implement a numSlowCommands() on
> > > > DisplayListItem.
> > > > > Then cc could just sum them all. That would also let us tweak the
> > parameters
> > > > for
> > > > > MSAA
> > > > > vs non-MSAA vetoes independently.
> > > > 
> > > > Assuming we can get numSlowPaths for SKP-backed display items
> > > > (DrawingDisplayItems), how do we get the equivalent metric for non-SKP
> based
> > > > items (say ClipPathDisplayItems)?
> > > 
> > > I was thinking we'd just move the logic into cc (ie., check if the clip
path
> > is
> > > concave 
> > > in ClipPathDisplayItem::numSlowCommands() (virtual)), Getting the veto
wrong
> > > either way 
> > > isn't a disaster, and Telemetry should tell us if we mess up.
> > 
> > SkPicture cannot access cc's logic, so we'll have to either duplicate the
> > internal PathCounter heuristics (ugh) or stop using SkPicture::numSlowPaths
-
> > no?
> 
> Sorry, I meant we should move the logic only for ClipPathDisplayItem (and
> anything else that doesn't have a picture). Regular display items would just 
> return picture.numSlowCommands() (that logic would remain in Skia). Would that

> work?

Ah, got you, I guess that would work with the current/trivial heuristic.

My only concerns would be about long-term maintenance (circling back to only
Skia knows what's slow, and maybe in the future the predicate would evolve into
something more complex than isConcave && AA), and the additional contract it
imposes on SP (we don't expect concave paths to show in SKPs).


> > SkPictureGpuAnalyzer is trying to solve the problem of veto-ing multiple
> > external fragments while keeping the cost heuristics inside Skia.  I think
we
> > can tweak the API arbitrarily to expose any semantics needed for Chrome:
> > 
> > * pass in more context - MSAA availability, actual GrContext to veto
against,
> > etc.
> > * expose cost metrics for debugging/tracing
> > * return a more sophisticated answer, not just veto bool:
> > USE_NATIVE/USE_MSAA/USE_SOFTWARE
> > * ?
> > 
> > It may also make sense to split the logic and the discussion between a) cost
> > heuristics/cost metrics computation and b) the actual veto heuristic
> (currently
> > numSlowPaths > 5).  I can't think of a good reason why the latter cannot
live
> in
> > Chrome - then maybe SkPictureGpuAnalyzer could evolve into a glorified cost
> > metrics accumulator and Chrome can look at the cost and decide what path to
> > take.
> 
> That would work too. So we'd call SkPictureAnalyzer for each of the pictures,
> and
> each of the clip paths (plus whatever else we think up), and it returns
> numSlowCommands() which we trigger off in cc. If we can keep and return a
count
> of num slow clip paths separately (something else I'd like for stats), that'd
be
> 
> gravy.

Yeah, we're sort of doing that already (feeding all SKPs to an analyzer, and if
crrev.com/2013723002 lands all clipPaths too).  I think exposing the actual
counters is reasonable - either for stats or for relocating the veto predicate
to Chrome - but we should run it by Mike/Brian and see what they think.

Powered by Google App Engine
This is Rietveld 408576698