Commit Graph

2800 Commits

Author SHA1 Message Date
Yuqian Li
5be3a8e061 Handle no stash case
Bug: skia:
Change-Id: Ie717f92306d32303cb2efcfe5809bb4d81ae80e0
Reviewed-on: https://skia-review.googlesource.com/60223
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
2017-10-17 13:46:12 +00:00
Yuqian Li
c81aaaad0b Try calmbench on bots
Bug: skia:
Change-Id: I869776e3d9d47b4a1a11089f729a0b17581eb9f7
Reviewed-on: https://skia-review.googlesource.com/57400
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
2017-10-16 17:33:40 +00:00
Chris Dalton
7a0ebfc033 Add a tooling flag for path mask caching
Adds the flag and a disables caching on the CCPR bots.

Bug: skia:
Change-Id: Icb85e77f89634dda1d419dacac5b8a93340723f0
Reviewed-on: https://skia-review.googlesource.com/59740
Reviewed-by: Eric Boren <borenet@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-10-13 22:31:12 +00:00
Kevin Lubick
cccaef1667 Modify skpbench to use newer adb version
Bug: skia:
NOTRY=true
Change-Id: Ib630d352b6922280ef5772e6843f8f031baeffaf
Reviewed-on: https://skia-review.googlesource.com/59161
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2017-10-13 13:13:47 +00:00
Greg Daniel
177e695589 Add flag on GrBackendTexture to say whether texture is mipped or not
Bug: skia:
Change-Id: Ia684e3daf779ec2feaaec64c04dabf5cb03cd07a
Reviewed-on: https://skia-review.googlesource.com/57821
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-10-12 17:02:41 +00:00
Brian Salomon
0b4d8aa108 Add benchmark for comparing multitexturing to non-multitexturing image draws.
Allows benchmarks to override GrContextOptions.

Removes the ability to use the same GrContext for all benchmarks in a config.

Change-Id: I5ab9f6e81055451ac912a66537843d1a49f3b479
Reviewed-on: https://skia-review.googlesource.com/34080
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-10-11 20:32:49 +00:00
Cary Clark
884dd7d428 General clean up on bookmaker.
Command line runs without error for
SkBitmap, SkPath, SkRect, SkIRect,
SkPixmap, SkCanvas.

