aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/ok_srcs.cpp
Commit message (Collapse)AuthorAge
* Add missing #include <stdlib.h>Gravatar Mike Klein2017-08-16
| | | | | | | | | | | | 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>
* ok, add a bench sourceGravatar Mike Klein2017-08-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* simplify gm matricesGravatar Mike Reed2017-08-08
| | | | | | | | | | | | 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>
* Revert "Revert "Reland: Remove SkLights include from SkCanvas.h""Gravatar Florin Malita2017-05-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 9d5f66d9c21eda7d3e2ed47654180c0c4b6e38b1. Reason for revert: Leon landed Android fixes. Original change's description: > Revert "Reland: Remove SkLights include from SkCanvas.h" > > This reverts commit fed00319c9bafa41c8df658708030c072b301a41. > > Reason for revert: breaking the Android roll. > > Original change's description: > > Reland: Remove SkLights include from SkCanvas.h > > > > SkLights.h pulls in a bunch of other headers and is not needed (fwdecl > > works fine). > > > > Change-Id: I3ed97cd7861e51dcb7cfa7950a97b420dbc6fbfb > > TBR=reed@google.com > > Reviewed-on: https://skia-review.googlesource.com/15143 > > Commit-Queue: Florin Malita <fmalita@chromium.org> > > Reviewed-by: Florin Malita <fmalita@chromium.org> > > > > TBR=fmalita@chromium.org,reed@google.com > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > > Change-Id: I3b0e69f1d04d160f16a5567b09982d35cc9ca84e > Reviewed-on: https://skia-review.googlesource.com/15195 > Reviewed-by: Florin Malita <fmalita@chromium.org> > Commit-Queue: Florin Malita <fmalita@chromium.org> > TBR=msarett@google.com,reviews@skia.org,fmalita@chromium.org,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I0a1c2f9df61f16987ab72dfb4f3a205fbcc37667 Reviewed-on: https://skia-review.googlesource.com/15229 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Revert "Reland: Remove SkLights include from SkCanvas.h"Gravatar Florin Malita2017-05-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit fed00319c9bafa41c8df658708030c072b301a41. Reason for revert: breaking the Android roll. Original change's description: > Reland: Remove SkLights include from SkCanvas.h > > SkLights.h pulls in a bunch of other headers and is not needed (fwdecl > works fine). > > Change-Id: I3ed97cd7861e51dcb7cfa7950a97b420dbc6fbfb > TBR=reed@google.com > Reviewed-on: https://skia-review.googlesource.com/15143 > Commit-Queue: Florin Malita <fmalita@chromium.org> > Reviewed-by: Florin Malita <fmalita@chromium.org> > TBR=fmalita@chromium.org,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I3b0e69f1d04d160f16a5567b09982d35cc9ca84e Reviewed-on: https://skia-review.googlesource.com/15195 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Reland: Remove SkLights include from SkCanvas.hGravatar Florin Malita2017-05-03
| | | | | | | | | | | SkLights.h pulls in a bunch of other headers and is not needed (fwdecl works fine). Change-Id: I3ed97cd7861e51dcb7cfa7950a97b420dbc6fbfb TBR=reed@google.com Reviewed-on: https://skia-review.googlesource.com/15143 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Revert "Remove SkLights include from SkCanvas.h"Gravatar Florin Malita2017-05-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 9ff301bf918cd85d9f67047f10631b7a74345a90. Reason for revert: need to update G3, Flutter. Original change's description: > Remove SkLights include from SkCanvas.h > > SkLights.h pulls in a bunch of other headers and is not needed (fwdecl > works fine). > > Change-Id: Id2d7176eb3bf4609f72f46d513eebf59318f542f > Reviewed-on: https://skia-review.googlesource.com/14904 > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Florin Malita <fmalita@chromium.org> > TBR=mtklein@google.com,fmalita@chromium.org,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I4799ad5b31aaeaf529c8b912bbe09aa8869a5e6c Reviewed-on: https://skia-review.googlesource.com/15107 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Remove SkLights include from SkCanvas.hGravatar Florin Malita2017-05-02
| | | | | | | | | | SkLights.h pulls in a bunch of other headers and is not needed (fwdecl works fine). Change-Id: Id2d7176eb3bf4609f72f46d513eebf59318f542f Reviewed-on: https://skia-review.googlesource.com/14904 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* ok, most features can be viasGravatar Mike Klein2017-03-31
| | | | | | | | | | | | | This refactors most features out of ok's core into vias: -w --> a .png dumping via, "png", opening the door to other types -m/-s --> a filtering via "filter" Everything now can print a brief help message too. Change-Id: I9e653aab98fd57182a6d458c7a80052130980284 Reviewed-on: https://skia-review.googlesource.com/10509 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* ok: refactor Src/Dst interactionsGravatar Mike Klein2017-03-25
| | | | | | | | | | | | | | | | | | | | | | | | This makes everything a lot more like DM, for the same reason: it's the best way to make Vias work. Instead of exposing a canvas, Dsts take a Src to draw. Vias still are Dsts that wrap Dsts. They do their internal work in draw() then pass a proxy Src encapsulating that work to the next Dst's draw(). A little refactoring in ok.cpp allows arbitrary chains of Vias. I removed the guarantee that Src methods are called in strict order. It's easy enough to make each Src initialize itself as needed. I moved the .png encoding back to ok.cpp. It seemed weird for Dsts to have to think about files and paths. One day Dst will want a data() method for non-image output (.pdf, .skp), and then we'll want ok.cpp to be the one to coordinate what to write where. Change-Id: Id4a3674b2d05aef2b5f10e0077df0a8407c07b61 Reviewed-on: https://skia-review.googlesource.com/10175 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Spin off non-core parts of ok into their own files.Gravatar Mike Klein2017-03-25
Now ok.cpp handles only the high level coordination of Srcs and Dsts, without having to know or care what they are. Some minor refactoring to things like Options. Change-Id: I02df890b26d6d069e980a125b6a1ce1a7067b900 Reviewed-on: https://skia-review.googlesource.com/10173 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>