Commit Graph

3976 Commits

Author SHA1 Message Date
Greg Daniel
b9990e4492 Add more general flush call to GrContext.
This is to match the current features of SkSurface::flush and to prepare
for adding additional features to flush.

Bug: skia:8802
Change-Id: I5d68272e1277b416af357e6ffaf426841ceda943
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207301
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-04-10 21:19:10 +00:00
Brian Osman
ca9465688f Make Skottie's GN setup more DLL friendly
Skottie doesn't currently build with is_component_build=true. Trying to
build a DLL with skia_enable_skottie=false failed, because we ended up
with a component("skottie") that had no sources. That led to fallback
linker behavior, but no DllMain.

To solve this, and simplify things, move the skia_enable_skottie checks
to the outer scope, and simply replace all the referenced components
with empty groups when it's not enabled. Also fix some fm code that was
assuming it was always enabled.

Change-Id: I4a47d80d882e6c557ee14b34255e22e09292cc8c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207302
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-04-10 18:35:25 +00:00
Mike Klein
9816878163 extract ToolUtils::colortype_depth()
Change-Id: I55a3956ed6d0587f72ddff24a1769ab14e25131f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206981
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-04-09 20:32:15 +00:00
Mike Klein
a833cff194 some refactoring ideas
- streamline source initialization so that each
    kind of source only has to mention what's interesting
    to it, with defaults for some obvious fields.

  - have sources return a Result rather than a bool,
    encapsulating Ok/Skip/Fail and any failure message,
    but grab this in a middle draw() layer so each backend
    doesn't have to care about anything but Ok/Skip.