Docs-Preview: https://skia.org/?cl=57112
TBR: caryclark@google.com
Bug: skia:6898
Change-Id: I73b69ae8ffdf0a1e6bc187dc8a9dfb28f7766faa
Reviewed-on: https://skia-review.googlesource.com/57112
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2017-10-11 15:26:37 +00:00
Brian Osman
5fbd18370f Add NV_fence support to get better timing from ANGLE ES2
Previously, we were reporting numbers that were far too low, because
we were getting way ahead of the GPU, and then spending all of our time
in finish (which isn't timed). That led to us picking very high loop
counts, so our wall clock time to run nanobench was very high, and our
reported times were very low. This fixes all of that, and removes all
the spam about not having fence support.

Change-Id: Ib9dfc043da82bf8ee6645b8627cfade66eb9864e
Reviewed-on: https://skia-review.googlesource.com/58001
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-10-10 21:13:03 +00:00
Brian Osman
e6984a0fb5 Fix bugs with fence sync API on iOS devices
- Actually request extension version of fence sync functions
- Fix incorrect usage of dlopen/dlsym
- Also fixed same bugs in Mac code, although we never hit that
  code path.

Should fix iOS devices, giving more accurate (and less spammy)
results from nanobench.

Bug: skia:
Change-Id: I3456b301ef9b0b6559160d1d21c77bd93139d39a
Reviewed-on: https://skia-review.googlesource.com/57740
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-10-10 19:05:13 +00:00
Ben Wagner
63fd760a37 Remove trailing whitespace.
Also adds a presubmit to prevent adding trailing whitespace to source
code in the future.

Change-Id: I41a4df81487f6f00aa19b188f0cac6a3377efde6
Reviewed-on: https://skia-review.googlesource.com/57380
Reviewed-by: Ravi Mistry <rmistry@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-10-09 21:20:34 +00:00
Ben Wagner
29380bdd56 Remove carriage returns.
Also add a presubmit so they don't get added to source code.

Change-Id: I6a85c6a934b1068a63646a0dcc0d3a08baa96ced
Reviewed-on: https://skia-review.googlesource.com/57110
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-10-09 20:41:14 +00:00
Cary Clark
7fc1d12e67 first cut at SkRect, SkIRect documentation
All functions should have descriptions, examples, cross-references.
References and spelling have been checked.
More work to do creating and organizing topics.

Docs-Preview: https://skia.org/?cl=56140
Tbr: caryclark@google.com
Bug: skia:6898
Change-Id: I9d1e55d04ab64874c33cac8b91534aa192c2f545
Reviewed-on: https://skia-review.googlesource.com/56140
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2017-10-09 19:36:14 +00:00
Ben Wagner
eeadcc1b5c Add Win Clang Vulkan builds.
Fix Clang compiler warning.

Change-Id: Ic6f5b161058d1ed2df45e12b72dbff3b486ec986
Reviewed-on: https://skia-review.googlesource.com/56740
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
2017-10-07 18:27:40 +00:00
Cary Clark
bc5697d3b1 starting next gaggle of docs
starting next gaggle of docs

Docs-Preview: https://skia.org/?cl=50264
Bug: skia:6898
Change-Id: I639795b55c0c96b2efccac13cb67592f055a75a2
Reviewed-on: https://skia-review.googlesource.com/50264
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2017-10-04 18:50:33 +00:00
Mike Klein
9a3478bf82 ok, add a8 dst support
Change-Id: Ib7f855c833c8e73f448de7c8a75f59b1a0880874
Reviewed-on: https://skia-review.googlesource.com/53600
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-09-29 20:08:34 +00:00
Yuqian Li
980379d475 Add a new calmbench tool for noiseless nanobench
This tool can quickly check all nanobench tests including svgs
and skps (<5 minutes for CPU, ~30 minutes for GPU) and find
significant performance regressions without much noise.

This tool is not only faster (lower latency to get regression
alerts), but also more sensitive compared to our k-means and
step-fitting bots (especially for changes that only affect very
few benches). It may still miss some regressions, but the
regressions reported should be valid with very high probability.

Bug: skia:
Change-Id: I02115e6c5ab630e4c56b2087ffeb5cae1d4a618e
Reviewed-on: https://skia-review.googlesource.com/50060
Commit-Queue: Yuqian Li <liyuqian@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
2017-09-29 16:00:34 +00:00
Yuqian Li
58e23039bd Remove unused functions get_preferred_size
Bug: skia:
Change-Id: I6a5b5d96ad48b84b07d2e56fbabb870a90c62a97
Reviewed-on: https://skia-review.googlesource.com/51460
Reviewed-by: Yuqian Li <liyuqian@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
2017-09-26 20:02:16 +00:00
Mike Reed
592273965a Revert "Revert "migrate to sk_sp for SkFontMgr API""
This reverts commit f40ae1a4b5.

Bug: skia:
Change-Id: I752606de92ea405d6e50219c98030409b00a2841
Reviewed-on: https://skia-review.googlesource.com/51160
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-09-26 14:05:18 +00:00
Mike Reed
f40ae1a4b5 Revert "migrate to sk_sp for SkFontMgr API"
This reverts commit 4bf296be28.

Reason for revert: need guard for flutter

Original change's description:
> migrate to sk_sp for SkFontMgr API
> 
> Bug: skia:
> Change-Id: I1bf2a13537f67938cdc9956080065d10ea0bd1d8
> Reviewed-on: https://skia-review.googlesource.com/48740
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

TBR=bungeman@google.com,reed@google.com

Change-Id: Ib0b2d00fcbcdb6131444f94d1046df6dae24f551
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/50940
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-09-25 20:00:41 +00:00
Mike Reed
4bf296be28 migrate to sk_sp for SkFontMgr API
Bug: skia:
Change-Id: I1bf2a13537f67938cdc9956080065d10ea0bd1d8
Reviewed-on: https://skia-review.googlesource.com/48740
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2017-09-25 19:45:09 +00:00
Ben Wagner
67e3a30f24 Add some font fallback to SkShaper.
Change-Id: I92d58071dc3a540e21bbe55267963504ff9da75b
Reviewed-on: https://skia-review.googlesource.com/42600
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-09-22 19:57:08 +00:00
Brian Osman
c49d11e065 Turn on GPU threading by default to get better test/perf coverage
Explicitly disable it on PixelC. This is arbitrary, so we continue to
get coverage of the single-threaded code.

Bug: skia:
Change-Id: I0ac91f7ca58652933db452720f353068cf2d0f2d
Reviewed-on: https://skia-review.googlesource.com/50000
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-09-22 15:17:18 +00:00
Mike Klein
58628fdc33 ok, add via_skp
This is the same sort of thing as DM's serialize via.
It draws into a picture, serializes that, deserializes that,
and then draws that picture into the destination.

Change-Id: Ib58748786bc01fd8a0cb9355a2fd334311c361bf
Reviewed-on: https://skia-review.googlesource.com/49902
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-09-21 21:10:08 +00:00
Cary Clark
6fc5041adb feedback
feedback from include review

Docs-Preview: https://skia.org/?cl=49260
Bug: skia: 6898
Change-Id: Ic60980dfe53d14fd8c6973ef2f4dabb6b650cdd8
Reviewed-on: https://skia-review.googlesource.com/49260
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2017-09-21 16:50:10 +00:00
Jim Van Verth
446cc84b55 Fix MSAN compile error
Change-Id: I2ac07f2da5e08a3dbefc59fb860d69817906df41
Reviewed-on: https://skia-review.googlesource.com/49441
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-09-20 19:42:09 +00:00
Jim Van Verth
32bbf377e6 Fix TSAN issue with atlas expansion.
Removes SkString-related malloc from DM crash handler, and adds null check in ProxyRefTest.

Bug: skia:3550
Change-Id: I143c532b5d231a426b1a96b854e1effd6379b673
Reviewed-on: https://skia-review.googlesource.com/48440
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-09-20 17:46:59 +00:00
Cary Clark
9174bda24a work on generation of rect, bitmap, matrix markup
TBR=caryclark@google.com
Bug: skia:6898
Change-Id: I501d87341afa2f8d548b4d02415375032a46e96e
Reviewed-on: https://skia-review.googlesource.com/47420
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2017-09-19 22:04:19 +00:00
Mike Klein
fe69f9a50a Make GrFakeRefObj::fNext atomic.
This lets you make them on different threads simultaneously.

Change-Id: Ife4228ae4721b35c718ece1a30cc5686f3690c13
Reviewed-on: https://skia-review.googlesource.com/48800
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-09-19 20:58:49 +00:00
Cary Clark
e4aa37128f missing description for FontMetricFlags
rearrange class descriptions to make them
appear consistently inside the #Class
declaration in the .bmh files.

Look for the descriptions there and
regenerate the .md files.

Docs-Preview: https://skia.org/?cl=46523
TBR=caryclark@google.com
Bug: skia: 6898
Change-Id: I00a176428725ef27667d3f23d76d6b7ff0cfced1
Reviewed-on: https://skia-review.googlesource.com/46523
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
2017-09-15 14:03:53 +00:00
Chris Dalton
2d802ddba6 Simple script to measure SurfaceFlinger fps
Bug: skia:
Change-Id: I063c832f6d292e5e9f615c881e3325eb4ab9cdfa
Reviewed-on: https://skia-review.googlesource.com/44681
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
2017-09-14 20:55:21 +00:00
Cary Clark
7265ea32e5 remove need for command flags cast
TBR=mtklein@google.com
Bug: skia: 6898
Change-Id: I1c83fe67cbfb978f15ebcbb9081ac4d4a8f00e4a
Reviewed-on: https://skia-review.googlesource.com/46680
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2017-09-14 17:32:31 +00:00
Cary Clark
d0530ba8f4 wip pixmap docs
wip pixmap docs

Docs-Preview: https://skia.org/?cl=42522
Bug: skia: 6898
Change-Id: I85947bc36ea057ed008b87d7bef2efa82d7c89ad
Reviewed-on: https://skia-review.googlesource.com/42522
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2017-09-14 16:05:21 +00:00
Jim Van Verth
a950b63b44 Add support for additional textures in GrDrawOpAtlas
Step two in supporting growable/shrinkable atlases.

Bug: skia:3550
Change-Id: I0cdec2a9f59cc8ced071bfeec2f8ed5a228c4b7a
Reviewed-on: https://skia-review.googlesource.com/43260
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-09-12 17:16:00 +00:00
Ravi Mistry
a6b646986b Break up the prefix to make some presubmits stop complaining
NoTry: true
Bug: skia:7016
Change-Id: If2f405d8309fc63d8592a97b668f826cd606097b
Reviewed-on: https://skia-review.googlesource.com/45801
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2017-09-12 15:24:00 +00:00
Ravi Mistry
ff72a0857f Add SK_DEBUG to SkUserConfig.h from upload_to_android.py if "--debug" flag is specified
Example uploaded change: https://googleplex-android-review.git.corp.google.com/#/c/platform/external/skia/+/2884102/

NoTry: true
Bug: skia:7016
Change-Id: Ia213e04532c7e4b8c90d01b8138a720f267bfa56
Reviewed-on: https://skia-review.googlesource.com/44822
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2017-09-12 13:54:30 +00:00
Ravi Mistry
a2bdf005f3 Add a "[DO NOT SUBMIT]" prefix to the uploaded Android change
Since the script cannot do anything to prevent submission via the API it might
help to atleast add a "[DO NOT SUBMIT]" prefix.

NoTry: true
Bug: skia:7016
Change-Id: I825f28947df85a4d54ead764f8d363e12f83fbfb
Reviewed-on: https://skia-review.googlesource.com/44840
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2017-09-11 15:28:05 +00:00
Ravi Mistry
b816322422 Sync only the current branch and use a shallow checkout
Tried this out locally and it shrunk the size of the checkout from 1010M
to 586M and shaved a few seconds off the running time as well.

NoTry: true
Bug: skia:7016
Change-Id: I472712e88d2cf30f0cfd71a373630d12a4937684
Reviewed-on: https://skia-review.googlesource.com/44820
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2017-09-11 15:23:00 +00:00
Mike Klein
11cd4640d4 explicitly set user email to <self>@google.com
I have my global user.email set to mtklein@chromium.org,
and Android's Gerrit won't let me upload that way.

Change-Id: Id5c1a0843fa7912b67ef6f32c0e262ca85a9139f
Reviewed-on: https://skia-review.googlesource.com/44500
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-09-08 22:57:17 +00:00
Ravi Mistry
e1e47b70e0 Script that uploads a specified Skia change to Android's Gerrit instance
This script does the following:
* Downloads the repo tool.
* Inits and checks out the bare-minimum required Android checkout.
* Sets the required git config options in external/skia.
* Cherry-picks the specified Skia patch.
* Modifies the change subject to append a "Test:" line required for presubmits.
* Uploads the Skia change to Android's Gerrit instance.

After the change is uploaded to Android, developers can trigger TH and download binaries (if required) after runs complete.
The script re-uses the workdir when it is run again. To start from a clean slate delete the workdir.

Timings:
* ~1m15s when using an empty/non-existent workdir for the first time.
* ~15s when using a workdir previously populated by the script.

Example usage:
  $ python upload_to_android.py -w /repos/testing -c 44200

Bug: skia:7016
Change-Id: I9a34b05de7f119a2c321687f7391add7e8cfd7ba
Reviewed-on: https://skia-review.googlesource.com/44380
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-09-08 21:19:20 +00:00
Chong Zhang
c1868cdf96 add heic extension to DM test
b/64077740

Change-Id: Ice0232d9be7ed4ba0421400b3b93ecd58d69f45f
Reviewed-on: https://skia-review.googlesource.com/43360
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-09-07 20:37:50 +00:00
Robert Phillips
276066b517 [MDBViz] Switch from a QListView to a QTreeView for the ops
This lets us open & close groups and automates the hierarchy.

Change-Id: Ib6f0850a49b793d824fc25aa16be78e6a1a93d9e
Reviewed-on: https://skia-review.googlesource.com/43280
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-09-06 23:12:28 +00:00
Robert Phillips
deaf568e07 Solidify Model/View split
Change-Id: Iecf034feaa009002b5f09c47052c915d22aec0e4
Reviewed-on: https://skia-review.googlesource.com/43040
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-09-06 20:46:01 +00:00
Robert Phillips
5fccf9d801 [MDBViz] Add tear off windows for the op list & main canvas window
Change-Id: I4086a17eafecccaf0bac34c850c249a5e4efc719
Reviewed-on: https://skia-review.googlesource.com/42524
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-09-06 01:02:22 +00:00
Ben Wagner
e000173f43 Add variation support to SkShaper.
Sets the variation position of the SkTypeface on th hb_font. This allows
for correct shaping of variation fonts. This also splits out the
creation of hb_font from SkTypeface for clarity.

Change-Id: I8e3476dea0f18f1f7cb3fe757a04f99f0ab6c0fe
Reviewed-on: https://skia-review.googlesource.com/41742
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-09-05 15:05:44 +00:00
Ben Wagner
2868b78f46 Improve utf16/utf8 mismatch with ubidi.
The ubidi code only works with utf16 and SkTextBlob only with utf8. This
requires translating indexes. The current code starts cold when
translating indexes for each run, leading to taking O(n^2) time on the
number of runs. However, since this code is iterating over the runs in
order and each run begins where the last left off, simply keeping the
previous run's utf8 and utf16 end positions and using them as the next
starting position makes this O(N).

Change-Id: I921a87511fb4cdf5f6e92cd483959cf758d95306
Reviewed-on: https://skia-review.googlesource.com/41503
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-09-05 14:44:15 +00:00
Robert Phillips
a6d2d708d7 Add gn plumbing for mdbviz tool
Change-Id: I06e6b63c2742da069f48ff5d7defafc63a485af7
Reviewed-on: https://skia-review.googlesource.com/41842
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-09-05 13:57:44 +00:00
Cary Clark
ce1012403b bookmaker spelling with fixed linux build
Work on spell-checker
to identify errors and
isolate more concepts
requiring definitions.

fix linux build

Docs-Preview: https://skia.org/?cl=42103
Docs-Preview: https://skia.org/?cl=41180
Tbr: caryclark@google.com
Bug: skia: 6898
Change-Id: Id939b0c2915c22e0fa1b15623c1a56fbe9d4051d
Reviewed-on: https://skia-review.googlesource.com/42103
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2017-09-01 20:10:51 +00:00
Cary Clark
e040384627 Revert "wip spelling mania"
This reverts commit da65a0489a.

Reason for revert: fails to build on linux

Original change's description:
> wip spelling mania
> 
> Work on spell-checker
> to identify errors and
> isolate more concepts
> requiring definitions.
> 
> Docs-Preview: https://skia.org/?cl=41180
> TBR: reed@google.com
> Bug: skia: 6898
> Change-Id: I0759beb42eaf6095908a9bd7decfcd0026253609
> Reviewed-on: https://skia-review.googlesource.com/41180
> Reviewed-by: Cary Clark <caryclark@skia.org>
> Commit-Queue: Cary Clark <caryclark@skia.org>

TBR=caryclark@google.com,caryclark@skia.org

Change-Id: I173e50ea5b51273cd316ac9964af3a498b5300e4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia: 6898
Reviewed-on: https://skia-review.googlesource.com/42140
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2017-09-01 19:21:40 +00:00
Cary Clark
da65a0489a wip spelling mania
Work on spell-checker
to identify errors and
isolate more concepts
requiring definitions.

Docs-Preview: https://skia.org/?cl=41180
TBR: reed@google.com
Bug: skia: 6898
Change-Id: I0759beb42eaf6095908a9bd7decfcd0026253609
Reviewed-on: https://skia-review.googlesource.com/41180
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2017-09-01 18:19:37 +00:00
Jim Van Verth
dbb24efcc5 Get viewer running on iOS
Bug: skia:
Change-Id: Ic8b25ca2ecf51cfc190ac01bc9282396905a33b3
Reviewed-on: https://skia-review.googlesource.com/40862
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-09-01 17:30:57 +00:00
Robert Phillips
bdda0ba155 Cosmetic changes to GrDrawOpAtlas
It looks like we won't be going in the direction of:

https://skia-review.googlesource.com/c/skia/+/35962 (Allow GrDrawOpAtlas to grow & shrink)

Pull out what is worth keeping.

TBR=bsalomon@google.com

Change-Id: Ia14c3c621e7b1d2d7f303a455a3e4d9660af5f6e
Reviewed-on: https://skia-review.googlesource.com/41362
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2017-09-01 16:24:48 +00:00
Mike Klein
022cfa258d Add FIFO thread pool, use it for most things.
We like a LIFO default thread pool in tools like DM for better
memory/time locality... the bots use less memory this way, and
generally run faster.

But most use cases want a FIFO queue, so that they can get going
on the next parts of early work while later work is still running.

This splits the implementation into one using SkTArray and pop_back
for LIFO, and a new one using std::deque and pop_front for FIFO.

Change-Id: Ief203b6869a00f1f8084019431a781d15fc63750
Reviewed-on: https://skia-review.googlesource.com/41849
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-09-01 16:19:47 +00:00
Mike Klein
5f13bef501 ok, rate limit forking
On Macs the user process limit is low, in the hundreds, and it's a
little annoying to mysteriously find other programs fail to start
because ok is greedily slurping up all the available process capacity.

On Linux the user process limit is up in the ten-thousands, so I don't
expect this to matter there, even on Android.  I haven't seen any
significant speed difference imposing a default ncpus limit.

Change-Id: Id284723808074441710c0436acbd75ab1c6bbbb3
Reviewed-on: https://skia-review.googlesource.com/41840
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-09-01 15:40:37 +00:00
Ben Wagner
a25fbef56a Add bidi to SkShaper.
Change-Id: Iaab9a1d5091a3b157a582b7e8c3261a6c3283ffc
Reviewed-on: https://skia-review.googlesource.com/40778
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-08-31 14:18:31 +00:00
Brian Osman
195c05b6d5 Move several GrContextOptions fields behind GR_TEST_UTILS
Bug: skia:
Change-Id: I35bc08ad72fb94d8e47fe342d314c4496b954226
Reviewed-on: https://skia-review.googlesource.com/40881
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-08-30 19:35:27 +00:00
Robert Phillips
ad8a43f769 DeferredDisplayList API proposal
Chrome would like to perform cpu-side preprocessing for gpu draws in parallel. 
They do not want to go through a picture (since they have their own display list format).


The general idea is that we add a new SkDeferredDisplayListRecorder class to
perform all of Ganesh's cpu-side preprocessing ahead of time and in parallel.

The SkDDLRecorder operates like SkPictureRecorder. The user can get an SkCanvas
from the SkDDLRecorder and feed it draw operations. Once finished, the user
calls 'detach' to get an SkDeferredDisplayList. All the work up to and 
including the 'detach' call can be done in parallel and will not touch
the GPU. To actually get pixels the client must call SkSurface::draw(SkDDL)
on an SkSurface that is "compatible" with the surface characterization
initially given to the SkDDLMaker.

The surface characterization contains the minimum amount of information Ganesh needs 
to know about the ultimate destination in order to perform its cpu-side work
(i.e., caps, width, height, config).



Change-Id: I75faa483ab5a6b779c8de56ea56b9d90b990f43a
Reviewed-on: https://skia-review.googlesource.com/30140
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-08-30 19:25:47 +00:00
Brian Osman
c0e66273f8 Make AA hairline renderer non-optional
Change-Id: I0d4166a4e9ea894f479755f9f7137c5941cf8a22
Reviewed-on: https://skia-review.googlesource.com/41081
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-08-30 19:05:27 +00:00
Mike Klein
94fef59239 use fcntl() to lock/unlock fds
This is portable back to older Android NDK APIs.
Seems to work fine.

Change-Id: I1f121f372d376909011ffd7063b73cbe50402a5f
Reviewed-on: https://skia-review.googlesource.com/40688
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-08-30 18:55:47 +00:00
Mike Klein
1b4602bd9b ok, backtrace support on Android
This adds a fallback backtracer for use on Android where <execinfo.h>
ins't present, instead using <unwind.h> to unwind and <dlfcn.h> to
lookup function names and addresses.

lockf() wasn't available until NDK API 24, so I've just no-op'd file
locking on older targets.  I tried switching from lockf() to flock(),
but flock() didn't see to _do_ anything, neither on Android nor on my
Mac laptop.  I think I should be able to use the lower-level fcntl()
APIs to restore file locking uniformly in a follow-up.  The upshot is
until then, we'll have interlaced logs and stack traces on Android
devices unless you set ndk_api=24 in GN.

We need to add a couple build flags to make backtraces useful:

   * -funwind-tables makes the call to _Unwind_Backtrace() actually
     traverse the call stack.  This is a small extra binary size cost.
   * -rdynamic makes symbols linked into the main executable visible
     to dladdr().  We do this on Linux already for the same reason.

Here's an example where I made aaxfermodes call SK_ABORT():

    650 ok, 1 crashed
    caught signal SIGABRT while running 'aaxfermodes'
        0x76ed936288 [unknown]+308
        0x76eec014e0 [unknown]+510811706592
        0x76ed367b2c tgkill+8
        0x76ed364f50 pthread_kill+68
        0x76ed31ff5c raise+28
        0x76ed318814 abort+56
        0x76edebd070 sk_out_of_memory()+12
        0x76ed99f664 AAXfermodesGM::draw_pass(SkCanvas*, AAXfermodesGM::DrawingPass)+96
        0x76ed99f4e4 AAXfermodesGM::onDraw(SkCanvas*)+36
        0x76ed9e8550 skiagm::GM::drawContent(SkCanvas*)+224
        0x76ed9e82ac skiagm::GM::draw(SkCanvas*)+288
        0x76ed93b10c GMStream::GMSrc::draw(SkCanvas*)+96
        0x76ed937b08 SWDst::draw(Src*)+284
        0x76ed936ca0 [unknown]+112
        0x76ed939b4c ForkEngine::spawn(std::function<Status ()>)+88
        0x76ed934d00 main+2200
        0x76ed316598 __libc_init+92
        0x76ed93434c [unknown]+510791992140

Change-Id: Ica4849d99a3b97f48d778f4c15a7fa36275b8133
Reviewed-on: https://skia-review.googlesource.com/40802
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-08-30 17:50:07 +00:00
Brian Salomon
f3b46e5193 Rename methods and enum on SkClipStack::Element to indicate "device space"
Change-Id: I83056843b530f76590f755f97e3d0a5a58f371fa
Reviewed-on: https://skia-review.googlesource.com/39402
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-08-30 15:58:12 +00:00
Brian Osman
f9810666bd Threaded generation of software paths
Re-land of: https://skia-review.googlesource.com/36560

All information needed by the thread is captured by the prepare
callback object, the lambda captures a pointer to that, and does the
mask render. Once it's done, it signals the semaphore (also owned by the
callback). The callback defers the semaphore wait even longer (into the
ASAP upload), so the odds of waiting for the thread are REALLY low.

