Go to file
Mike Klein d1d4cbf2e4 begin caching Programs in SkVMBlitter
My first drafts put caching inside SkVM.cpp, which I rejected for
feeling a little too magic, and then in SkVMBuilder.cpp using a
fingerprint of the skvm::Builder to skip Builder::done().

This version makes an explicit Key structure holding all the parameters
that currently matter to the Blitter, and caches using that.  This is
nice because it can be done much more cheaply than running the JIT, and
much more cheaply even than running the Builder.  It also makes the
parameterization of the Blitter explicit, which I like.

This does sometimes create programs that are equivalent but have
different keys, but that's not that common, and it's pretty harmless.
E.g. today if the device colorType() is opaque or premul, we'll think
those are different programs, but actually end up making the exact
same calls to Builder.  No big deal, and maybe even gives us a
suggestion to do something when the destination is opaque to skip work.
I've left that as a TODO followup.

We really only need a small cache to get a good hit rate.  Running all
GMs in one process serially, we're now down to 22 calls to done() from
>100K at head (and >500K yesterday).  (Would be 13 if we treated opaque
and premul the same.)

There are two places I'd like to have used tryAcquire() on an SkSpinlock
but the thread safety static analysis is wrong and prevents me.  Left
some TODOs.

Change-Id: I83a365fc895720c76b56b0e5a78f4c673fcd9d64
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232817
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-08-06 21:05:41 +00:00
animations first cut at a checkbox 2009-10-21 19:41:10 +00:00
bench specialize drawAtlas for raster backend 2019-08-05 21:01:47 +00:00
bin Add bin/try-clients to trigger client tryjobs 2019-06-11 16:55:53 +00:00
build_overrides Update to Dawn ToT. 2019-07-22 16:20:36 +00:00
dm Add GrProtected parameter to all createBackendTexture variants 2019-07-01 19:46:18 +00:00
docker fix Dockerfile? 2019-06-24 16:34:59 +00:00
docs/examples Update docs and samplecode to use new image filter factories 2019-08-02 14:47:35 +00:00
example ModifierKey unifies sk_app::Window::ModifierKey & Sample::Click::ModifierKey 2019-07-09 16:16:41 +00:00
experimental experimental/editor: interface no longer uses stringslice 2019-08-06 16:52:08 +00:00
fuzz Move SkImageFilter functionality into private SkImageFilter_Base 2019-08-02 18:56:39 +00:00
gm Fix GMs broken during API porting 2019-08-05 14:53:45 +00:00
gn Add a GrTextureResolveManager class 2019-08-06 20:47:31 +00:00
include Pass size and GrPixelConfig to GrSurface/Texture/RenderTarget constructors 2019-08-05 19:08:07 +00:00
infra Roll recipe dependencies (trivial). 2019-08-06 19:31:07 +00:00
modules Allow compilation without embedded font but with font manager 2019-08-06 19:53:30 +00:00
platform_tools SkQP: Refactor Java method SkQP.runTests() 2019-07-24 13:54:15 +00:00
resources [skottie] Initial Hue/Saturate effect support 2019-08-02 18:04:14 +00:00
samplecode Move SkImageFilter functionality into private SkImageFilter_Base 2019-08-02 18:56:39 +00:00
site documentation/build, BUILDCONFIG: Visual Studio Build Tools 2019 2019-07-12 14:17:16 +00:00
specs [img-decode] Start on proposed new spec 2019-05-06 17:39:19 +00:00
src begin caching Programs in SkVMBlitter 2019-08-06 21:05:41 +00:00
tests Add a GrTextureResolveManager class 2019-08-06 20:47:31 +00:00
third_party Roll third_party/externals/angle2 1ebe6014389e..1dbbc7b3e232 (5 commits) 2019-08-02 01:12:49 +00:00
tools SkQP: modify make_universal_apk to work in AOSP branch 2019-08-06 18:17:38 +00:00
.clang-format restore .clang-format 2019-03-21 15:52:32 +00:00
.clang-tidy add google-build-namespaces to clang-tidy checks 2018-12-12 16:33:59 +00:00
.gitignore clean up some .gitignores 2019-05-15 19:55:45 +00:00
.gn Basic standalone GN configs. 2016-07-21 12:25:45 -07:00
AUTHORS Fix Metal includes breaking macOS local builds 2019-07-08 14:02:47 +00:00
BUILD.gn Dawn: implement sk_app window contexts for all backends. 2019-08-02 19:51:02 +00:00
codereview.settings Make uploading to Gerrit the default for Skia 2016-11-09 19:07:56 +00:00
CONTRIBUTING Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
CQ_COMMITTERS Moved committer list to chrome-infra-auth and deleted it from the repo 2015-09-02 13:37:54 -07:00
DEPS Roll third_party/externals/angle2 dc2c5c5a419e..bf176a0d6db9 (10 commits) 2019-08-06 05:22:30 +00:00
go.mod Update Go deps 2019-08-06 05:25:40 +00:00
go.sum Update Go deps 2019-08-06 05:25:40 +00:00
LICENSE BUG=skia:5602 2016-09-02 11:19:34 -07:00
OWNERS add OWNERS file 2017-12-01 19:50:19 +00:00
PRESUBMIT.py rewrite_includes.py: make it work on windows 2019-08-05 16:14:35 +00:00
public.bzl First draft of Dawn backend: clears are working. 2019-07-18 18:09:12 +00:00
README Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
README.chromium Update README.chromium. 2015-06-11 13:19:24 -07:00
RELEASE_NOTES.txt Move SkImageFilter functionality into private SkImageFilter_Base 2019-08-02 18:56:39 +00:00
whitespace.txt Whitespace test 2019-05-18 13:05:29 +00:00

Skia is a complete 2D graphic library for drawing Text, Geometries, and Images.

See full details, and build instructions, at https://skia.org.