Change-Id: I715278ba5e05892e42c8875bd607160b0cc594b5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206763
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-04-09 17:54:36 +00:00
Mike Klein
7b8bc53b93 --parameters -> --properties
This was a brain fart when I wrote it the first time;
the expected flag name is --properties.

    ~/skia (refactoring↑1|…) $ git grep DEFINE_string\(properties
    bench/nanobench.cpp:static DEFINE_string(properties, "",
    dm/DM.cpp:static DEFINE_string(properties, "",
    tools/fm/fm.cpp:static DEFINE_string(properties, "",

Change-Id: I9ada23e26a748bd6bc85ae5682bd03c130edc054
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206941
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-04-09 17:08:13 +00:00
Brian Osman
5aa11fb67a Shader serialization experiment (with Mali Offline Compiler analysis)
1) Adds a --writeShaders option to fm. When that's included, the GPU
backend is run with a persistent cache (and no binary caching).
Then we dump all of the fragment shaders (GLSL for now) that were
created to the passed-in directory, along with a JSON digest listing
the number of times each one was referenced in the cache.

2) Adds a python script that invokes the Mali Offline Compiler on a
directory generated from #1, scraping the output of each compile for
cycle counts and writing the collated information to stdout.

Change-Id: Ie4b58ddac4f62e936707c6fec44f4fe605c213fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206162
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-04-09 13:37:55 +00:00
Mike Reed
50acf8f04b add makeShader() to SkBitmap, and deprecate SkShader version
Bug: skia:8937
Change-Id: I42f011e04937a751222bd8ecc6c69b45cf9626a2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206681
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-04-08 17:56:34 +00:00
Mike Klein
befc7cf165 fm_bot: look for and explain too-late flags
Change-Id: I9746fb5215d449b030ecfde6051fa6a69d2e7556
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206580
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
2019-04-08 15:55:10 +00:00
Mike Klein
ccdd6a14ac fix -script parsing
The ':' introduced a new scope, and we would always wait on the outside
`file`, stdin.

Change-Id: I5176a80abd40650a0167150ff5e996613ecc93e7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206581
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-04-08 13:31:12 +00:00
Hal Canary
d61446666e Examples: compile faster
17m42.185s --> 0m10.665s

Change-Id: I2de9ddf9860f680e64e7c333e2e90755b050cf91
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204541
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-04-04 15:43:59 +00:00
Chris Dalton
a8fbeba6cb Add a cap to allow coverage counting or not
We don't want to just disable the "ccpr" path renderer anymore (or
whatever it should be called), because we are adding an MSAA
implementation. This new cap will eventually tell ccpr whether it can
use coverage counting, or if it should just use the MSAA impl.

Bug: skia:
Change-Id: Ie6e5ca1a637ca4408bc6bb844153afa9da26f58e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204883
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-04-03 19:39:24 +00:00
Mike Klein
22a5e345c9 set PNG compression level back to 1
On my machine, this cuts the CPU time to run all GMs and write out
PNGs by about half, from ~67s to ~34s (wall, 4s -> 3s).  File size
goes from 148M to 180M, about a 22% increase.

Change-Id: I50f051e5c87cc6854797d6838e0342cbd7e95003
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204130
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
2019-04-03 19:39:05 +00:00
Brian Osman
f71b070ffd Fix the GLSL persistent cache (and add a config to test it)
We need to store (up to) three GLSL strings in the cache entry,
along with the bookkeeping to reconstruct them. To make things
simpler, we now store the null terminators.

Change-Id: Ic4fe03cb5d774464372ceec8740da1bfe9069550
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205823
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-04-03 18:05:22 +00:00
Hal Canary
0f2f522246 SkMD5 returns digest
Change-Id: I9eb9095131adb5862d286b211501bf194ef8e91e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205822
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-04-03 17:52:22 +00:00
Mike Klein
d0389c596d split cpu+gpu work queues
Split work queues for CPU and GPU, assigning using a --backend
whitelist.  This lets us up the CPU process limit to NumCPUs,
while keeping the GPU process limit at 8.

On my desktop this speeds up this mixed workload about 2x:

cat <<EOF | go run tools/fm/fm_bot.go -quiet -script - out/fm
    b=cpu gms ct=8888 w=$WHERE/8888 legacy=true  # old and busted
    b=cpu gms ct=8888 w=$WHERE/srgb              # new hotness
    b=gl  gms ct=8888 w=$WHERE/gl
    b=mtl gms ct=8888 w=$WHERE/mtl
    b=cpu gms ct=565  w=$WHERE/565
    b=cpu gms ct=f16  w=$WHERE/f16
    b=skp gms         w=$WHERE/skp
EOF

Before:        44.37 real       303.87 user        15.40 sys
After:         21.87 real       480.05 user        27.10 sys

Change-Id: Ibea4537c8cdf278f8e4621f26ebacd942952eec3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205833
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-04-03 17:12:33 +00:00
Brian Osman
fbe2406693 Reland "Remove the NullGL interface (and associated test context)"
This reverts commit 215da624d1.

Reason for revert: Blink issues ironed out.

Original change's description:
> Revert "Remove the NullGL interface (and associated test context)"
> 
> This reverts commit de206c75c2.
> 
> Reason for revert: Chrome is having issues with the switch to Mock in blink tests.
> 
> Original change's description:
> > Remove the NullGL interface (and associated test context)
> > 
> > Bug: skia:
> > Change-Id: Ie3c9ee39fc1e0a4406de085c60d8433ffb4419df
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203708
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Brian Osman <brianosman@google.com>
> 
> TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com
> 
> Change-Id: Iff0cbf29dcea26957efc800a8c33d0ad8285de0a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205343
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: skia:
Change-Id: I1f4fbbcb00f302c5d830cb1392badd6ec7a33c69
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205832
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-04-03 16:38:10 +00:00
Mike Klein
1450a47409 support comments
E.g.

    cat <<EOF | go run tools/fm/fm_bot.go -processLimit 0 -quiet -script - out/fm
        b=cpu gms ct=8888 w=$WHERE/8888 legacy=true  # old and busted
        b=cpu gms ct=8888 w=$WHERE/srgb              # new hotness
    EOF

Change-Id: Ia92ba113ae95478313e1f2cc18b7270ea1aa8a42
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205831
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-04-03 16:00:00 +00:00
Mike Klein
4daf637187 add --legacy to fm, legacy=true to fm_bot
E.g.

    ~/skia (make-from-memory↑2|●1…) $ cat test.sh
    #!/bin/bash

    set -e
    set -x

    WHERE=${1:-foo}

    ninja -C out fm

    rm -rf $WHERE
    mkdir -p $WHERE

    cat <<EOF | go run tools/fm/fm_bot.go -processLimit 0 -quiet -script - out/fm
        b=cpu gms ct=8888 w=$WHERE/8888 legacy=true
        b=cpu gms ct=8888 w=$WHERE/srgb
        b=cpu gms ct=565  w=$WHERE/565
        b=cpu gms ct=f16  w=$WHERE/f16
    EOF

    ~/skia (make-from-memory↑2|●1…) $ time ./test.sh
    + WHERE=foo
    + ninja -C out fm
    ninja: Entering directory `out'
    ninja: no work to do.
    + rm -rf foo
    + mkdir -p foo
    + cat
    + go run tools/fm/fm_bot.go -processLimit 0 -quiet -script - out/fm
           11.81 real       318.92 user        14.51 sys

    ~/skia (make-from-memory↑2|●1…) $ idiff foo/8888/ foo/srgb/
    671 files are identical.
    25 diffs written to diff.html

Change-Id: I01fe1ceeada971d8d18efc11961b9f753624fcf2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205830
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-04-03 15:52:40 +00:00
Mike Klein
1b56cdbd9b -script - for stdin
These do the same thing:

 $ go run tools/fm_bot.go out/fm b=cpu gms
 $ echo "b=cpu gms" | go run tools/fm/fm_bot.go -s - out/fm

~/skia (make-from-memory↑2|…) $ cat test.sh

set -e
set -x

mkdir -p foo
cat <<EOF | go run tools/fm/fm_bot.go -j 0 -q -s - out/fm
    b=cpu ct=8888 gms w=foo/8888
    b=cpu ct=565  gms w=foo/565
    b=cpu ct=f16  gms w=foo/f16
EOF
~/skia (make-from-memory↑2|…) $ time ./test.sh
+ mkdir -p foo
+ cat
+ go run tools/fm/fm_bot.go -j 0 -q -s - out/fm
        9.47 real       234.71 user         9.12 sys

Change-Id: If0e8de2772f12de4257671d24f70662c423581c3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205826
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
2019-04-03 15:34:00 +00:00
Mike Reed
fae8fceb4a Use SkTileMode instead of nested enum
Add guard to transition clients

Change-Id: Ia7a3e8f95722f91e84af262168dadf89a78707da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205720
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-03 15:24:18 +00:00
Mike Klein
408c3eaada don't have fm_bot send fm empty sources to run
Running fm_bot at head I'm confronted with a puzzling error:

    2019/04/03 10:26:01
    out/fm -b cpu -w foo -s big_rrect_rect_aa_effect filterbitmap_image_mandrill_512.png                    #failed (exit status 1):
    Don't understand --source ... bailing out.

    2019/04/03 10:26:05 1 invocations of out/fm failed

And of course running that command works fine.  Puzzling!

To fix this, we must take care not to subslice sources past its end,
which fills with defaults, a bunch of extra "" sources.  And add some ''
around the unknown source to make the error message easier to parse.

Serves me right for not testing this before I landed that tweak...

Change-Id: I5c2abb35733b32a1142b0f42c4323112969ad2bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205825
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
2019-04-03 15:15:04 +00:00
Mike Klein
176da0bb8a tiny tweak: no need to reload lottie files
Change-Id: I759637016becb5e257c21134224ad44129c28ab0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205760
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-04-03 13:29:01 +00:00
Mike Klein
cbe93ee197 have FM run GMs in command line order
Compare running

   $ out/fm -b gl -s encode skps/desk_wikipedia.skp drawbitmaprect lotties/inattentive.json xfermodeimagefilter encode encode encode

Before:
           xfermodeimagefilter	92218904a9ae8a0a6d3eee03541b632a	    240ms
                        encode	d2d6eb57feb83662a84dc728dbd4649d	     99ms
                drawbitmaprect	d915acc291ecd0e7bbbd8b497d44cd1e	     88ms
            desk_wikipedia.skp	2bd4560dfba002395b7d5665d37a5d83	     80ms
              inattentive.json	63dfb23e06ee2557bb441523003fb4eb	     43ms

After:
                        encode	d2d6eb57feb83662a84dc728dbd4649d	    116ms
            desk_wikipedia.skp	2bd4560dfba002395b7d5665d37a5d83	     80ms
                drawbitmaprect	d915acc291ecd0e7bbbd8b497d44cd1e	     93ms
              inattentive.json	63dfb23e06ee2557bb441523003fb4eb	     42ms
           xfermodeimagefilter	92218904a9ae8a0a6d3eee03541b632a	    214ms
                        encode	d2d6eb57feb83662a84dc728dbd4649d	     90ms
                        encode	d2d6eb57feb83662a84dc728dbd4649d	     89ms
                        encode	d2d6eb57feb83662a84dc728dbd4649d	     89ms

Change-Id: I448da4c991b91a8f3e4fc0cf32af0a4ff712e19e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205591
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-04-03 13:01:08 +00:00
Mike Klein
832d3c5007 update some FM flags
fm itself can always be verbose.  We'll rarely call it directly
and when we do and we don't want to see its output, we can always
pipe to /dev/null.

Switch fm_bot.go over to random shuffle by default, and to verbose by
default with a -q/-quiet flag to only print failures.

Change-Id: Ibd53bf7f1d29e0fd5deb7d4689dc0ca100df648f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205587
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-04-02 20:09:44 +00:00
Mike Klein
2292426cb1 add skottie support to fm
Draws the same as DM.

Change-Id: I741655786c3345dfd824438f9dcaca0d5046b197
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205493
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-04-02 19:14:44 +00:00
Mike Klein
a5c27173ea allow skipped source/backend pairs in fm
GMs sometimes want to skip instead of drawing or failing.
E.g. GPU-only GMs with a non-GPU backend.

Change-Id: I5bd8acecbef1aa88b4d7e6cfb88dfde04424aa8b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205349
Reviewed-by: Mike Klein <mtklein@google.com>
2019-04-02 19:08:44 +00:00
Mike Klein
f2d9b865d7 Add basic fm_bot script
This handles batching and things like figuring out "skps" means "all the
files under the directory skps", "gms" means "all the GMs linked into
fm", etc.

You can set up one job on the command line, or any number of them
with a -script file, e.g.

    ~/skia (fm-bot↑1|●1…) $ cat fm.script
    gms b=cpu w=foo/8888
    gms b=cpu w=foo/565  ct=565
    skps b=gl w=foo/msaa4-skps samples=4

Change-Id: I878c623bfc8673f04b4effa247bc850c0258a89b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204582
Reviewed-by: Brian Osman <brianosman@google.com>
2019-04-02 15:51:04 +00:00
Ben Wagner
3bdb69c55f Clean up shaper handler.
Change-Id: Icb741ba9013747528e893c94df3b9242562028ba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205341
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-04-02 14:56:26 +00:00
Brian Osman
215da624d1 Revert "Remove the NullGL interface (and associated test context)"
This reverts commit de206c75c2.

Reason for revert: Chrome is having issues with the switch to Mock in blink tests.

Original change's description:
> Remove the NullGL interface (and associated test context)
> 
> Bug: skia:
> Change-Id: Ie3c9ee39fc1e0a4406de085c60d8433ffb4419df
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203708
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com

Change-Id: Iff0cbf29dcea26957efc800a8c33d0ad8285de0a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205343
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-04-02 12:48:37 +00:00
Brian Osman
b27667a15a Remove ToolUtils::write_pixels
Change-Id: If5463ea352e4c8ec6cbb1e07cc9e461504d06b37
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205300
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-04-01 20:24:55 +00:00
Chris Dalton
1d460d0ffe Fix mkdir_p in skpbench
We were crashing when trying to write an image on android.

Bug: skia:
Change-Id: Id8a4e07ea2385838e122291530710e2e4e74dd8d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205209
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-04-01 19:19:23 +00:00
Florin Malita
fb4bce8322 [sksg] Refactor gradient implementation
Currently, gradients are PaintNode subclasses - which limits their
applicability to leaf DAG nodes.

In order to support generalized gradient/shader effects:

  * introduce a new Shader base class
  * refactor gradients as Shader subclasses
  * introduce ShaderPaint (to support current Gradient-as-paint use)
  * introduce ShaderEffect (to support future Gradient-as-effect use)

Tangentially:

  * rename SkSGPaintNode.h -> SkSGPaint.h
  * consolidate sksg::Color into SkSGPaint.h

Change-Id: I94ba949f4504c09cfde4a4f030d927411fdd66a2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205263
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-04-01 18:43:43 +00:00
Ravi Mistry
ef6c1742b1 Remove 4 page sets that are not useful as SKPs
After this lands we will have 50 SKPs in our repository. We can now
institute an "if we add one we have to delete another one rule".

NoTry: true
Bug: skia:8653
Change-Id: I4da8d2c2ce312878bfe8ac0c6bc2f7dc4711bb85
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205262
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2019-04-01 17:26:54 +00:00
Brian Osman
de206c75c2 Remove the NullGL interface (and associated test context)
Bug: skia:
Change-Id: Ie3c9ee39fc1e0a4406de085c60d8433ffb4419df
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203708
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-04-01 14:56:23 +00:00
Mike Klein
ce90d6f088 more opinionated file loading in fm
Only try to parse .skp files as SkPictures, only .svg
files as SVG, and only try to parse any given file once.

This cleans up error logging from, e.g., trying to
parse a .jpg as an .svg.  Sometimes even asserts.

Change-Id: Ibfab76e201eb273107b96fcbd3af94d397862291
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204882
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-04-01 14:10:13 +00:00
Nathaniel Nifong
de5df65812 changes to wasm debugger for UI integration
Bug: skia:
Change-Id: I8f00cbb6682c1fdf6c1bb5eb118a00f38b7005f1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203730
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-03-28 18:06:13 +00:00
Kevin Lubick
3902628e35 Support WebGL 1.0 with caps
There is some logic in here for 2.0 as well, just as a
"as long as I was looking at the specs", but only 1.0
is really supported.

This seems to resolve the bug where some GPUs weren't
advertising correctly that they had vertex array object
support, by checking for both extension names (with and
without "GL_" prefix)

Of note, this saves about 18 Kb (5.5 Kb gzipped) of code size
by compiling out the unneeded GLES checks/functionality.

Bug: skia:8378
Change-Id: I773bf4dbf231b991051d2a9f640b8047a9010e7d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203461
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-28 17:21:23 +00:00
Kevin Lubick
9928c7db92 Add test_only option to gen_interface
Change-Id: I984e392709fb50037c0ad26135904a410aaf3235
Bug: skia:8912
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204443
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2019-03-28 16:22:13 +00:00
Greg Daniel
5e2c98d8f7 Add support to disable vsync on mac viewer.
Bug: skia:
Change-Id: I07f8086aaadf1b2dd0d8709bfbc20e2c694c95e3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204441
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-03-28 14:57:23 +00:00
Greg Daniel
d0794cccd0 Add support for vsync on android viewer.
Bug: skia:
Change-Id: Idcb3e3b0a67c2da65c99c597686cb55961142a38
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204263
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-03-27 20:57:01 +00:00
Mike Reed
a3bfb5de4b add bgra8 bgra8s and 8888s to explicitly control swizzle and srgb-ness in gpu[] configs
Bug: skia:
Change-Id: I2f029b334ce900c5c4844ddecd9d022f51a21334
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202705
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-03-27 20:46:01 +00:00
Mike Klein
6253d90de8 add .svg sources to fm
Change-Id: Ic364059cb277773a5d5f8011be2b68b757e889f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204280
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-27 20:42:50 +00:00
Mike Klein
c245bd9077 add --backend pdf to fm
Change-Id: I6ad822d606ecdf9a71a3626ebc3b19d524dbaf72
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204138
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-27 20:08:57 +00:00
Greg Daniel
a8cee7afe1 Add vsync toggle for windows viewer.
Change-Id: I1a223c96fbffc24a3a9263304768c2d7946a7a9e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204260
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-03-27 19:59:25 +00:00
Mike Klein
9b46209867 add --backend skp to fm
And move --backend first among the backend flags.

Change-Id: I853ede2a8218f046c968ace2ce8c5e277421e225
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204133
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-27 19:55:28 +00:00
Mike Klein
99ccc0ca87 lazy svg parsing in TestSVGTypeface
Do you know why the mutex was there around render() in the first place?

Change-Id: I3ff4bcf510c5f9a61fa002b7eff0eb3d47dc2f45
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204128
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-03-27 17:27:18 +00:00
Mike Klein
735c7ba320 FM, a dumber new testing tool
FM's a bit like DM, and a bit like the old GM tool, maybe closer to GM.

FM always does one serial run through of a list of GM, image, or .skp
sources (-s/--sources) into one drawing configuration, set at a high
level with -b/--backend, fine-tuned by flags like --ct, --at, --gamut,
--samples, etc.

FM prints all available GMs when run with no arguments, part of
how it integrates well with external parallelization like xargs:

   out/fm | time xargs -n4 -P32 out/fm -b cpu ... -s
   out/fm | time xargs -n32 -P8 out/fm -b gl ... -s
   ls *.skp | xargs ... out/fm ... -s
   ...

TODO later:
   vector backends: --backend pdf, svg, xps, skp
   --source *.svg, *.json (Skottie)
   Create/update a dm.json file

Change-Id: Idacbd2785deaf6f1d33674c66c4d984fa91dbd85
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203520
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-27 14:00:58 +00:00
Ravi Mistry
0a8b259a72 Fix RecreateSKPs bot page sets III
* skia_nytimes_mobile looks the same as skia_nytimes_desktop so deleting it.
* Was unsuccessful in making skia_sfgate_desktop work so deleting it.
* Increasing wait time in capitalvolkswagen seems to help SKP be more complete.
* Increasing wait time in booking does not seem to inc # of images but increasing it anyway.

NoTry: true
Bug: skia:8653
Change-Id: I9c05ffa679652a4b3962967f8376df525e7649fb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203821
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2019-03-27 13:31:28 +00:00
Ravi Mistry
45d5f70213 Fix RecreateSKPs bot page sets II
Both mobile SKPs of ebay/sfgate are not useful. We already have a desktop version of ebay. Create one for sfgate.

NoTry: true
Bug: skia:8653
Change-Id: I535c352d46d34500c2a8bdda12d406c58e16fd55
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203804
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2019-03-26 20:50:32 +00:00
Ravi Mistry
59241750dd Detect and fail when invalid SKPs are created by RecreateSKPs bot
NoTry: true
Bug: skia:8908
Change-Id: Ibb3efda72eeef566973c4de74bd0f91614b001ce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203460
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
2019-03-26 15:34:22 +00:00
Ravi Mistry
d92259bb0d Fix RecreateSKPs bot page sets
NoTry: true
Bug: skia:8653
Change-Id: I94d7b46faa2b2d40b9a9840f65df76d77c142665
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203382
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
2019-03-26 15:18:03 +00:00
Kevin Lubick
5509dac4cc Reland "Generate GrGLInterface and GrGlAssembleInterface* from table"
This reverts commit 573cb87a07.

Reason for revert: Marking failing validation as optional and filing bug for follow up in Chrome.

Original change's description:
> Revert "Generate GrGLInterface and GrGlAssembleInterface* from table"
> 
> This reverts commit 93b3dce89d.
> 
> Revert "Delete old assembleInterface code"
> 
> This reverts commit 7b1cf20d47.
> 
> Revert "Delete in favor of autogenerated file"
> 
> This reverts commit 0223bd01d8.
> 
> Bug: skia:8474
> NOTRY:true
> Change-Id: I23a904347f9d6cefd1710a2de056c39d52f4b178
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203463
> Reviewed-by: Stan Iliev <stani@google.com>
> Commit-Queue: Stan Iliev <stani@google.com>

TBR=kjlubick@google.com,stani@google.com

Change-Id: I85adb302eb093fe9b7a4ec2c984323c191278a43
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8474
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203177
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2019-03-26 10:55:00 +00:00
Kevin Lubick
573cb87a07 Revert "Generate GrGLInterface and GrGlAssembleInterface* from table"
This reverts commit 93b3dce89d.

Revert "Delete old assembleInterface code"

This reverts commit 7b1cf20d47.

Revert "Delete in favor of autogenerated file"

This reverts commit 0223bd01d8.

Bug: skia:8474
NOTRY:true
Change-Id: I23a904347f9d6cefd1710a2de056c39d52f4b178
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203463
Reviewed-by: Stan Iliev <stani@google.com>
Commit-Queue: Stan Iliev <stani@google.com>
2019-03-25 19:03:29 +00:00
Brian Osman
4cd0734f4c Remove bookmaker sources and data files
We're moving in a different direction for Skia documentation. We no
longer run bookmaker on the bots, and things have already degraded such
that it can't be run. This leaves the generated markdown in place for
the last set of docs that were generated (which are still useful until
the Doxygen docs catch up).

See also: https://skia-review.googlesource.com/c/skia/+/198162

Docs-Preview: https://skia.org/?cl=203464
Bug: skia:
Change-Id: I2f967a9c17dbc1cc899947d365071ef69cfb8ad7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203464
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-03-25 18:56:29 +00:00
Greg Daniel
bb792aae8c Add option to disable vsync on viewer unix.
This also fixes an issue where vulkan would crash any time we change a
display param on unix.

Bug: skia:
Change-Id: Ic6c3843e04bc77c2e9c5301ee38fcc58a409495d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203380
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-03-25 18:24:29 +00:00
Mike Klein
c6142d855c de-common the rest of the flags
Turns out lots of tools had two copies of many of these flags.

Some GN and .cpp file refactoring to make sure when flags are
present in a binary, they do something in that binary.

I think this finally finishes the flag refrag.

Change-Id: I01488e37ab73a5c4361786863ddb137a7f1095b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203420
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-25 17:39:58 +00:00
Kevin Lubick
93b3dce89d Generate GrGLInterface and GrGlAssembleInterface* from table
This CL creates a go program that takes a JSON file of
GPU functions and creates the assemble and validate code
based on that.

This approach will hopefully will lessen the need for
"shotgun surgery" anytime a new function/extensions is added.

Additionally, it should be easier to add a new standard
(concretely, WebGL) using this technique.

There are a few potential bugs/mismatches in the current
implementation that this has identified, for example,
Requiring GL 3.x for adding a feature, but only verifying
it is there on GL 4.x - I did not attempt to correct these
bugs in the old version, as we will hopefully be able to delete
that version and use the generated files.

Bug: skia:8474, skia:8378
Change-Id: Ie8144bbab8e03f2c815fd942fa9f7f91dedba101
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202137
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-25 15:03:48 +00:00
Brian Osman
4d92b89454 Revert "Remove GrDrawAtlasOp"
This reverts commit 97d957d1db.

Reason for revert: Looking at perf, desktop GPUs get better, many mobile GPUs get worse.

Original change's description:
> Remove GrDrawAtlasOp
> 
> The base device turns drawAtlas into drawVertices, which ends
> up being *faster* (in my tests) than our specialized code.
> 
> It's certainly possible to write a custom version that's better,
> but for now, it seems better to just do this.
> 
> Bug: skia:
> Change-Id: I247f0c0a24fb21c8206f4e3ea9fecac85679ba73
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203163
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=bsalomon@google.com,brianosman@google.com,reed@google.com

Change-Id: Idfb3dd7d33a3905644aafdefc99e7814b08d7c7b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203053
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-03-24 00:53:33 +00:00
Brian Osman
97d957d1db Remove GrDrawAtlasOp
The base device turns drawAtlas into drawVertices, which ends
up being *faster* (in my tests) than our specialized code.

It's certainly possible to write a custom version that's better,
but for now, it seems better to just do this.

Bug: skia:
Change-Id: I247f0c0a24fb21c8206f4e3ea9fecac85679ba73
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203163
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-03-23 23:11:00 +00:00
Ben Wagner
110c703b5d Move fontmgr_bounds label setting to checkbox.
The fontmgr_bounds gm has an option to show the name of the font and the
glyph ids of the glyphs with extreme bounds. This was previously done
with a command line flag label_fontmgr_bounds. However, this information
is generally only useful in the viewer application, so change this to a
control.

This also adds bool field handling in viewer.

Change-Id: Idbdbb08e9516ec49a96f9baa320acd6fe44e95ca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203175
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-03-23 14:37:59 +00:00
Mike Klein
19cc0f647c create a wrapper to manage --nativeFonts and --gdi
Put it in ToolUtils to avoid cyclic dependencies.

Change-Id: Ie0ad7eb5d1ba58be5ad8c668afdb7c74facd71dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203181
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-22 21:06:29 +00:00
Mike Klein
629f5fc5ec de-common another batch of flags
These are only used by DM and nanobench,
and sometimes even do substantially different things...

Change-Id: I973f3938fbae1fd1b19d876fa6a90122fc55d48c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203167
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-22 20:43:39 +00:00
Mike Klein
d0f321be72 de-common --veryVerbose
In the end only DM and skia_test really use it.

 - nanobench used --veryVerbose in a silly superficial way
 - gm/fontmgr.cpp is probably clearer using its own flag
 - the change to StrokerTest should be a near noop...
   reporter->verbose() is set by --veryVerbose in both
   DM and skia_test.cpp.  One of the checks tested
   FLAGS_verbose, but I feel like that was probably a typo.

Change-Id: I2601d243b8200b3bb7a16478dfbce14001c4a191
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203180
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-22 19:23:09 +00:00
Mike Klein
03fa5d4083 factor out SetAnalyticAAFromCommonFlags()
This wraps up the behavior for --analyticAA and --forceAnalyticAA
in one place, like we've done for the various GPU flags covered by
SetCtxOptionsFromCommonFlags().

It seems at least midly useful to have common flags centralized when
there is really a common mechanism they control.  Most of the rest
of these flags only serve analogous purposes in the various binaries
that use them, and I think it might be better for them to be split
out rather than centralized (so they don't show up confusingly in
binaries that _don't_ use them).

Change-Id: I27dbe53586363d4b262c1679ea73138015811ed1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203095
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-22 18:12:23 +00:00
Ravi Mistry
1432733fce Update all page sets for the RecreateSKPs bot
Made changes from discussions in go/skia-skps-3-2019

NoTry: true
Bug: skia:8653
Change-Id: Ia9c8b02fd87d61f0282fec97bc4adc510abefc01
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201642
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
2019-03-22 18:04:47 +00:00
Mike Klein
4932a5efa8 Fold CommonFlagsGpu into CommonFlags
This scopes a bunch of flags more tightly
to SetCtxOptionsFromCommonFlags().

Change-Id: I6090a016880c085fb5405a45081c0af984a1cd5b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203094
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-22 18:01:13 +00:00
Ravi Mistry
9b5e803a6c Add support for automated credentials login in webpages_playback.py
Just a rollback of https://skia-review.googlesource.com/c/skia/+/84540/3/tools/skp/webpages_playback.py
because I figured out how to use it in page sets.

NoTry: true
Bug: skia:8896
Change-Id: I771e282f4de472ed0dbe02a22e2311bb98c2f9ba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202952
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
2019-03-22 17:44:33 +00:00
Ravi Mistry
10ea199515 Fix --record in webpages_playback.py
NoTry: true
Bug: skia:8898
Change-Id: If05371b7935a9271a705fcc9edffad48aa51b4cc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202951
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
2019-03-22 17:37:23 +00:00
Ravi Mistry
914f0e3faf Script to help create new page sets for the RecreateSKPs bot
NoTry: true
Bug: skia:8899
Change-Id: I5154edab19e3f5080dcff53c0c54738a60c2b9fd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202950
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
2019-03-22 17:31:43 +00:00
Mike Klein
e5acd7547b delete DAA
Change-Id: I1fd8cba067c0063c6621641e8196e69fd5e31cec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203080
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-22 15:44:03 +00:00
Ben Wagner
cc8eb86c37 Make zoom in viewer exponential.
The previous linear zoom fits into about -2 to 2 in the new system. By
keeping the old linear values (instead of making the slider exponential)
the up and down keys can still be used to get away from and back to no
zoom. The new zoom allows for a much larger range of zoom, allowing more
issues to be seen.

Change-Id: I9ba8cf2c3c8d610a21a8c8598e0f5150eeb04ad8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202940
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-03-21 21:30:49 +00:00
Greg Daniel
655002b8b0 In viewer measure and show full frame times.
This updates viewer to show the full frametime including getting new buffers
and presenting buffers to the screen. This is more useful information than
simply the sum the flush and paint.

In a follow up CL we'll enable disabling vsync so we can truly measure how
long it takes us to draw.

Bug: skia:
Change-Id: Ibdbf16b37b44309fca6e771272ce38fd31a0e95c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202708
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-03-21 19:30:06 +00:00
Mike Klein
19fb3971bc de-common some flags
Move flags used only in one place to that place,
and remove a couple unused flags.

Change-Id: I0504d9583d464377e84ab28ce378d6da1e99ac3e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202802
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-21 18:55:34 +00:00
Ben Wagner
15a8d57175 Add font scale and skew in x to viewer.
Also change the names of some fields to remove the now redundant 'Text'
specification to make things fit on lines.

Change-Id: I4503eebaea406e82a1332dade0b6aea7dddf281f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202709
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-03-21 18:22:28 +00:00
Michael Ludwig
d9958f865c Use YUV effect in drawEdgeAAImageSet
Adds YUV planar image to the compositor_quads_image GM, confirmed
locally that it uses the effect instead of flattening the planes
into a single proxy (like before).

Bug: skia:
Change-Id: I0dea16bbaae34ae44cb1b51db9d2953231a6bf22
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201619
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-21 17:43:28 +00:00
Mike Klein
5b3f343d25 DEFINE_int32 + DEFINE_uint32 -> DEFINE_int
There's really no big benefit to distinguishing these.

Change-Id: Ib329d32b1fc43e98ba40658cfea37261203ecdb9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202801
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-21 17:20:19 +00:00
Mike Klein
84836b799a moar static flags
Like any normal variable, flags can be made file-scoped static,
and like any normal variable, mostly they should be if they can.

This CL converts most flags to be static, if only so that the
ones that do cross files stand out more clearly, and so that
there's more examples of static flags through the codebase for
people to ape.

Change-Id: Ibb5ddd7aa09fce073d0996ac3ef0487b078b7d79
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202800
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-21 17:07:13 +00:00
Mike Klein
1742813139 remove some more SK- in DrawCommand
peer bonus to sed:

    sed -r -i 's/Sk([a-z|A-Z]*)Command/\1Command/g'

Change-Id: I057d8291c04bab563a5dd37dd35eb839d0559325
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202326
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-20 20:31:26 +00:00
Mike Klein
eb678fcc1f de-Sk tools/trace
Kept it on SkDebugfTracer, which seemed to parse as "SkDebugf, Tracer".

Change-Id: I3e43fe101798ca5ffe14324e3c29f2dd41a6bd0f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202317
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-20 18:27:27 +00:00
Mike Klein
8f4e224541 de-Sk tools/debugger
Change-Id: I489a54860139d1820471aa0330b29a8ae9eca31e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202316
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-20 18:27:01 +00:00
Mike Klein
cd5104e942 SkAnimTimer -> AnimTimer
Change-Id: I700b7c0461475062ac66712cc29070f150cf777d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202315
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-20 18:26:35 +00:00
Mike Klein
0498857cee fold sk_pixel_iter.h into ToolUtils
The single class in it is already in the ToolUtils namespace.

Change-Id: Iefa69690c4aa9b218784eb5edcfe7dba8721747b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202314
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-20 18:22:15 +00:00
Mike Klein
ea3f014e2b sk_tool_utils -> ToolUtils, and git clang-format
sk_tool_utils doesn't really fit the naming convention
the rest of code under tools/ tends to use.

Change-Id: I45326a174101c6eb4b6149e9c742f658f2fd23b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202313
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-20 18:05:42 +00:00
Mike Klein
0cffcbf97b de-Sk tools/font, and git clang-format
Change-Id: I0326eb9cc1e1e38b0fdc417567987a595f9021d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202310
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-20 17:36:52 +00:00
Mike Klein
88544fbe63 remove Sk prefix from CommandLineFlags
The command line flag package is tool-only, not part of Skia per se,
and does not need an Sk prefix to avoid naming conflicts.

And git clang-format.

Change-Id: Ida8477779e51750ed0475590ed2454841b23d6ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202307
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-20 17:13:22 +00:00
Brian Osman
917d356838 Remove all of the _as_paths GMs
These GMs are confusing to triage, and are checking behavior that I
don't think we care about any longer.

Bug: skia:6652
Change-Id: I331f9a51623a0e90d4a848c8209be93403bc90ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202128
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-03-20 14:47:51 +00:00
Hal Canary
4524578a0f Documentation: notes on example fiddles
No-Try: true
Change-Id: I04bddda27cc876bf5d08a54b3a87205b76556081
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202201
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-03-19 22:26:57 +00:00
Ben Wagner
8dce054179 Add planet emoji font.
This allows for testing falling into various buckets in the gpu
fallbacks.

Change-Id: Ia0c319a6bdd03c5cdece1ce83ab228c1a3a7c46d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199420
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-03-19 17:49:22 +00:00
Michael Ludwig
390f0cc1f8 Reland "Reland "Update SkCanvas' experimental SkiaRenderer API""
This reverts commit 138a06d1b1.

Reason for revert: add explicit constructors to ImageSetEntry to account for the new arguments,
matching SkiaRenderer's current initializer list. Also hardens SkPictureDrawback's deserialization
code for drawEdgeAAImageSet and drawEdgeAAQuad from a fuzz that was found during the CL's brief
lifespan.

Original change's description:
> Revert "Reland "Update SkCanvas' experimental SkiaRenderer API""
>
> This reverts commit bd9d88a6e4.
>
> Reason for revert: Breaks SkiaRenderer on Android. Rendering is all corrupted, bisected to this change.
>
> Original change's description:
> > Reland "Update SkCanvas' experimental SkiaRenderer API"
> >
> > This reverts commit 90791c202d.
> >
> > Reason for revert: Jumped the gun, just need to update blacklist
> >
> > Original change's description:
> > > Revert "Update SkCanvas' experimental SkiaRenderer API"
> > >
> > > This reverts commit 4bf964602a.
> > >
> > > Reason for revert: vulkan dm crashes
> > >
> > > Original change's description:
> > > > Update SkCanvas' experimental SkiaRenderer API
> > > >
> > > > This lifts the temporary functions in SkGpuDevice into SkCanvas and
> > > > deprecates the older experimental_DrawImageSetV1 and
> > > > experimental_DrawEdgeAARect.  The new functions can handle paints and
> > > > transform batching. Internally, SkCanvas routes the old functions to the
> > > > new entry points and all device-level code is updated to handle the new
> > > > API features.
> > > >
> > > > While touching all of the canvas/device/recording areas, the
> > > > experimental functions are grouped in an "EdgeAA" cluster instead of being
> > > > separated into the image category and the rectangle category.
> > > >
> > > > Bug: skia:8739
> > > > Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b
> > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221
> > > > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > >
> > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
> > >
> > > Change-Id: I87a5a258c5a1bd15e16389cdf91743772d6fa98a
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Bug: skia:8739
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201226
> > > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> >
> > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
> >
> > Change-Id: I75e9b6cbf079a7739b69a7e208730a930621abf9
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: skia:8739
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201229
> > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Auto-Submit: Michael Ludwig <michaelludwig@google.com>
>
> TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
>
> Change-Id: Ib87ef9b8b8598c16a8a6915920adf0b5dffc644b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:8739
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201391
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: skia:8739, oss-fuzz:13794
Change-Id: Ibd7df4a398928c3170d16300bf3ade496125372c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201650
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-19 14:18:52 +00:00
Robert Phillips
5194123f7e Have DM's "--pr ~*" processing start from the default list of path renderers
This seems to be a less surprising handling of the path renderer flags.
Right now the DDL1 bot runs w/ "pr ~small" which is magically turning CCPR back on.

Change-Id: Ibbf630653853b9d421f2bedf7ed6e2845adfbc44
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201607
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-19 12:36:42 +00:00
Brian Salomon
0cc575488f Revert "Revert "Change promise image contract to for when Release and Done are called.""
This reverts commit d716d4402a.

Bug: skia:8800
Change-Id: Ic16cd4e960be2c3d2462bdf2b54b2e32abbd9f78
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199081
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-03-18 19:20:44 +00:00
Chris Dalton
f774818f57 Reland "Disable coverage counting by default"
This reverts commit 9ff956e6de.

Reason for revert: Will fix the issues with the change landed.

Original change's description:
> Revert "Disable coverage counting by default"
> 
> This reverts commit 576b2a5596.
> 
> Reason for revert: DDL and MSRTC unhappy
> 
> Original change's description:
> > Disable coverage counting by default
> > 
> > Bug: skia:
> > Change-Id: Iacb4cb3e409c6abdd25319ec0884ef673fb04cec
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201101
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Chris Dalton <csmartdalton@google.com>
> 
> TBR=djsollen@google.com,bsalomon@google.com,csmartdalton@google.com
> 
> Change-Id: Iabdb3116d97c7470044b962ff78cffd47ccee744
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201933
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

TBR=djsollen@google.com,bsalomon@google.com,csmartdalton@google.com

Change-Id: I1d81f7a52e81079bd232e97588fd34729a8f50cd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201938
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-03-18 16:22:47 +00:00
Chris Dalton
9ff956e6de Revert "Disable coverage counting by default"
This reverts commit 576b2a5596.

Reason for revert: DDL and MSRTC unhappy

Original change's description:
> Disable coverage counting by default
> 
> Bug: skia:
> Change-Id: Iacb4cb3e409c6abdd25319ec0884ef673fb04cec
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201101
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

TBR=djsollen@google.com,bsalomon@google.com,csmartdalton@google.com

Change-Id: Iabdb3116d97c7470044b962ff78cffd47ccee744
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201933
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-03-18 15:59:47 +00:00
Chris Dalton
576b2a5596 Disable coverage counting by default
Bug: skia:
Change-Id: Iacb4cb3e409c6abdd25319ec0884ef673fb04cec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201101
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-03-17 23:54:24 +00:00
Hal Canary
8751512aaa Revert "Revert "Compile all fiddle examples locally""
This reverts commit 37575bf3ca.

Change-Id: Ia31abbd4906ddeed406f3da1128bc4d4177abf24
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201603
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-03-16 00:48:09 +00:00
Jim Van Verth
a3407ab9a6 Fix asserts in Metal tests.
Bug: skia:8243
Change-Id: I5d976e2740bd0348e1c71cea2cda05d93bc004e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201397
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-03-15 20:04:21 +00:00
Hal Canary
37575bf3ca Revert "Compile all fiddle examples locally"
This reverts commit 83c2f70b51.

Reason for revert: broke some builders

Original change's description:
> Compile all fiddle examples locally
> [......]
> 
> Change-Id: I14a31348a9ccaaa31f65424b91e3a3533d2583a7
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198824
> Commit-Queue: Hal Canary <halcanary@google.com>
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Joe Gregorio <jcgregorio@google.com>

TBR=hcm@google.com,halcanary@google.com,bungeman@google.com,jcgregorio@google.com,scroggo@google.com

Change-Id: I8a6aa444d7f62aa73565ca4a7393e050872b6ecc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201600
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-03-15 17:39:01 +00:00
Hal Canary
83c2f70b51 Compile all fiddle examples locally
Motivation: it would be a good idea if the API documentation examples
were checked into the skia repository, so we could make sure they
compile as part of the commit queue.

Fiddle would make/update a named fiddle each time it gets a new
commit of Skia, extracted from the code in the examples/ directory.
The docs would point at those named fiddles.  Named fiddles have urls
in the form:

    https://fiddle.skia.org/c/@Bitmap_000

Then we would stick a link to the example into the header documentation
like this:

    /** Allocates the pixel memory for the bitmap, given its dimensions
        and SkColorType. Returns true on success, where success means
        either setPixels() or setPixelRef() was called.

        @param bitmap  SkBitmap containing SkImageInfo as input, and
                       SkPixelRef as output
        @return        true if SkPixelRef was allocated

        @example       https://fiddle.skia.org/c/@Bitmap_000
    */
    bool allocPixelRef(SkBitmap* bitmap) override;

There are still around 200 disabled examples that need to be fixed
(these result from API changes since the author left).

Change-Id: I14a31348a9ccaaa31f65424b91e3a3533d2583a7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198824
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
2019-03-15 15:19:18 +00:00
Brian Salomon
138a06d1b1 Revert "Reland "Update SkCanvas' experimental SkiaRenderer API""
This reverts commit bd9d88a6e4.

Reason for revert: Breaks SkiaRenderer on Android. Rendering is all corrupted, bisected to this change.

Original change's description:
> Reland "Update SkCanvas' experimental SkiaRenderer API"
> 
> This reverts commit 90791c202d.
> 
> Reason for revert: Jumped the gun, just need to update blacklist
> 
> Original change's description:
> > Revert "Update SkCanvas' experimental SkiaRenderer API"
> > 
> > This reverts commit 4bf964602a.
> > 
> > Reason for revert: vulkan dm crashes
> > 
> > Original change's description:
> > > Update SkCanvas' experimental SkiaRenderer API
> > > 
> > > This lifts the temporary functions in SkGpuDevice into SkCanvas and
> > > deprecates the older experimental_DrawImageSetV1 and
> > > experimental_DrawEdgeAARect.  The new functions can handle paints and
> > > transform batching. Internally, SkCanvas routes the old functions to the
> > > new entry points and all device-level code is updated to handle the new
> > > API features.
> > > 
> > > While touching all of the canvas/device/recording areas, the
> > > experimental functions are grouped in an "EdgeAA" cluster instead of being
> > > separated into the image category and the rectangle category.
> > > 
> > > Bug: skia:8739
> > > Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221
> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > 
> > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
> > 
> > Change-Id: I87a5a258c5a1bd15e16389cdf91743772d6fa98a
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: skia:8739
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201226
> > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> 
> TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
> 
> Change-Id: I75e9b6cbf079a7739b69a7e208730a930621abf9
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:8739
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201229
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Auto-Submit: Michael Ludwig <michaelludwig@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com

Change-Id: Ib87ef9b8b8598c16a8a6915920adf0b5dffc644b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8739
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201391
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-03-15 14:33:39 +00:00
Michael Ludwig
bd9d88a6e4 Reland "Update SkCanvas' experimental SkiaRenderer API"
This reverts commit 90791c202d.

Reason for revert: Jumped the gun, just need to update blacklist

Original change's description:
> Revert "Update SkCanvas' experimental SkiaRenderer API"
> 
> This reverts commit 4bf964602a.
> 
> Reason for revert: vulkan dm crashes
> 
> Original change's description:
> > Update SkCanvas' experimental SkiaRenderer API
> > 
> > This lifts the temporary functions in SkGpuDevice into SkCanvas and
> > deprecates the older experimental_DrawImageSetV1 and
> > experimental_DrawEdgeAARect.  The new functions can handle paints and
> > transform batching. Internally, SkCanvas routes the old functions to the
> > new entry points and all device-level code is updated to handle the new
> > API features.
> > 
> > While touching all of the canvas/device/recording areas, the
> > experimental functions are grouped in an "EdgeAA" cluster instead of being
> > separated into the image category and the rectangle category.
> > 
> > Bug: skia:8739
> > Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> 
> TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
> 
> Change-Id: I87a5a258c5a1bd15e16389cdf91743772d6fa98a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:8739
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201226
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com

Change-Id: I75e9b6cbf079a7739b69a7e208730a930621abf9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8739
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201229
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
2019-03-14 17:01:55 +00:00
Mike Reed
376d8128f0 Use '&' to toggle showing the gm's size in viewer
Bug: skia:
Change-Id: Id294b6a48d60d95b46ce3443edf10513599c43d1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201230
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-03-14 16:11:46 +00:00
Michael Ludwig
90791c202d Revert "Update SkCanvas' experimental SkiaRenderer API"
This reverts commit 4bf964602a.

Reason for revert: vulkan dm crashes

Original change's description:
> Update SkCanvas' experimental SkiaRenderer API
> 
> This lifts the temporary functions in SkGpuDevice into SkCanvas and
> deprecates the older experimental_DrawImageSetV1 and
> experimental_DrawEdgeAARect.  The new functions can handle paints and
> transform batching. Internally, SkCanvas routes the old functions to the
> new entry points and all device-level code is updated to handle the new
> API features.
> 
> While touching all of the canvas/device/recording areas, the
> experimental functions are grouped in an "EdgeAA" cluster instead of being
> separated into the image category and the rectangle category.
> 
> Bug: skia:8739
> Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com

Change-Id: I87a5a258c5a1bd15e16389cdf91743772d6fa98a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8739
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201226
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-03-14 14:57:12 +00:00
Michael Ludwig
4bf964602a Update SkCanvas' experimental SkiaRenderer API
This lifts the temporary functions in SkGpuDevice into SkCanvas and
deprecates the older experimental_DrawImageSetV1 and
experimental_DrawEdgeAARect.  The new functions can handle paints and
transform batching. Internally, SkCanvas routes the old functions to the
new entry points and all device-level code is updated to handle the new
API features.

While touching all of the canvas/device/recording areas, the
experimental functions are grouped in an "EdgeAA" cluster instead of being
separated into the image category and the rectangle category.

Bug: skia:8739
Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-14 14:24:11 +00:00
Nathaniel Nifong
cfdf87ecd2 fill out more of SkDebugCanvas interface
Added methods for toggling clip viz, overdraw viz, gpu bound viz.
methods for getting number of commands, toggling command visibility and deleting commands.
Added method for writing out json command list.

bound methods with emscrpiten and connected up to buttons in barebones interface to prove they're working.


Bug: skia:
Change-Id: I3f733b13db00ce5d14b1b5170de8fb66102c8b14
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199938
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-03-14 13:50:24 +00:00
Robert Phillips
570f4e51fd Always explicitly allocate except in Android Framework (take 3)
This will turn on explicit allocation (w/o opList sorting) in Chrome. It leaves the old allocation system in place in Android Framework and some of Skia's older bots.

We want:
  Flutter and Chrome to always explicitly allocate but not sort opLists outside of DDLs
  Android to never explicitly allocate and, thus, automatically never sort opLists

This needs the following Chrome suppression CL to land first:
https://chromium-review.googlesource.com/c/chromium/src/+/15182 (Add flag to skia/config/SkUserConfig.h to unblock Skia roll)

TBR=bsalomon@google.com
Change-Id: I3f51005ebc975ec754c2e0d2c646c0c324b02158
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200507
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-12 19:37:21 +00:00
Robert Phillips
2a2d732c39 Revert "Always explicitly allocate except in Android Framework (take 2)"
This reverts commit 88b93da63d.

Reason for revert: Chrome

Original change's description:
> Always explicitly allocate except in Android Framework (take 2)
> 
> This will turn on explicit allocation (w/o opList sorting) in Chrome. It leaves the old allocation system in place in Android Framework and some of Skia's older bots.
> 
> We want:
>   Flutter and Chrome to always explicitly allocate but not sort opLists outside of DDLs
>   Android to never explicitly allocate and, thus, automatically never sort opLists
> 
> This cannot land until after the following Chrome CL lands:
> 
> https://chromium-review.googlesource.com/c/chromium/src/+/1516096 (Disable opList sorting within Skia)
> 
> 
> Change-Id: Ic7d6a1a77a08f2fe42324773f62cccf8175ab3d7
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199931
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: Ida481ee9833d6db366b3d315fb4e9850d7c005ab
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200506
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-12 16:29:43 +00:00
Robert Phillips
88b93da63d Always explicitly allocate except in Android Framework (take 2)
This will turn on explicit allocation (w/o opList sorting) in Chrome. It leaves the old allocation system in place in Android Framework and some of Skia's older bots.

We want:
  Flutter and Chrome to always explicitly allocate but not sort opLists outside of DDLs
  Android to never explicitly allocate and, thus, automatically never sort opLists

This cannot land until after the following Chrome CL lands:

https://chromium-review.googlesource.com/c/chromium/src/+/1516096 (Disable opList sorting within Skia)


Change-Id: Ic7d6a1a77a08f2fe42324773f62cccf8175ab3d7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199931
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-12 13:25:28 +00:00
Robert Phillips
d40dc3f81b Revert "Always explicitly allocate except in Android Framework"
This reverts commit e157745dfc.

Reason for revert: Too exciting

Original change's description:
> Always explicitly allocate except in Android Framework
> 
> This will turn on explicit allocation (w/o opList sorting) in Chrome. It leaves the old allocation system in place in Android Framework and some of Skia's older bots.
> 
> 
> Change-Id: Idc02985e52f074894a251c7335ef00b009c72ccd
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199725
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: Icb097844de6db92e8151c81616a758837ecd9dfc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199929
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-11 18:41:22 +00:00
Robert Phillips
e157745dfc Always explicitly allocate except in Android Framework
This will turn on explicit allocation (w/o opList sorting) in Chrome. It leaves the old allocation system in place in Android Framework and some of Skia's older bots.


Change-Id: Idc02985e52f074894a251c7335ef00b009c72ccd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199725
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-11 17:22:31 +00:00
Joe Gregorio
ca9e2a4288 api.skia.org - Don't document private.
Bug: skia:
Change-Id: I4522267f6b553b999a3df47994e2bef1fb54d118
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199723
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
2019-03-11 15:52:21 +00:00
Ben Wagner
964571d952 Move 'Tiling' out of 'Transform' in viewer.
I almost missed that tiling was possible in viewer because it was hidden
down inside the transform section.

Change-Id: I2603f0ecfe72fe09178fdfe3c3afba941642f165
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199245
Auto-Submit: Ben Wagner <bungeman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-08 18:33:57 +00:00
Mike Klein
bea1f94f34 remove platform_font_manager()
We don't need this name munging since the
native/non-native font bots split.

Change-Id: I0e64feb08441ece8e0e4be0a70b812220aa8385a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199300
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-03-08 17:38:31 +00:00
Joe Gregorio
dd51aacdb1 Get doxygen working again.
This also enables MarkDeep for the comments, but I haven't added
any examples of that yet.

Screenshots:
  https://screenshot.googleplex.com/mUCgtAesDWt.png
  https://screenshot.googleplex.com/S1p4Dhpn6KW.png

Bug: skia:
Change-Id: I4f645ef1050d26c7a4660a1fc28a8d41f085f4f8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198241
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
2019-03-08 16:06:03 +00:00
Jim Van Verth
61610bebdf Add Autorelease pools to clear out no longer needed Metal objects.
Bug: skia:8822
Change-Id: I2bb3528100a54a169ec9c5b26ef7d4d1cacc19db
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198244
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-03-07 21:05:08 +00:00
Ben Wagner
d10a78f57b Add filter quality to paint overrides in viewer.
Change-Id: I5e544174f5ddeaaf0a6252d88775112e545686c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198781
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-03-07 18:44:00 +00:00
Brian Salomon
d716d4402a Revert "Change promise image contract to for when Release and Done are called."
This reverts commit c5e8e150c8.

Reason for revert: Reverting to revert 9ac0407006 https://skia-review.googlesource.com/c/skia/+/197163


Original change's description:
> Change promise image contract to for when Release and Done are called.
> 
> Now Release is called when all work related to the SkImage is flushed
> and Done is called when it is finished on the GPU in Vulkan. In GL they
> are still both called back-to-back after flushing.
> 
> Bug: skia:8800
> Change-Id: I990be7b9ebef8411590afd860ef40511fb5fee32
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198165
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: I13e8211d89ed1b7694c2d7734eeaaf4ba9ad410a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8800
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198602
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-03-07 15:23:41 +00:00
Brian Salomon
c5e8e150c8 Change promise image contract to for when Release and Done are called.
Now Release is called when all work related to the SkImage is flushed
and Done is called when it is finished on the GPU in Vulkan. In GL they
are still both called back-to-back after flushing.

Bug: skia:8800
Change-Id: I990be7b9ebef8411590afd860ef40511fb5fee32
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198165
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-03-07 13:43:59 +00:00
Ben Wagner
0bb2db16d7 Correct argument order for blobs in viewer.
The glyph count goes before the offsets.

Change-Id: Ibc7120d174ee6098212430c1505c0c5f0e539a8a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198252
Auto-Submit: Ben Wagner <bungeman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-07 00:42:28 +00:00
Florin Malita
34336e3633 Make SkCubicMap immutable
Drop setter, only keep the parameterized constructor.

Change-Id: I31517df23688b8bd7485bf70c9c055cd1c87edcf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198245
Auto-Submit: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-03-06 22:55:08 +00:00
Brian Osman
d0163fb734 Add glf16norm config to DM
Bug: skia:
Change-Id: Ia50fc75d00f4752c9ef266f3eac25b887563d52a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198174
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-06 19:09:18 +00:00
Brian Osman
b77d502946 Particles: Cleanup and better UI
Remove SkAnimTimer from the module interface entirely.
Clean up some other SkParticleEffect methods. Simplify
VisitTypes to just visit all of them, it's easier for
the client to do any filtering.

In the slide, make the UI far nicer. Load all files in
a given directory, and allow editing (and saving) them
all at once, or adding a new entry. Support multiple
playing effects, with a draggable handle to set the
position.

Bug: skia:
Change-Id: I0bec4077f9135bc122569f1410bebc96d5439480
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197243
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-03-06 18:42:11 +00:00
Hal Canary
e6752606a3 SkQP: from skqp_gn_args import SkqpGnArgs
This keeps the GN arguments in sync between stand-alone SkQP and CTS SkQP.

Change-Id: I7e8b2ecf47de30555d0f050daa03549e5279a4cc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197846
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
2019-03-05 20:51:55 +00:00
Hal Canary
9e9653cd94 SkQP: fix five tests
set `skia_use_expat` to true:
  - coloremoji_blendmodes
  - scaledemoji
  - scaledemojipos

disable bad tests:
  - arcs_as_paths
  - ovals_as_paths

Change-Id: I883cf13f54b424b8d3964fc045bd6282cbc028c9
Reviewed-on: https://skia-review.googlesource.com/c/196644
Reviewed-by: Ben Wagner <bungeman@google.com>
Cherry-Pick: e7e803e3a96948526c52220941594b0a6d3cdc24
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197014
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-03-04 22:14:21 +00:00
Robert Phillips
9882dae24d Reduce usage of SkCanvas::flush
SkCanvas::flush is problematic and we wish to deprecate it. As a first step, this CL begins to remove Skia's internal usage of it.

Ideally clients would use SkSurface::flush and/or GrContext::flush.

Change-Id: I39bb0702f8230134a97961a4ee70833fd5bd0dcc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196641
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-03-04 22:09:39 +00:00
Brian Osman
bdcdf1a7c3 Add SkParticleValue to allow further customization of curve behavior
All curves (and path affectors) are driven by an SkParticleValue. The
value can derive its value from the current defaults (age of particle
or effect), or explicitly choose the other one, a random value, or any
other particle value. Values can be range adjusted and support repeat,
clamp, and mirror tiling.

Also fixed some more issues related to resource path in the slide GUI.

Bug: skia:
Change-Id: I4755018d5b57ae2d5ec400d541055ca4fb542978
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196760
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-03-04 22:04:17 +00:00
Robert Phillips
0d075de863 Clean up GrSurfaceContext's relationship with GrRecordingContext
GrSurfaceContext was explicitly holding a lot of things it could just get from its GrRecordingContext.

Change-Id: Ia2e9708d71318dc0c101d56aadf5ae797230bc75
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/194360
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-04 21:54:05 +00:00
Mike Klein
b70990eda4 add kRGBA_F16Norm_SkColorType
For now this is distinct from kRGBA_F16_SkColorType but treated the
same.  Next steps are to see if we can keep it clamped to [0,1].

Switched a few switches away from default to exhaustive.

Took away any explicit SW clamps for now except the one we definitely
want in append_gamut_clamp_if_normalized().

Skip F16Norm in the DDL test because we can't yet distinguish it from
F16.

Change-Id: I021a864fe078e4fa4e2b399982e6c38350e10d74
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196371
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
2019-03-04 21:49:07 +00:00
Hal Canary
197a39eac7 SkQP: fix androidx (follows 2ccdd2bc1d)
No-Try: true
Change-Id: Ifdcc96d4133f5b05b47665ee7bdd9fbd0c004b03
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197011
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2019-03-04 21:43:58 +00:00
Robert Phillips
193c421f2f Remove peekProxy's side-effect behavior
Prior to this CL peekProxy could cause the conversion of YUVA planes to RGBA. This switches peekProxy back to just peeking.

In future Ganesh asTextureProxyRef is going to require a GrRecordingContext (bc it can actually do work). The options were to either add a GrRecordingContext parameter to peekProxy or remove its ability to do work (as in this CL).

Change-Id: I42d7dcd41f7c99a7712446d3f6629ffde91bfe5b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197105
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-04 21:38:54 +00:00
Mike Reed
58a75383a7 change particleslide to use Resources
standard way to find assets across different platforms

Bug: skia:
Change-Id: I4cb464be1e643a59431eba66b5caad70ecfed1e9
Reviewed-on: https://skia-review.googlesource.com/c/196775
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-03-03 01:38:01 +00:00
Jim Van Verth
74826c81bd Restore old Viewer setup order.
The backend needs to be set up before setting the current slide because
some slides require the backend resolution to set their size. We'll
check to see if a slide is set before drawing instead.

Also adds a null slide to be drawn when no slides are loaded.

Change-Id: Idb34deea80ea32762fa9e7434312e7b542c6a87e
Reviewed-on: https://skia-review.googlesource.com/c/196650
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-02 03:45:39 +00:00
Greg Daniel
bae712104d Add flush call to take access type, flags, and semaphore.
Bug: skia:
Change-Id: I5e664939a446616ef57acc79d26a10e6908cda10
Reviewed-on: https://skia-review.googlesource.com/c/196643
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-03-02 03:45:36 +00:00
Hal Canary
44861f94c9 SkQP: Fix report
Change-Id: I210f71444d4a567dc888c6b9dc136b70642a7a92
Reviewed-on: https://skia-review.googlesource.com/c/196508
Reviewed-by: Hal Canary <halcanary@google.com>
(cherry picked from commit 10783761fe46b1b4c7d7098b5abf49923c820ee8)
Reviewed-on: https://skia-review.googlesource.com/c/196646
Commit-Queue: Hal Canary <halcanary@google.com>
2019-03-01 18:50:49 +00:00
Mike Reed
ab094dae24 fix docs for fitsInBytes
Bug: skia:
Change-Id: I78c4432ff96e7c7886e5c996dc02d3a9505b6994
Reviewed-on: https://skia-review.googlesource.com/c/196507
Reviewed-by: Stephan Altmueller <stephana@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-03-01 16:48:59 +00:00
Brian Osman
3d76d1bf46 Particles: Removed emitters, added more full-featured position affectors
Bug: skia:
Change-Id: Ie6485a11bb57fecef470d727dcf3b4fe5dff0b90
Reviewed-on: https://skia-review.googlesource.com/c/195582
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-02-28 21:16:02 +00:00
Jim Van Verth
e94af49a3f Fix a couple of Mac windowing issues.
* Set correct backing size for Metal and Vulkan
* Don't capture mouse events when resizing

Bug: skia:8737
Change-Id: I7798ca95aebe0c11b75b23a55a94514550317b32
Reviewed-on: https://skia-review.googlesource.com/c/196423
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-02-28 19:24:52 +00:00
Brian Salomon
7d88f310a9 Remove support for SkDeferredDisplayListRecorder::DelayReleaseCallback::kNo.
Bug: skia:8800
Change-Id: I39d1ac62ab9a0d4f987c23de96c644aa9b2fa70e
Reviewed-on: https://skia-review.googlesource.com/c/196161
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-02-28 19:02:20 +00:00
Brian Osman
34d1331323 Particles: Improvements to SkCurve
Added explicit Linear segment type, merge math evaluation helpers for
scalar and color curves. Add logic to visitFields that cuts down on the
serialized size of simple curves, and makes the GUI easier to work with.

Remove the curve plot from the GUI. It was incorrect (wrong points at
cubic handle locations), not terribly helpful, and difficult to
maintain.

Bug: skia:
Change-Id: I190cb5d118b1f4b910984e4df50ee3351c8be895
Reviewed-on: https://skia-review.googlesource.com/c/195884
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-02-27 16:46:29 +00:00
Ben Wagner
ff84d8a900 SkTypeface::openStream to return smart pointer.
Change-Id: I2c936510e13561fcc9fd8343d5ab9f18c28c8340
Reviewed-on: https://skia-review.googlesource.com/c/195371
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-27 14:08:09 +00:00
Brian Osman
e5d532edae Particles: remove non-stable random, add better enum reflection
The other generator was never used (or useful). String-based serialization
of enums is quite helpful, though.

Bug: skia:
Change-Id: Ic9d58f8d20cfe7aba47722bd74f1e6f8f0f219e5
Reviewed-on: https://skia-review.googlesource.com/c/195368
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-02-26 20:29:56 +00:00
Greg Daniel
cb32415753 Add support for VK_IMAGE_LAYOUT_PRESENT_SRC_KHR in skia vulkan.
This change allows Skia to handle transfering from the present layout.
Skia currently never changes to the present layout, though we are looking
at adding support for this in a different CL.

With this change a client can wrap a an VkImage into an SkSurface still in
the queue present layout and Skia will handle the transation to color
attachment. If a client uses this functiality they most likely will want
to immediately call wait(GrBackendSemaphore) on the SkSurface so that Skia
waits on the VkSemaphore that came from a call to vulkan aquire image before
doing any work on the wrapped VkImage.

Bug: skia:
Change-Id: Ia9bd12ad4e6cd972daaa972cce8698d396c002fc
Reviewed-on: https://skia-review.googlesource.com/c/194424
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-02-26 17:37:25 +00:00
jongdeok.kim
804f17e35b [Viewer] Set the current slide first before attaching the fBackendType to fWindow.
If call attach() first, Viewer::onBackendCreated() calls Window::show().
When WM_PAINT occurs, Viewer::drawSlide() is called, where a crash occurs using an uninitialized fCurrentSlide.

Bug: skia:https://bugs.chromium.org/p/skia/issues/detail?id=8792
Change-Id: I22ba6479052cb66e08d8bc2a94539473e899b604
Reviewed-on: https://skia-review.googlesource.com/c/195240
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-02-26 14:21:55 +00:00
Ben Wagner
843909c91a Add full definition of SkStreamAsset.
When moving from pointer to smart pointer, the implementation of
the pointee must be available (so the destructor which isn't used
can be visible).

Change-Id: I5489365868d4a3ba48cb4e8cd10e38b262dec2da
Reviewed-on: https://skia-review.googlesource.com/c/195129
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-25 23:51:53 +00:00
Ben Wagner
4212a7d948 SkTypeface::onOpenStream to return unique_ptr.
This moves the smart pointer use up one more level in preparation for
changing SkTypeface::openStream to return unique_ptr as well.

Change-Id: Ib8173d59e03de38b06f6e1b4e6776f1961055ae7
Reviewed-on: https://skia-review.googlesource.com/c/195121
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-25 22:30:04 +00:00
Robert Phillips
6989370877 Move DrawingManager to RecordingContext
This CL does make use of a new GrRecordingContextPriv backdoor to break CL deadlocks. This occurs when this CL tries to create GrContext-dependent objects outside its scope.

Change-Id: I278fe9d321f8e0a4f5e9b489b1a5cc01b8974521
Reviewed-on: https://skia-review.googlesource.com/c/191287
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-22 17:25:00 +00:00
Brian Osman
22eeb3ccae Use upper case hex in viewer's zoom window
Bug: skia:
Change-Id: I5452dd557e103ccf75fb70312d32ad7615a830ed
Reviewed-on: https://skia-review.googlesource.com/c/193468
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-02-20 15:40:39 +00:00
Mike Reed
f922c783fd add colorspace param to textblobdiff canvas
Bug: skia:8773
Change-Id: Ib5d04e02a1568ad8a2b3f1baccb9544515f772f9
Reviewed-on: https://skia-review.googlesource.com/c/193373
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-02-20 04:52:48 +00:00
Ben Wagner
b059194c08 Make SkShaper an interface.
The interface here is not ideal, but there will need to be some build
clean-up before it can be changed.

Change-Id: Ic4d55634405f4c8d9c194e4e6f368287c9669dcd
Reviewed-on: https://skia-review.googlesource.com/c/193036
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-19 22:06:47 +00:00
Brian Osman
b23532b7ef Fix layout feedback loop in particle GUI
Bug: skia:
Change-Id: I6c5a846ed7b896d3eea27893bd946d7d0dd3f7d6
Reviewed-on: https://skia-review.googlesource.com/c/193375
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-02-19 21:52:57 +00:00
Brian Osman
2991cbee62 Remove SkField, it's no longer used
Bug: skia:
Change-Id: I8efcbb09dce2cb0e4f33a10e4ff2148058c6fbc5
Reviewed-on: https://skia-review.googlesource.com/c/193362
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-02-19 16:08:42 +00:00
Hal Canary
1bdb219492 tools/skqp/release.sh: Add Instant and ABI XML tags
No-Try: true
Change-Id: I4acd1660169bce2f62a772cbe39d80fb9b0b46ca
Reviewed-on: https://skia-review.googlesource.com/c/193037
Auto-Submit: Hal Canary <halcanary@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2019-02-15 21:48:16 +00:00
Robert Phillips
6a6de56655 Begin switching GrRecordingContext over to having the GrDrawingManager
The change forces the GrDrawingManager to only being able to access a GrRecordingContext.

Note that, like the ProxyProvider, the drawingManager still behaves differently if it is being used to directly render. In this case, the biggest difference is that the flush methods are disabled when DDL recording.

This pulls as much as possible out of https://skia-review.googlesource.com/c/skia/+/191287 (Move DrawingManager to RecordingContext) while keeping the drawingManager in the GrContext.

Change-Id: I1e5305fe0cb17ee0b243bfb8622f652310fc0507
Reviewed-on: https://skia-review.googlesource.com/c/192881
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-15 20:50:33 +00:00
Brian Osman
543d2e2f2e Moved image params out to SkParticleDrawable
Added a simpler circle drawable, moved drawing code out so that frame
calculation is handled by the drawable. Fixed all the sample effects,
including some size adjustments to better create the intended effect.

Bug: skia:
Change-Id: I60af9cd6262ff98352ca8ceaf6768aef9c7e164c
Reviewed-on: https://skia-review.googlesource.com/c/193029
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-02-15 20:07:43 +00:00
Robert Phillips
be9aff25bd Remove GrContextPriv.h from GrRenderTargetContext.h
Change-Id: Ib3afe6d8f2f9607eededb4dd4ef9dbe305741cfb
Reviewed-on: https://skia-review.googlesource.com/c/192829
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-15 17:29:03 +00:00
Brian Osman
112aa2d22e Add curve visualization back, guard eval
Editing curves is still cumbersome, but that's fine.
Visualization is just for feedback (and imgui's path
renderer is a little wonky), but this helps a bit.

Bug: skia:
Change-Id: I3dace6d822d472314513bb1ad72bcea1e8991b77
Reviewed-on: https://skia-review.googlesource.com/c/192828
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-02-15 16:24:43 +00:00
Brian Osman
8b6283fc98 New SkCurve type with multiple curve segments
- Converted all linear force stuff into a single affector,
  used at either spawn or update time appropriately.
  The new affector can either set or adjust velocity.
- Converted lifetime to a curve.
- Removed SkRangedFloat, initial velocity params, etc.

Looks like a large addition, but that's mostly down to the
JSON getting bigger. There's a net reduction in LoC.

Bug: skia:
Change-Id: Iac7417f15f96d0313efd08c4b26dc3250b80fa77
Reviewed-on: https://skia-review.googlesource.com/c/192102
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-02-15 14:10:39 +00:00
Ben Wagner
83597ce581 Remove typeface from SkShaper constructor.
It isn't used anymore.

Change-Id: I4079ff9944aa2483a0cd42130d0e69fb98935731
Reviewed-on: https://skia-review.googlesource.com/c/192820
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2019-02-14 21:41:28 +00:00
Jim Van Verth
ce51c14d76 Add MoltenVK support to Viewer.
Works with v1.0.17, will probably need updating for later revisions.

Bug: skia:8737
Change-Id: I9e42fad90656a88efa12625856019a8282ff39fd
Reviewed-on: https://skia-review.googlesource.com/c/191298
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-02-14 20:56:38 +00:00
Brian Osman
5c1f8eb094 Various particle system improvements
Effects now have a duration, and can be played looped
or one-shot. Added a second list of affectors that are
applied at spawn vs. update.

Effects grab and store the SkRandom at construction,
so it no longer needs to be passed to update().

Bug: skia:
Change-Id: Ib54d60466e162e4d4b70fa64c1215fc01680d47a
Reviewed-on: https://skia-review.googlesource.com/c/191722
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-02-14 20:19:08 +00:00
Brian Osman
5de7ea45bc Particles/SkReflected: Generalize array reflection
This supports arrays of any type, and removes all of the special case
code for arrays of SkReflected objects. (This is extracted from my
rewrite of SkCurve, which needed something like this to work).

Bug: skia:
Change-Id: I55ab942f7922335dca0685d28b3b122bc4d53daa
Reviewed-on: https://skia-review.googlesource.com/c/192620
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-02-14 20:04:48 +00:00
Ben Wagner
a57d868f19 Defer loading particle effect to load time.
Moving this out of the constructor means less going on at slide creation
time, making debugging easier.

Change-Id: I37bdd249abef663931bc8ef152a92a3a3436dcf4
Reviewed-on: https://skia-review.googlesource.com/c/192600
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-14 18:58:15 +00:00
Jim Van Verth
2782b2872b Fix drag events in Mac viewer.
Rather than depend on the Cocoa event system we intercept the events
in our main loop and send them to the appropriate sk_app::Window. A
hashmap that maps from Cocoa windowNumbers to an sk_app::Window is
added to make this possible.

We continue to send the event on through the Cocoa system to catch
system level events -- e.g., window close and drag events. We also
continue to catch key events in an NSView to keep the app from beeping
annoyingly because it thinks it's capturing events outside its focus.
Finally we ensure that move events are always enabled for the window
so that imgui knows that the cursor is over it.

Bug: skia:8737
Change-Id: Id49df51f68942fbf51634d6484291df862074864
Reviewed-on: https://skia-review.googlesource.com/c/191574
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-02-13 19:26:39 +00:00
Robert Phillips
b97da530f0 Switch Ops over to using GrRecordingContext
Since, by definition, the ops are created when recording, it makes sense that they should be able to make due with only the GrRecordingContext.

TBR=bsalomon@google.com
Change-Id: If64353aee30b35d0a16401f7de00954f44ed8c59
Reviewed-on: https://skia-review.googlesource.com/c/190670
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-13 15:53:09 +00:00
Brian Osman
7c979f52c3 Experimental Particle System
This adds a new "Particles" slide to viewer, that allows
editing, loading, and saving particle effects. All of the
particle system code is in modules/particles.

There are many rough edges and some not-yet-finished changes
to generalize the model[1]. A rough overview:

- SkReflected.h implements a lightweight reflection system
  for classes derived from SkReflected. Adding a new class
  involves deriving from SkReflected, adding a macro to the
  class declaration, and implementing visitFields(), which
  simply calls a virtual on an SkFieldVisitor for each field.
  Currently, emitters and affectors use this mechanism.

- SkParticleSerialization.h demonstrates two useful field
  visitors - for serializing to and from JSON. The driver
  code that uses those is directly in ParticlesSlide.

- SkParticleData.h and SkCurve.h define a variety of helper
  types for talking about particles, both for parameterizing
  individual values, and communicating about the state of a
  particle among the effect, affectors, and emitters.

- SkParticleEffect.h defines the static data definition of
  an effect (SkParticleEffectParams), as well as a running
  instance of an effect (SkParticleEffect). The effect has
  simple update() and draw() methods.

- ParticlesSlide.cpp adds a third field visitor to generate
  GUIs for interactively editing the running effect.

---

1: The critical change I'd like to make is to remove all
special case behavior over time and at spawn (setting sprite
frames, size over time, color over time, etc...). Integration
is the only fixed function behavior. Everything else is driven
by two lists of affectors. One is applied at spawn time, using
the effect's lifetime to evaluate curves. This allows spawning
particles with different colors as the effect ages out, for
example. The second list is applied every frame to update
existing particles, and is driven by the particle's lifetime.
This allows particles to change color after being spawned, for
example.

With a small set of affectors using a single expressive curve
primitive (keyframed list of cubic curve segments), we can
have affectors that update color, size, velocity, position,
sprite frame, etc., and implement many complex behaviors.

Bug: skia:
Change-Id: Id9402bef22825d55d021c5a2f9e5e41791aabaf4
Reviewed-on: https://skia-review.googlesource.com/c/181404
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-02-12 18:53:41 +00:00
Ben Wagner
7ad9b96d7c Upgrade to Mesa 18.3.3
This seems to resolve the leak in libxcb, but introduces a new leak in
VkTestUtils.

Bug: skia:8710
Change-Id: I71482d8f1c5eebfffd211a4124bd2db01283741b
Reviewed-on: https://skia-review.googlesource.com/c/186862
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Auto-Submit: Ben Wagner <benjaminwagner@google.com>
2019-02-12 16:42:30 +00:00
Florin Malita
eb46bd892d [sksg] Hit-testing API
Introduce RenderNode::nodeAt(const SkPoint&) as the entry point for the hit-testing API.

This is backed by a onNodeAt() virtual, which gets dispatched throughout the render DAG,
and normally stops at the first leaf Draw node in encounters.

To support the implementation, introduce a GeometryNode::contains(const SkPoint&) API.

This is backed by a onContains() virtual, overridden in each concrete geometry class.

Expose nodeAt() on sksg::Scene, and add some basic unit tests.

Change-Id: I0c8abd9d1e51ecf2d8b4dd699f325cd636e21084
Reviewed-on: https://skia-review.googlesource.com/c/191296
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2019-02-12 15:01:05 +00:00
Ben Wagner
454e5fb745 Fix cluster reporting from shaper.
Bug: skia:8420
Change-Id: I7eea8c6b3af2153a1ac1189782fc6cbaaf9ee5c6
Reviewed-on: https://skia-review.googlesource.com/c/190821
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-11 21:59:33 +00:00
Mike Klein
640654d145 run all available OpenCL devices
Change-Id: I6d18be3f6178003eb5153d32d4b618101ddcb3d9
Reviewed-on: https://skia-review.googlesource.com/c/191297
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-02-11 21:29:33 +00:00
Robert Phillips
b6e9d3c788 Outline GrDrawAtlasOp and GrDrawVerticesOp
This makes it easier to switch all the ops over to using a GrRecordingContext (and better matches what we do with all the other ops)

Change-Id: Ie690975c31b8c9f4c7acebdc0185a145a0a263a5
Reviewed-on: https://skia-review.googlesource.com/c/191280
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-11 20:38:35 +00:00
Robert Phillips
a9162dfb9c Plumb abandonment throughout GrContext hierarchy
When the GrImageContext & GrRecordingContext are actually GrDirectContexts it is useful for them to report the abandonment state of the GrDirectContext.

When the GrImageContext & GrRecordingContext are actually GrImageCreationContext or GrDDLContexts then they will just never be abandoned.

This CL also strips the GrProxyProvider and GrDrawingManager of their tracking on abandonment and centralizes it in the GrImageContext.

ImageContext
  can't abandon
  can only check abandonment privately

RecordingContext
  can't abandon
  can only check abandonment privately

DirectContext (aka GrContext)
  can abandon publicly
  can check abandonment publicly

Note that abandoning the DirectContext won't alter the abandonment status of any of
the other contexts in its group (e.g., DDL contexts that may be being used to record).

Change-Id: Ib790f74d90ab18da58a127fed2aad20e2477bd21
Reviewed-on: https://skia-review.googlesource.com/c/190669
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-11 20:26:22 +00:00
Mike Klein
8a1f15df81 update hello-opencl
- break dependency on code from src/compute
  - port away from C APIs to friendlier C++ wrapper APIs
  - add DEPS for OpenCL C++ wrapper headers so we can build on Mac
  - factor out a //third_party/opencl GN target

Change-Id: I9e37c6677cfb779021e66f2bd10f97570c450746
Reviewed-on: https://skia-review.googlesource.com/c/191281
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-11 18:47:32 +00:00
Greg Kaiser
4dbaafa75b bookmaker: Remove fflush() on closed file
fflush() requires an open file handle, so it shouldn't be called
right after fclose().  And fclose() performs an fflush(), by
definition (see http://man7.org/linux/man-pages/man3/fclose.3.html ),
so we can remove this fflush() call altogether.

Change-Id: I8fbdd5a85b3cdb5edfdabbd5dca449ea1d4fce2d
Reviewed-on: https://skia-review.googlesource.com/c/191321
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-11 18:00:22 +00:00
Brian Osman
535c5e34ee Add ImGui::DragCanvas, to simplify several custom widgets
Bug: skia:
Change-Id: Ic44ab00af1117a6bbc17df7f5005f4db707cb5c1
Reviewed-on: https://skia-review.googlesource.com/c/191002
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-02-11 16:31:59 +00:00
Hal Canary
77a1a7e618 find_commit_with_best_gold_results takes arguments
No-Try: true
Change-Id: Iafb9453f40fd16c139996bf8f37b8c5255982486
Reviewed-on: https://skia-review.googlesource.com/c/191160
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-02-11 15:00:27 +00:00
Jim Van Verth
be39f713e5 Add Metal context to Viewer.
Bug: skia:8737
Change-Id: I5c4c839bcf39f2cd3a9a32d005bf4bdb7c42e6a5
Reviewed-on: https://skia-review.googlesource.com/c/187925
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-02-08 21:26:52 +00:00
Brian Salomon
1f05d459e2 Add GrContext::resetGLTextureBindings().
This function binds texture ID 0 to any texture unit/target combo that
Skia has modified.

Bug: chromium:926017
Change-Id: I3ac8f8050c863232886102886e60d3b91a5380c9
Reviewed-on: https://skia-review.googlesource.com/c/190663
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-02-08 21:26:51 +00:00
Jim Van Verth
3e8392e42c Manage Mac paint events more directly.
Trying to shuttle our paint events through the Mac event system seems
to be causing a number of problems, one being that we're refreshing
too often. This works around that by tracking the invalidation flag
per window.

Bug: skia:8737
Change-Id: Ib1b8041f1d9299ff366747831a466439bfd0db29
Reviewed-on: https://skia-review.googlesource.com/c/190673
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-02-08 20:35:00 +00:00
Hal Canary
70441faaef SkQP: make text context outlast gm
Change-Id: Ia8e3b42d1b88d111a3885a7b2ae90c29985a8c10
Reviewed-on: https://skia-review.googlesource.com/c/190672
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-02-08 19:19:52 +00:00
Robert Phillips
d6841487eb Move auditTrail and opMemoryPool from GrContext to GrRecordingContext
Any context that records ops (i.e., direct and/or DDL) will need these two objects.

Change-Id: Ifd3527c23a4015f7d469ad2222563508cccbd339
Reviewed-on: https://skia-review.googlesource.com/c/190307
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-08 16:07:56 +00:00
Brian Osman
a5ab35cc0e Fix vertex indexing error when using ImGui skiaWidgets
skiaWidget adds fake "images" to the ImGui draw list. Those have
vertices allocated for them (even though we don't consume them). We
still need to skip over those if any ImGui widget rendering happens
after the callback, though.

Bug: skia:
Change-Id: Ia0243e600bd32d90ba97ac9fbe58b715f70aa83a
Reviewed-on: https://skia-review.googlesource.com/c/190664
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-02-08 15:43:26 +00:00
Robert Phillips
a41c6858da Move proxyProvider and singleOwner to GrImageContext
This starts to beef up the capabilities of the GrImageContext in preparation for its future responsibilities (i.e., creating promise images w/o a recordingContext).

Note that the proxyProvider still has different behavior if it has a full context vs. a reduced context. I intend to just let this behavior remain as is.

Change-Id: Idb9d99a548ef928fc1b9dc1e5a34f74343bb0b4b
Reviewed-on: https://skia-review.googlesource.com/c/189490
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-08 15:20:06 +00:00
Mike Klein
764f25a3c5 remove a couple more jsoncpp deps
Presumably if we don't need these in Skia,
we don't need them in Android?

Change-Id: Iff18066c1c2a52c999beabbd9239d4bc96d0ba6d
Reviewed-on: https://skia-review.googlesource.com/c/190438
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
2019-02-08 15:17:26 +00:00
Hal Canary
480d29bfc9 SkQP: new tool: tools/skqp/find_commit_with_best_gold_results
I already used this to choose where to branch SkQP for Q-release.

No-Try: true
Change-Id: Id809adefe038d4a96a47c19f7844812ea8854d1e
Reviewed-on: https://skia-review.googlesource.com/c/184920
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2019-02-07 21:20:29 +00:00
Hal Canary
6512fa389c SkQP: update tools/skqp/gn_to_bp.py, add release script
No-Try: true
Change-Id: Id8cfba15d70700d4d38c7db81599f6d56fb93cdd
Reviewed-on: https://skia-review.googlesource.com/c/190306
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2019-02-07 20:41:56 +00:00
Brian Osman
5b9126bc19 Give ImGui the correct DeltaTime
Fixes key repeat rate when vsync is disabled

Bug: skia:
Change-Id: I315932d0e0bcfd491a3c81deba56b137db1c3a0f
Reviewed-on: https://skia-review.googlesource.com/c/190304
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2019-02-07 20:19:26 +00:00
Robert Phillips
dbaf317cd4 Move GrContextPriv methods to their own .cpp file
Centralize these for my sanity. Most will also be parceled out to other contexts.

Change-Id: If0e7e98bcf66c4d8a3391f9b04e643ccc91af4ad
Reviewed-on: https://skia-review.googlesource.com/c/189488
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-06 21:15:58 +00:00
Ravi Mistry
2b1d179860 Have the RecreateSKPs bot upload to partner bucket
It will upload to a directory that specifies the day the SKPs were created on:
gs://chrome-partner-telemetry/skps/2019-02-05

Bug: skia:8738
Change-Id: Ic6b719770e16408d580e552af41c1a41c682935a
Reviewed-on: https://skia-review.googlesource.com/c/188300
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2019-02-06 18:35:12 +00:00
Jim Van Verth
98385ba6c5 Switch back to non-Retina display resolution.
Gives 1:1 pixel correspondence with GM resolutions, and fixes
viewport issues.

Bug: skia:8737
Change-Id: Ieb87ed32cbb3211bdb4cdfbcc486c7b57b1c1eda
Reviewed-on: https://skia-review.googlesource.com/c/188627
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-02-06 16:53:02 +00:00
Ben Wagner
6c30e74dd0 Add DDL jobs for Intel
To work around skia:8709, I'm moving the DDL tests to IntelIris640. The
ASAN jobs still show memory leaks in the driver, but at least I can
identify which calls are leaking and suppress the LSAN warnings.

Adds an SK_ENABLE_SCOPED_LSAN_SUPPRESSIONS define that indicates that
the LSAN header files are available, which is set in recipes for the
Linux ASAN builds. Adds __lsan::ScopedDisabler in four locations for
two Vulkan API calls:
 - CreateGraphicsPipelines in GrVkPipeline::Create and
   GrVkCopyPipeline::Create
 - CreateDescriptorSetLayout in
   GrVkDescriptorSetManager::DescriptorPoolManager::DescriptorPoolManager
   constructor (2 calls)

Also adds a regular suppression for libxcb.so.

See bugs listed below for more details on the leaks.

Bug: skia:8710, skia:8712, skia:8713
Change-Id: I55c6e5d483b4aeed5cd44c64219539ca7214187f
Reviewed-on: https://skia-review.googlesource.com/c/184071
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Auto-Submit: Ben Wagner <benjaminwagner@google.com>
2019-02-06 15:53:32 +00:00
Brian Osman
88cfc50bb6 Remove all references to jsoncpp (build scripts, DEPS, etc)
Bug: skia:
Change-Id: I3cec245e537eee3e6ceb0a4a52bad733c2c8746e
Reviewed-on: https://skia-review.googlesource.com/c/189842
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-02-06 15:15:52 +00:00
Brian Osman
5c11d5c084 Convert bookmaker to SkJSON
Verified that running bookmaker produces an identical fiddle.json
before and after this change.

Bug: skia:
Change-Id: I1aa7477348a5f8c362201199b130508c2818116f
Reviewed-on: https://skia-review.googlesource.com/c/188303
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-02-06 15:08:32 +00:00
Ben Wagner
119196ab66 s/geTestSVGTypeface/getTestSVGTypeface
In addition to fixing the typo, this cleans up a few unnecessary calls
into SkTypeface internals.

Change-Id: I101f67053c2db6850d1576de1001998ccf84d2cd
Reviewed-on: https://skia-review.googlesource.com/c/189496
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-05 21:38:35 +00:00
Mike Klein
830ab79b26 disable DAA by default
This turns DAA off by default in Skia and in our tools,
while leaving it able to be turned back on if we want.

(There's at least one bot that does already.)

This setup keeps our default builds matching the behavior
of Chromium, Flutter, Android, Google3, and should prevent
anyone from accidentally falling into it.

Change-Id: Ia85f3dbe69c46cec0dac6b07fb5feb6e8b65d237
Reviewed-on: https://skia-review.googlesource.com/c/189580
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-05 17:15:14 +00:00
Greg Daniel
8ce7991242 Add release proc apis to SkSurface::MakeFromBackend* calls.
Bug: skia:
Change-Id: I0e6cd8895c328a89cd0fa50260fe4e8adbff5990
Reviewed-on: https://skia-review.googlesource.com/c/188634
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-05 15:36:14 +00:00
Robert Phillips
9da87e0e98 Rename GrContext::contextPriv to priv
Mechanical. This makes the priv() accessor the same for all the context types.

Change-Id: I40850eb05a33b8d7cc3eabdd42226d24b2ba58aa
Reviewed-on: https://skia-review.googlesource.com/c/189164
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-04 22:13:14 +00:00
Greg Daniel
24d861d8bf Add hardware buffer unit test from old skqp to skia.
This copies the hardware buffer unit test from, which was cherry picked
straight into skqp last year, into Skia proper.

There are not functional changes, but a few of the APIs have been updated
to work with newer Skia.

Bug: skia:
Change-Id: I2d7b2ed8b0b9314ca3e03e703a6a5ac53805275e
Reviewed-on: https://skia-review.googlesource.com/c/188034
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-01-31 17:44:52 +00:00
Brian Salomon
f55e8d5232 Add option to skip intermediate release/fulfill calls for promise images.
SkiaRenderer does not delete promise image textures when they are released
but not done. Refulfilling promise image textures takes a significant amount
of CPU time. This allows us to fulfill each promise image once.

Bug: skia:8736
Change-Id: I7ad7fa9678ed0ec4bb714b71fbf920ab4a845409
Reviewed-on: https://skia-review.googlesource.com/c/188039
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-01-31 16:24:52 +00:00
Jim Van Verth
d426dd0dd9 Fix screen invalidation on MacOS
Bug: skia:
Change-Id: Ib5c88e78ebdfb4c420335d31807ab069422bf6f3
Reviewed-on: https://skia-review.googlesource.com/c/188033
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-01-30 19:36:11 +00:00
Jim Van Verth
d24cb80702 Fix up some event handling in MacOS
Bug: skia:
Change-Id: I46a1526cb6622c0ff04dbee9f64febca388f3571
Reviewed-on: https://skia-review.googlesource.com/c/187927
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-01-30 16:03:21 +00:00
Mike Reed
8d0f82408b Some clangtidy fixes
Bug: skia:
Change-Id: I751f93394812bdfab40cd322a23255e18fa2440a
Reviewed-on: https://skia-review.googlesource.com/c/187387
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-01-28 20:45:16 +00:00