Also did a bunch of cleanup along the way, and put in some trace markers
so we can monitor how well this is working.

Traces of a GM that includes GPU and SW path rendering (path-reverse):

Original:
    https://screenshot.googleplex.com/f5BG3901tQg.png
Threaded, with wait in the callback (notice pre flush callback blocking):
    https://screenshot.googleplex.com/htOSZFE2s04.png
Current version, with wait deferred to ASAP upload function:
    https://screenshot.googleplex.com/GHjD0U3C34q.png
Bug: skia:
Change-Id: Idb92f385590749f41328a9aec65b2a93f4775079
Reviewed-on: https://skia-review.googlesource.com/40775
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-08-30 15:27:42 +00:00
Cary Clark
a523d2d155 fix param return descriptions
enforce that param and return
descriptions are phrases (begin
with lower case, no trailing
period).

Docs-Preview: https://skia.org/?cl=40767
Bug: skia: 6898
Change-Id: Ib5f2a02441673f71c0780d81c5e4c61200a678e3
Reviewed-on: https://skia-review.googlesource.com/40767
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2017-08-30 13:16:12 +00:00
Cary Clark
73fa972d0b work on path
Work on SkPath.h documentation; fixed self-consistency
bugs identified by bookmaker. Fixed a couple of
minor typos in SkPath.h itself.

