Commit Graph

10 Commits

Author SHA1 Message Date
Kevin Lubick
7ce380e967 [canvaskit] Remove deprecated MakeTypefaceFromData and RefDefault
Change-Id: I0072fa5c11834a6250f2f5b9290ecea0d30f2128
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/462177
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-10-21 16:45:42 +00:00
Kevin Lubick
bd7ed7434a [canvaskit] Fix font.getGlyphID test
The previous version accidentally retrieved all values from
the in memory glyph cache because it was always measuring
the range 1-300. This changes the glyphID to always be an
increasing number, which avoids the cache hits.

There is now some differences between the font types:
 - ttf: ~4ms
 - woff: ~160ms
 - woff2: ~230ms

The high numbers in the woff categories are expected to be
fixed by https://skia-review.googlesource.com/c/skia/+/420578

Bug: skia:12112
Change-Id: I52f6f7baf27fc28b99ac65a067142281918d7298
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/421324
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-06-24 18:27:49 +00:00
Kevin Lubick
0ba3bbf778 [canvaskit] Add perf tests for different font formats
As is, all 3 formats have a median time of about 0.12 milliseconds.

Perhaps the performance hit is more strongly felt on larger font
files.

Bug: skia:12112
Change-Id: Ifb4b0aa5a8240d93e94f4b674d0a50e6009887ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420097
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-06-22 12:09:50 +00:00
Kevin Lubick
54c1b3dd43 [canvaskit] Remove Sk from nearly all function/type names.
This is a massive breaking change for all existing users of CanvasKit.

It will be (one of the only) changes in 0.19.0 to make the transition
easier.

Suggested reviewing order:
 - index.d.ts (to see type changes). Notice SkPicture still has Sk
   prefix, but no other types do (this felt "right" since Sk is
   part of the name of the type, but I can be swayed on this).
 - canvaskit-wasm-tests.ts
 - tests/*.spec.js
 - interface.js and helper.js
 - html examples
 - markdown files

Change-Id: I3b3d3815df2078f986893df3c70101d6248c117d
Docs-Preview: https://skia.org/?cl=322617
Bug: skia:10717
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322617
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-10-07 21:01:32 +00:00
Kevin Lubick
a1c2117004 [canvaskit] Add drawRect4f as example 'fast path' API
I added 3 tests, one using the drawRect API naively,
one using drawRect with a Malloc'd array, and one using
the drawRect4f.

rough local measurements:
 - [baseline with tip of tree code]: 50ms
 - naive drawRect: 40ms
 - drawRect with malloc: 28ms
 - drawRect4f: 27ms

I also tried the benchmarks locally with taking in paint
as a const reference. I did not see any changes, but that
could just be small sample size. I plan to land the code
as is for now, collect a bit of data in Perf and then try
landing the const reference stuff and see if we get
something measurable.

To aid this, I added in a helper list of tests to only run
some benchmarks easily.

Change-Id: I2d8c5296e93f05be45fc12059955fb9d9e339d83
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315143
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-09-03 14:53:42 +00:00
Michael Ludwig
55289ae4c6 Revert "[canvaskit] Add drawRect4f as example 'fast path' API"
Revert submission 314622

Reason for revert: breaking wasm bots
Reverted Changes:
Ia1ba13814:[canvaskit] Replace RRect objects with TypedArrays...
Ib80b15e2d:[canvaskit] Change SkRects to be arrays, not objec...
I790b2d6fc:[canvaskit] Add drawRect4f as example 'fast path' ...

Change-Id: I295791532a2d27bff41f706fa8ed37e0499c27d7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314892
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-09-02 21:21:20 +00:00
Kevin Lubick
2753b12ff5 [canvaskit] Add drawRect4f as example 'fast path' API
I added 3 tests, one using the drawRect API naively,
one using drawRect with a Malloc'd array, and one using
the drawRect4f.

rough local measurements:
 - [baseline with tip of tree code]: 50ms
 - naive drawRect: 40ms
 - drawRect with malloc: 28ms
 - drawRect4f: 27ms

I also tried the benchmarks locally with taking in paint
as a const reference. I did not see any changes, but that
could just be small sample size. I plan to land the code
as is for now, collect a bit of data in Perf and then try
landing the const reference stuff and see if we get
something measurable.

To aid this, I added in a helper list of tests to only run
some benchmarks easily.

Change-Id: I790b2d6fc32c125a4d371768fffb19ab22633d4e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314622
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-09-02 20:10:30 +00:00
Nathaniel Nifong
18423cd5b3 Add more perf tests and other minor improvemnts
Change-Id: I2da6d2da2cb0dd938d04d0b872be7fc5f2a91d6d
Docs-Preview: https://skia.org/?cl=308787
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308787
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-08-10 15:23:53 +00:00
Nathaniel Nifong
2c4a07d925 allow external files in canvas_perf.js tests
Change-Id: Id4d143605bfa73672130c839cf54eec2b23217d7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308233
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-08-06 20:27:32 +00:00
Nathaniel Nifong
7839a2599f A puppeteer test that runs karma-like tests
Change-Id: Iedd98c03ba9d56b64390ffea23a50c945be9aff3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305557
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Elliot Evans <elliotevans@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-07-29 15:38:56 +00:00