Also brought SkPaint and SkCanvas docs up to date.

TBR=reed@google.com
Docs-Preview: https://skia.org/?cl=39040
Bug: skia: 6898
Change-Id: Id89d4e2fa7fb6ee2e3cbec7ea762e06308b67d8b
Reviewed-on: https://skia-review.googlesource.com/39040
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
2017-08-30 11:06:02 +00:00
Mike Klein
84c5435bcf print running task in both ok_log()
Change-Id: Ie69421ed36d596cb8c40f9858fac370ceba18c87
Reviewed-on: https://skia-review.googlesource.com/40022
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-08-30 00:18:21 +00:00
Brian Osman
8b0f265f70 Always include the default path renderer in the chain
This (plus SW) ensures that we can always draw any path. Changed the path
renderer command line flags so that 'default' means everything but CCPR,
and 'All' really means 'every path renderer'.

Bug: skia:
Change-Id: I2801d1c50ab939f23efb4600e0f90e6add2891b7
Reviewed-on: https://skia-review.googlesource.com/40221
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-08-29 19:37:32 +00:00
Brian Salomon
3416969605 Revert "Revert "Revert "Revert "Add GrTextureOp and use to implement SkGpuDevice::drawImage[Rect]() when possible""""
This reverts commit a184ac7e0c.

Change-Id: I2a4a1b713fd998ba33a5f85a34be1645438a7ac9
Reviewed-on: https://skia-review.googlesource.com/39400
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-08-28 20:02:16 +00:00
Mike Reed
3c2d09f89a change SkRect::growToInclude to take a point instead of x,y
This avoids the dangerous overload problem of

growToInclude(0, 0)

matching to (const SkPoint[], count) rather than growToInclude(x, y)

Bug: skia:
Change-Id: Iaba8b1a579638ff363fde62e4e3004052dd2b2ac
Reviewed-on: https://skia-review.googlesource.com/39501
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-08-28 17:54:06 +00:00
Ben Wagner
a93a14a998 Convert NULL and 0 to nullptr.
This was created by looking at warnings produced by clang's
-Wzero-as-null-pointer-constant. This updates most issues in
Skia code. However, there are places where GL and Vulkan want
pointer values which are explicitly 0, external headers which
use NULL directly, and possibly more uses in un-compiled
sources (for other platforms).

Change-Id: Id22fbac04d5c53497a53d734f0896b4f06fe8345
Reviewed-on: https://skia-review.googlesource.com/39521
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-08-28 17:48:57 +00:00
Cary Clark
493df1f9f3 try again to fix method links
generate method links from
fiddle names to keep them
consistent and unique.

Docs-Preview: https://skia.org/?cl=38727
Bug: skia:6898
Change-Id: I3434801b46002a3a9095e007d456e9e871307304
Reviewed-on: https://skia-review.googlesource.com/38727
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2017-08-25 17:32:57 +00:00
Cary Clark
8cc16c7fde fix generated links
qualify bookmaker links to remove
file reference if intra-file and
add class reference if part of
a class

TBR=caryclark@google.com
Docs-Preview: https://skia.org/?cl=38722
Bug: skia: 6898
Change-Id: Ie0548485a6e3f596efc0f15b819bd5060e983a5b
Reviewed-on: https://skia-review.googlesource.com/38722
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2017-08-25 16:13:08 +00:00
Brian Salomon
87ae989569 Revert "Threaded generation of software paths"
This reverts commit 76323bc061.

Reason for revert: Breaking NUC bots in threaded gm comparison:

https://chromium-swarm.appspot.com/task?id=382e589753187f10&refresh=10



Original change's description:
> Threaded generation of software paths
> 
> All information needed by the thread is captured by the prepare
> callback object, the lambda captures a pointer to that, and does the
> mask render. Once it's done, it signals the semaphore (also owned by the
> callback). The callback defers the semaphore wait even longer (into the
> ASAP upload), so the odds of waiting for the thread are REALLY low.
> 
> Also did a bunch of cleanup along the way, and put in some trace markers
> so we can monitor how well this is working.
> 
> Traces of a GM that includes GPU and SW path rendering (path-reverse):
> 
> Original:
>     https://screenshot.googleplex.com/f5BG3901tQg.png
> Threaded, with wait in the callback (notice pre flush callback blocking):
>     https://screenshot.googleplex.com/htOSZFE2s04.png
> Current version, with wait deferred to ASAP upload function:
>     https://screenshot.googleplex.com/GHjD0U3C34q.png
> 
> Bug: skia:
> Change-Id: I3d5a230bbd68eb35e1f0574b308485c691435790
> Reviewed-on: https://skia-review.googlesource.com/36560
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: Icac0918a3771859f671b69ae07ae0fedd3ebb3db
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/38560
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-08-24 21:34:38 +00:00
Cary Clark
f05bddaac3 update canvas doc, primarily readpixels and writepixels
also fixed minor bookmaker bugs so canvas 
include and online docs are (bookmaker detected)
error-free

TBR=reed@google.com
Docs-Preview: https://skia.org/?cl=37840
Bug: skia:
Change-Id: Ifcec9c751105444047c37d89fd984dbd4dfd1913
Reviewed-on: https://skia-review.googlesource.com/37840
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
2017-08-24 18:00:33 +00:00
Brian Osman
76323bc061 Threaded generation of software paths
All information needed by the thread is captured by the prepare
callback object, the lambda captures a pointer to that, and does the
mask render. Once it's done, it signals the semaphore (also owned by the
callback). The callback defers the semaphore wait even longer (into the
ASAP upload), so the odds of waiting for the thread are REALLY low.

Also did a bunch of cleanup along the way, and put in some trace markers
so we can monitor how well this is working.

Traces of a GM that includes GPU and SW path rendering (path-reverse):

Original:
    https://screenshot.googleplex.com/f5BG3901tQg.png
Threaded, with wait in the callback (notice pre flush callback blocking):
    https://screenshot.googleplex.com/htOSZFE2s04.png
Current version, with wait deferred to ASAP upload function:
    https://screenshot.googleplex.com/GHjD0U3C34q.png

Bug: skia:
Change-Id: I3d5a230bbd68eb35e1f0574b308485c691435790
Reviewed-on: https://skia-review.googlesource.com/36560
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-08-24 15:22:57 +00:00
Brian Salomon
a184ac7e0c Revert "Revert "Revert "Add GrTextureOp and use to implement SkGpuDevice::drawImage[Rect]() when possible"""
This reverts commit 20af6d12ee.

Performance regressions on Android and Flutter
Change-Id: If70edbe85aa251f298eddf18a89ba2cf56ed94fb
Reviewed-on: https://skia-review.googlesource.com/37340
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-08-22 21:36:40 +00:00
Brian Osman
5929f5c0a5 Add "none" option for --pr, to force software path renderer
There was no way to get this behavior without triggering an error before.

Bug: skia:
Change-Id: Id9cb9090e47226dadad0032f06ec205dd2538dcc
Reviewed-on: https://skia-review.googlesource.com/37001
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-08-22 17:13:37 +00:00
Brian Salomon
20af6d12ee Revert "Revert "Add GrTextureOp and use to implement SkGpuDevice::drawImage[Rect]() when possible""
This reverts commit ceef4fb5c4.

Bug: skia:
Change-Id: I50b738169b4cf9e06cbe0b5fad0234b506717b66
Reviewed-on: https://skia-review.googlesource.com/36201
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-08-18 14:37:09 +00:00
Brian Osman
de3b710913 Cache the results of get_pixel_formats_to_try
Choosing pixel formats is quite slow (depending on driver?). We were
doing this once per context, and it added up. On my desktop windows
machine, this saves another 7 seconds in `dm --config gl --src gm`.

Actual times:
  37s -> 30s (not writing PNGs)
  47s -> 39.5s (writing PNGs)

We always called this with MSAA sample count set to zero, so I cleaned
up the code to make that clearer. Also included a comment about the
theoretical risk, although I think that outside of a multi-GPU system,
we're fine.

Bug: skia:
Change-Id: I50927ebfaf6fe8d88a63674427fbf9e06e4ab059
Reviewed-on: https://skia-review.googlesource.com/35763
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-08-18 13:29:49 +00:00
Brian Salomon
ceef4fb5c4 Revert "Add GrTextureOp and use to implement SkGpuDevice::drawImage[Rect]() when possible"
This reverts commit 3fd295550f.

Reason for revert: breaking things

Original change's description:
> Add GrTextureOp and use to implement SkGpuDevice::drawImage[Rect]() when possible
> 
> This op draws a texture rectangle in src over blending with no edge antialiasing. It less powerful than NonAAFillRectOp/GrPaint but has less CPU overhead.
> 
> Change-Id: Ia6107bb67c1c2a83de14c665aff64b0de2750fba
> Reviewed-on: https://skia-review.googlesource.com/33802
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: I9cdbeeac15b17d2d6b3385560ed826397c0373c6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/36220
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-08-18 13:06:00 +00:00
Brian Salomon
3fd295550f Add GrTextureOp and use to implement SkGpuDevice::drawImage[Rect]() when possible
This op draws a texture rectangle in src over blending with no edge antialiasing. It less powerful than NonAAFillRectOp/GrPaint but has less CPU overhead.

Change-Id: Ia6107bb67c1c2a83de14c665aff64b0de2750fba
Reviewed-on: https://skia-review.googlesource.com/33802
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-08-18 12:47:28 +00:00
Brian Salomon
194db176c9 Add ANGLE support to Viewer on Windows
Change-Id: I97a844b2f289d2518f60a64f94d60551c4530dd4
Reviewed-on: https://skia-review.googlesource.com/35742
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-08-17 18:58:21 +00:00
Brian Osman
b6f8212bff Optimize the size of our JSON
Catapult (Chrome tracing) has a hard upper limit of 256 MB of JSON data.
This is independent of the number of events, because V8 can't store a
single string longer than that. Before these changes, longer traces
(eg all GL GMs, which was my test case) would be much larger (306 MB).

This CL includes four changes that help to reduce the text size:

1) Offset timestamps (saved 7.3 MB)
2) Limit timestamps and durations to 3 digits (saved 10.7 MB)
3) Shorten thread IDs (saved 7.2 MB)
4) Omit categories from JSON (saved 25.7 MB)

Note that category filtering still works, this just prevents us from
writing the categories to the JSON, which was of limited value.

At this point, my 306 MB file is now 255.3 MB, and loads.

Bug: skia:
Change-Id: Iaafc84025ddd52904f1ce9c1c2e9cbca65113079
Reviewed-on: https://skia-review.googlesource.com/35523
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-08-17 11:51:26 +00:00
Ravi Mistry
af10923819 Create new set of SVGs
Context is in the below bug

Bug: skia:6918
Change-Id: Ic9048311092bd7e73dd6ee182e79abea79baa07a
Reviewed-on: https://skia-review.googlesource.com/30586
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
2017-08-16 15:42:55 +00:00
Ben Wagner
b4aab9ae6d Replace SkFAIL with SK_ABORT.
SkFAIL is a legacy macro which is just SK_ABORT. This CL mechanically
changes uses of SkFAIL to SK_ABORT in preparation for its removal. The
related sk_throw macro will be changed independently, due to needing to
actually clean up its users.

Change-Id: Id70b5c111a02d2458dc60c8933f444df27d9cebb
Reviewed-on: https://skia-review.googlesource.com/35284
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-08-16 15:37:54 +00:00
Brian Osman
c7f2676ba0 Record all trace event data inline, with variable sized entries
Removes the need for strdup with copied strings, paves the way for
more (and richer) payload, and shrinks the average event way down.

Bug: skia:
Change-Id: I9604fe713c34cfc877dce84563af89c579abd65b
Reviewed-on: https://skia-review.googlesource.com/35166
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-08-16 15:32:44 +00:00
Robert Phillips
4c72b266da Add Chinese fling sample
Change-Id: Id27877c4d816ec83460f50a3a0d9cc0299ea6849
Reviewed-on: https://skia-review.googlesource.com/34780
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-08-16 13:45:57 +00:00
Mike Klein
042357b6ed Add missing #include <stdlib.h>
After turning on exceptions in test tools,
iOS builds of ok started saying atoi() was not declared.

I don't even want to know.

Change-Id: I52f354a1f25ec042bf2161a4c5dd9276aa25e46a
Reviewed-on: https://skia-review.googlesource.com/34961
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-08-16 02:19:37 +00:00
Mike Klein
135a1b10fe upstream cr/165303354
The only interesting difference here is that I've just skipped
cd_Documents() on Google3 iOS builds rather than adding a new target to
BUILD.  We don't run the binary so it's kind of moot what directory it'd
run in.

Change-Id: I1994e0283d24bcc505fa9b2b7b58307eafa5be92
Reviewed-on: https://skia-review.googlesource.com/34742
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-08-15 22:00:57 +00:00
Mike Klein
6dda584128 remove monobench
I'm betting big on ok bench.  This is a forcing function.

Change-Id: I8c359b7d712e16f8f0cbb90591801e0014073288
Reviewed-on: https://skia-review.googlesource.com/33660
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-08-11 19:02:56 +00:00
Mike Klein
4f6e271596 ok, add a bench source
This new source acts like other sources (GMs, SKPs) for benchmarks.  It
times multiple samples (controlled by samples=N, default 20), and each
of those samples uses the same strategy as monobench, growing loops
exponentially until it runs for at least 10ms.

When done it prints the fastest and the two slowest samples.  In
practice the 100th percentile sample is very different from the
next slowest due to caching, and the fastest is always interesting.

Because these benchmarks run in whatever execution engine ok has
selected, on non-Windows platforms you have some real control over the
interaction between benchmarks.  In its default "fork" mode each
benchmark runs independently in its own process, so the 100th
percentiles really stand out.  The other modes "thread" and "serial"
work as you'd expect too.

Here's an example where you can see how the different interactions work:

out/ok bench:samples=100 8888 filter:search=text_16_AA fork
    [text_16_AA_WT] 2.32µs  @0  6.23µs  @99 24.3ms  @100
    [text_16_AA_FF] 2.41µs  @0  5.7µs   @99 23.3ms  @100
    [text_16_AA_88] 2.55µs  @0  5.6µs   @99 24.8ms  @100
    [text_16_AA_BK] 1.97µs  @0  5.44µs  @99 23.2ms  @100

out/ok bench:samples=100 8888 filter:search=text_16_AA thread
    [text_16_AA_FF] 2.45µs  @0  23.5µs  @99 24.8ms  @100
    [text_16_AA_WT] 2.52µs  @0  17.8µs  @99 24.7ms  @100
    [text_16_AA_88] 2.55µs  @0  19.7µs  @99 25.1ms  @100
    [text_16_AA_BK] 1.8µs   @0  14.7µs  @99 25.1ms  @100

out/ok bench:samples=100 8888 filter:search=text_16_AA serial
    [text_16_AA_88] 2.35µs  @0  3.53µs  @99 16.7ms  @100
    [text_16_AA_FF] 2.09µs  @0  2.73µs  @99 2.91µs  @100
    [text_16_AA_BK] 1.75µs  @0  2.46µs  @99 2.65µs  @100
    [text_16_AA_WT] 2.1µs   @0  3.16µs  @99 3.17µs  @100

In the first "fork" case all runs are independent and have roughly
the same profile.  "thread" looks similar except you can see them
contending at the 99th percentile.  In "serial", the first bench
warms up the rest, so their 100th percentiles are all much faster.

Change-Id: I01a9f8c54b540221a9f232b271bb8ef3fda2569c
Reviewed-on: https://skia-review.googlesource.com/33585
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-08-11 15:32:36 +00:00
Mike Klein
c2f876bb8d Replace interp() with clut_{3,4}D stages.
I tried to follow exactly the same strategy as a start.
(Though I did fix the off-by-one dimensions.)

It does rather look like we only need 3D and 4D now
that I've looked at the call sites.

Looks like about a 20% speedup.

Change-Id: I8b1af64750ad1750716ee1ab0767e64591c7206a
Reviewed-on: https://skia-review.googlesource.com/32842
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-08-10 14:34:35 +00:00
Brian Osman
69fd008199 Added SkJSONWriter
This is a stand-alone helper class for writing properly
structured JSON to an SkWStream. It currently solves two
problems (although this CL only uses it in one context):

1) Performance. Writing out JSON this way is about 10x
faster than using JSONCPP. For the large amounts of data
generated by the tracing system, that's a big win.

2) Makes it easy to emit structured JSON from code that's
not fully centralized. We'd like to spit out JSON that
describes a GrContext, GrGpu, GrCaps, etc... Doing that
with simple string manipulation is complex, and spreads
this logic over all those functions. Using JSONCPP adds
yet another (large) third party library dependency (that
we only build into our own tools right now).

This went through several revisions. I originally planned
it as a stateful SkString wrapper, so the user could just
build their JSON as a string. That's O(N^2), though,
because SkString grows by a (small) constant amount. Even
using a better growth strategy still means needing RAM
for all the resulting text, which is usually pointless.
This version has a constant memory cost, so writing huge
amounts of JSON to disk (tracing a long DM run can emit
100's of MBs) doesn't stress resources.

Bug: skia:
Change-Id: Ia716524b246db0f97d332da60d2ce9903069e748
Reviewed-on: https://skia-review.googlesource.com/31204
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-08-09 13:46:24 +00:00
Mike Reed
5a625e08f0 add tool_util to compare images
Bug: skia:
Change-Id: I826190aa15cf42a3ca7f3c7d5271ead5b514c116
Reviewed-on: https://skia-review.googlesource.com/32220
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-08-08 20:07:32 +00:00
Mike Reed
bdc3afa577 simplify gm matrices
rm gm that appears to have been there solely for pdf, but we don't use
it for that now.

Bug: skia:
Change-Id: I3cf88db923c2445b7c95dda14da679a594117643
Reviewed-on: https://skia-review.googlesource.com/31760
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2017-08-08 12:43:19 +00:00
Yuqian Li
399b3c2a01 Add AAA and DAA toggles to viewer
Bug: skia:
Change-Id: I0ee397d2b2c81a25918cb28be426cf5162da772f
Reviewed-on: https://skia-review.googlesource.com/30561
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Yuqian Li <liyuqian@google.com>
2017-08-07 15:09:59 +00:00
Robert Phillips
6dd8cf144e Remove SkLightingShader and associated classes
Change-Id: I8050414c30dfdb5df23ca79955adc5ba3a29d3f5
Reviewed-on: https://skia-review.googlesource.com/31140
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-08-07 13:33:49 +00:00
Cary Clark
4c06f5ee08 fix links and missing constructor
Docs-Preview: https://skia.org/?cl=31145
Bug: skia: 6898
Change-Id: Ic94a15551f3683d9de5d3bda53394d2efce0d6a4
Reviewed-on: https://skia-review.googlesource.com/31145
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2017-08-04 17:25:24 +00:00
Cary Clark
bad5ad7d60 canvas include checkpoint
All fixes to bookmaker to allow creating SkCanvas.h

Docs-Preview: https://skia.org/?cl=29022
TBR=caryclark@google.com
Bug: skia: 6898
Change-Id: If10638fbc77cfe680f21868c97f9c0643b87ebf9
Reviewed-on: https://skia-review.googlesource.com/29022
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2017-08-03 21:36:08 +00:00
Yuqian Li
49fd5d5b74 Disable Delta AA for MSVC for now
Perf showed that DAA is slow with MSVC. Disable it until I find
out why.

Bug: skia:
Change-Id: If30c24e97fa42e3a7ce143a1b1d06e4a3f278d13
TBR: mtklein@google.com
Reviewed-on: https://skia-review.googlesource.com/30584
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Yuqian Li <liyuqian@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
2017-08-03 17:26:27 +00:00
Brian Osman
b6705c2536 Add support for object creation/snapshot/deletion events
- Bring back some previously deleted macros and helper types.
- Automatically inject base_type information into snapshot events,
  to allow simpler tracking of polymorphic object types.
- Fix JSON formatting of pointer values (they were serializing as bool).

Bug: skia:
Change-Id: Iac7803f72ce5396ffd2fbcb5a36d76745c5e3f3e
Reviewed-on: https://skia-review.googlesource.com/28220
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-08-03 17:10:08 +00:00
Ravi Mistry
698edfecef Chromium lkgr is no longer updated. Use lkcr
Bug: skia:6916
Change-Id: I16badf80c3b34e517b8baab161150c9434f325aa
Reviewed-on: https://skia-review.googlesource.com/30100
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
2017-08-03 12:41:36 +00:00