Commit Graph

2306 Commits

Author SHA1 Message Date
Brian Salomon
9241a6d394 Reland "Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime""
This is a reland of 6fc04f88a8

Original change's description:
> Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime"
> 
> This is a reland of ce240cc6fd
> 
> Original change's description:
> > SkSurface asynchronous read APIs allow client to extend pixel lifetime
> > 
> > Previously the pixel data passed to the client was only valid during
> > the client's callback. This meant if the client wanted to defer
> > processing of the data a copy was necessary.
> > 
> > Now we pass an object to the callback and the pixel lifetime is tied
> > to the lifetime of that object.
> > 
> > The object may be holding a GPU transfer buffer mapped. We don't assume
> > that the object will be released on the direct GrContext thread. So
> > when the object is destroyed it posts a message to a new type,
> > GrClientMappedBufferManager, hanging off the direct context. The direct
> > context will periodically check for messages and unmap and then unref
> > buffers so that they can be reused. Currently this is done in
> > GrContext::performDeferredCleanup() and GrDrawingManager::flush().
> > 
> > The old API is kept around for backwards compatibility but it is
> > reimplemented as a bridge on top of the new mechanism.
> > 
> > Also a utility function to SkImageInfo is added to directly make a new
> > info with a specified dimensions rather than passing the width and
> > height separately to makeWH().
> > 
> > Bug: chromium:973403
> > Bug: skia:8962
> > 
> > Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> 
> Bug: chromium:973403, skia:8962
> Change-Id: I5cecd36276c8b6dc942cf549c7095db2df88530c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245678
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: chromium:973403, skia:8962
Change-Id: Ie584c1c3ef8021c976f71b708e53871c693cc450
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/246057
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-10-03 19:14:22 +00:00
Ravi Mistry
cb55010652 Revert "Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime""
This reverts commit 6fc04f88a8.

Reason for revert: Chrome roll failure suspect because of:
* https://chromium-review.googlesource.com/c/chromium/src/+/1837131 (22 commits)
* https://chromium-review.googlesource.com/c/chromium/src/+/1837214 (24 commits)

Original change's description:
> Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime"
>
> This is a reland of ce240cc6fd
>
> Original change's description:
> > SkSurface asynchronous read APIs allow client to extend pixel lifetime
> >
> > Previously the pixel data passed to the client was only valid during
> > the client's callback. This meant if the client wanted to defer
> > processing of the data a copy was necessary.
> >
> > Now we pass an object to the callback and the pixel lifetime is tied
> > to the lifetime of that object.
> >
> > The object may be holding a GPU transfer buffer mapped. We don't assume
> > that the object will be released on the direct GrContext thread. So
> > when the object is destroyed it posts a message to a new type,
> > GrClientMappedBufferManager, hanging off the direct context. The direct
> > context will periodically check for messages and unmap and then unref
> > buffers so that they can be reused. Currently this is done in
> > GrContext::performDeferredCleanup() and GrDrawingManager::flush().
> >
> > The old API is kept around for backwards compatibility but it is
> > reimplemented as a bridge on top of the new mechanism.
> >
> > Also a utility function to SkImageInfo is added to directly make a new
> > info with a specified dimensions rather than passing the width and
> > height separately to makeWH().
> >
> > Bug: chromium:973403
> > Bug: skia:8962
> >
> > Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
>
> Bug: chromium:973403, skia:8962
> Change-Id: I5cecd36276c8b6dc942cf549c7095db2df88530c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245678
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: I9e01d1b82fb399b94292441d91da51176bb161d9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:973403, skia:8962
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245956
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2019-10-03 09:19:24 +00:00
Brian Salomon
6fc04f88a8 Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime"
This is a reland of ce240cc6fd

Original change's description:
> SkSurface asynchronous read APIs allow client to extend pixel lifetime
> 
> Previously the pixel data passed to the client was only valid during
> the client's callback. This meant if the client wanted to defer
> processing of the data a copy was necessary.
> 
> Now we pass an object to the callback and the pixel lifetime is tied
> to the lifetime of that object.
> 
> The object may be holding a GPU transfer buffer mapped. We don't assume
> that the object will be released on the direct GrContext thread. So
> when the object is destroyed it posts a message to a new type,
> GrClientMappedBufferManager, hanging off the direct context. The direct
> context will periodically check for messages and unmap and then unref
> buffers so that they can be reused. Currently this is done in
> GrContext::performDeferredCleanup() and GrDrawingManager::flush().
> 
> The old API is kept around for backwards compatibility but it is
> reimplemented as a bridge on top of the new mechanism.
> 
> Also a utility function to SkImageInfo is added to directly make a new
> info with a specified dimensions rather than passing the width and
> height separately to makeWH().
> 
> Bug: chromium:973403
> Bug: skia:8962
> 
> Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: chromium:973403, skia:8962
Change-Id: I5cecd36276c8b6dc942cf549c7095db2df88530c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245678
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-10-03 01:41:35 +00:00
Brian Salomon
9c219785a8 Revert "SkSurface asynchronous read APIs allow client to extend pixel lifetime"
This reverts commit ce240cc6fd.

Reason for revert: crashing in chrome unit test, abandoned context related?

Original change's description:
> SkSurface asynchronous read APIs allow client to extend pixel lifetime
> 
> Previously the pixel data passed to the client was only valid during
> the client's callback. This meant if the client wanted to defer
> processing of the data a copy was necessary.
> 
> Now we pass an object to the callback and the pixel lifetime is tied
> to the lifetime of that object.
> 
> The object may be holding a GPU transfer buffer mapped. We don't assume
> that the object will be released on the direct GrContext thread. So
> when the object is destroyed it posts a message to a new type,
> GrClientMappedBufferManager, hanging off the direct context. The direct
> context will periodically check for messages and unmap and then unref
> buffers so that they can be reused. Currently this is done in
> GrContext::performDeferredCleanup() and GrDrawingManager::flush().
> 
> The old API is kept around for backwards compatibility but it is
> reimplemented as a bridge on top of the new mechanism.
> 
> Also a utility function to SkImageInfo is added to directly make a new
> info with a specified dimensions rather than passing the width and
> height separately to makeWH().
> 
> Bug: chromium:973403
> Bug: skia:8962
> 
> Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: Ic14cf07a7629b167c9f34a651aa87a0326e74207
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:973403, skia:8962
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245721
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-10-02 22:51:15 +00:00
Brian Salomon
ce240cc6fd SkSurface asynchronous read APIs allow client to extend pixel lifetime
Previously the pixel data passed to the client was only valid during
the client's callback. This meant if the client wanted to defer
processing of the data a copy was necessary.

Now we pass an object to the callback and the pixel lifetime is tied
to the lifetime of that object.

The object may be holding a GPU transfer buffer mapped. We don't assume
that the object will be released on the direct GrContext thread. So
when the object is destroyed it posts a message to a new type,
GrClientMappedBufferManager, hanging off the direct context. The direct
context will periodically check for messages and unmap and then unref
buffers so that they can be reused. Currently this is done in
GrContext::performDeferredCleanup() and GrDrawingManager::flush().

The old API is kept around for backwards compatibility but it is
reimplemented as a bridge on top of the new mechanism.

Also a utility function to SkImageInfo is added to directly make a new
info with a specified dimensions rather than passing the width and
height separately to makeWH().

Bug: chromium:973403
Bug: skia:8962

Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-10-02 19:20:08 +00:00
Greg Daniel
5faf474fab More bounds fixes for StrokeRect and DefaultPath when using MSAA for non-aa.
Change-Id: Ia9c2a47675eac8f3ac1220c0e1089766aa141fc1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245364
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-10-01 19:49:15 +00:00
Brian Salomon
4bc0c1fc4b Rename GrColorSpaceInfo -> GrColorInfo
Add version SkImageInfo::Make() that takes SkISize instead of separate
width and height.

Change-Id: I42aa79d23b19e22f5405631728c245b04bce0559
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245172
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-09-30 21:53:24 +00:00
Brian Osman
b23d66e10a Interpreter: Lots of minor cleanup/refactoring
- Update the parameter lists to both run and runStriped so
  that they're in the same (sane) order, named consistently,
  and always take counts with pointer arguments.
- Add the same count-based safety checks to run that were
  already in runStriped.
- Remove the N parameter to run, it was only used to run
  things one-at-a-time (other than one spot in unit tests),
  and it simplifies the code quite a bit. If you want to run
  multiple times, use the striped version. I also moved that
  functions 'N' earlier in the parameter list, to make the
  pattern of the remaining parameters clearer.
- Remove an interpreter benchmark class that was never used.

Change-Id: Ibff0a47bdb2d29d095a0addd27e65ab13cb80fce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244716
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-09-27 15:02:16 +00:00
Mike Reed
4241f5e0a8 Revert "add guard to switch to SkPathTypes"
This reverts commit e1af44498b.

Reason for revert: breaking google3?

Original change's description:
> add guard to switch to SkPathTypes
> 
> Change-Id: I44d8b5ae8a5172d11a6d4cd9d994373dd3816d6f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241278
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=robertphillips@google.com,kjlubick@google.com,fmalita@chromium.org,reed@google.com

Change-Id: If1fffb6310921ee6f213af000da793afcf62ab0b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241560
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-09-14 19:13:44 +00:00
Mike Reed
e1af44498b add guard to switch to SkPathTypes
Change-Id: I44d8b5ae8a5172d11a6d4cd9d994373dd3816d6f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241278
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-09-14 01:26:38 +00:00
Robert Phillips
de4456f6f2 Add bench for SkDDLRecorder detach
On Windows I'm getting:

curr/maxrss	loops	min	median	mean	max	stddev	samples   	config	bench
  33/38  MB	1495	2.62us	2.65us	2.66us	2.72us	1%	.o.o.oO.OO	gl	DDLRecorder

Change-Id: I529e6ac612c455915c166472124b08647eb7bffd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241039
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-09-12 17:09:08 +00:00
Robert Phillips
cf39f375d1 Remove maxCount resource cache limit
Change-Id: I0f1064c8433d69e24ca3d5b970c99d539dc1dadd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238442
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-03 14:59:51 +00:00
Florin Malita
922e2254b1 Add a colortype conversion bench
curr/maxrss	loops	min	median	mean	max	stddev	samples   	config	bench
  46/46  MB	4	65.4µs	65.5µs	67.1µs	75.5µs	5%	█▅▁▁▁▁▁▁▁▁	nonrendering	ctconvert_4_4_readpixels
  46/46  MB	3	80.4µs	80.7µs	82.2µs	93.8µs	5%	█▁▁▁▂▁▁▁▁▁	nonrendering	ctconvert_4_4_drawbitmap
  46/46  MB	3	76.5µs	76.6µs	80.5µs	93.4µs	8%	▇▁▁▁▁▁█▄▁▂	nonrendering	ctconvert_4_6_readpixels
  46/46  MB	2	155µs	155µs	157µs	174µs	4%	█▁▁▁▁▁▁▁▁▁	nonrendering	ctconvert_4_6_drawbitmap

Change-Id: Ib53f76a289ee101a85054d773cadcea475baf280
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237141
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2019-08-26 15:41:54 +00:00
Mike Reed
92b33354dd more rect api simplifications
set --> setLTRB
set(pts, count) --> setBounds

Bug: skia:9328
Change-Id: I807c0598a8b23b2f721db118ec41c1607114205a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237038
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-08-25 10:12:57 +00:00
Brian Salomon
bf6b9795f6 GrSurfaceContext not ref counted.
Also don't specify redundant width/height to SkGpuDevice.

Change-Id: I389df5c4b073c2c05632ba6b7c95b02a22dfaf98
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235824
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-08-21 15:31:23 +00:00
Mike Reed
147b6642ac improve verts bench
- exercise different options
- reduce triangle sizes to emphasize overhead (small triangles is also common)

Change-Id: I24ff889cdeeba136349b3a855c6b5881109e2a88
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235461
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-08-21 15:04:37 +00:00
Mike Reed
8f3bd77699 make pathiter bench a little more realistic
Touch the memory that the iterator returns, so we're (slightly) more
sure the compiler isn't eliding code we want to be timing.

Change-Id: I62eb36759413d83fb18f4a6e0bf23d4d98f11999
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235860
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-08-20 18:19:55 +00:00
Mike Reed
5f152f0745 add path-edger; lightweight Iter for edges
4.07  	pathiter_edge	nonrendering
      6.74  	pathiter_raw	nonrendering
      9.16  	pathiter_iter	nonrendering

Change-Id: Id711b342fbac6b4efd62ce918cf440b04973545c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235476
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-08-19 21:58:37 +00:00
Brian Osman
d566e2eab7 Remove unused dstColorSpace parameter from makeTextureImage
Old version still exists until client code is migrated.

Change-Id: I087b6b977f586d334f9a20954e7ed7b5e4b7ea5e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234579
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-08-14 19:09:05 +00:00
Ben Wagner
406ff500a4 Clean up some gm factory use.
Mostly use unique_ptr more consistently.

Change-Id: I6e11b272a7904eb662dea59b03fbc309a4cfc25d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233984
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-08-13 15:57:37 +00:00
Hal Canary
edda5653e1 gm: GMFactory returns a unique_ptr<>
Change-Id: If8a4d3cfdeaef58dd9924af430cfed834519b096
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232496
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-08-12 19:02:40 +00:00
Mike Reed
c2da70fbef expand drawAtlas bench to include rotations
We special-case unrotated shapes today (drawing rects instead of quads/paths).
This new bench shows that the rotated case is over 4x slow. Probably should
do something about that.

Change-Id: Ie80a42b981a1841f980c70a5f8f8a32357d764b7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233976
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-08-12 13:15:31 +00:00
Brian Salomon
74c19de3be Add SkUNREACHABLE to definition of SK_ABORT.
Remove return statements immediately following SK_ABORTs.

Change-Id: I6446b6ba3a6fb272d84ea27f38cf366095cf801d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233565
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-08-09 20:43:39 +00:00
Greg Daniel
6fa62e2ab3 Remove use of GrColorType on GrCaps::getRenderTargetSampleCount.
Additionally this changes removes the version of the call that that takes
a GrPixelConfig.

As part of this change many call sites that were calling getRTSampleCount
to just check renderability have been changed to call
isFormat[AsColorType]Renderable instead. This change has also started to
move us to just checking format renderability (without GrCT) in classes
that are specifically dealing with GrSurface (GrResourceProvider, GrGpu, etc.).

Bug: skia:6718
Change-Id: Icf4a1a21a81a44e6863a7cd2059d21b9833d581f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233039
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-08-08 13:15:28 +00:00
Mike Reed
560e9178bd specialize drawAtlas for raster backend
2x faster than calling drawVertices as the impl.

Lots more to do in future CLs
- much of the time is spent in malloc, as we cons-up private shaders.
  we *could* create a private shader and wack its data for each draw
  (breaking the immutable contract, but that may be ok for a raster-only
  internal-use shader...)
- also spend time building the pipeline for each draw, even though
  all that has changed is a color payload (and the ctm). A custome
  stage(s) that exposed its private data could be reused with new
  data...

Bug: skia:
Change-Id: I0ff15155e37c0af7931abd34c0883701a47a048a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203168
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-08-05 21:01:47 +00:00
Michael Ludwig
2300318551 Update benchmarks to use new filter factories
Also refactors 3 duplicate functions that converted an SkTileMode to
a char*. This will rename the matrix convolution benchmarks that used
"clampToBlack" to the more modern "decal" terminology.

Bug: skia:9280
Change-Id: I43a4f9edeba36eb5af1243f7e4ab7647253b91f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230883
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-05 16:41:25 +00:00
Mike Reed
76c6ff07fb fix bench to scale up, so we don't skip high-qual-filter
Change-Id: I387ace8f7f4eb455144f9a4c590abe405a01cf18
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231113
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-07-31 20:59:32 +00:00
Mike Reed
9dc0b9e2f8 remove code now that loopers are dead (w.r.t. canvas and paint)
We can't remove the loopers themselves, as they are still used
by android and chrome (they just don't ever pass them to skia).

Eventually each of those clients will resolve this, but for now
we just keep the classes (and tests) in skia.

Bug: skia:4783
Change-Id: I5f507e6bb82280f2bc7c0b21eebe59c287aa9265
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230579
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-07-30 12:49:28 +00:00
Ethan Nicholas
1386366e01 renamed SkSL texture() and process() to sample()
Bug: skia:
Change-Id: I2ae0caf08f8434302cae8151ae1ea0fda8d56928
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230397
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-07-29 17:37:38 +00:00
Mike Klein
52337de95c re-run tools/rewrite_includes.py
PS2 adds a rewrite for Skia #include <...> to #include "...", letting
them be otherwise rewritten and sorted too.  (We do need one exception
for the Vulkan headers, which will otherwise be rewritten to always
point to our own.)  I don't think it's particularly important to
favor "" or <>, but picking one keeps things consistent.

PS3 adds a missing SkMutex.h include.

PS4 fixes a terrible readability problem.

Change-Id: Id9fe752727ef30e802b1daf755ee2ed15e267577
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229742
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-07-25 15:40:33 +00:00
Julia Lavrova
5207f35f33 The current version...
Adding cache
Caching shaped results
Base+Index for referencing arrays
The very first and naive version of cache
Cache measurement, lines and picture
Added text blob cache for lines
Removed Run* from Cluster
Removed const char* from Cluster and Run
Few minor changes

Change-Id: I444a1defa950aed5999cfa1c3545fd83ccb54ce9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227840
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-07-23 13:31:39 +00:00
Mike Reed
b7dad44040 Reland "hide drawlooper from paint"
This reverts commit 6dc14ded91.

Reason for revert: add flag to google3

Original change's description:
> Revert "hide drawlooper from paint"
>
> This reverts commit 766b42b7ba.
>
> Reason for revert: afaict this is changing a lot of image filter GMs for the worse
>
> Original change's description:
> > hide drawlooper from paint
> >
> > Bug: skia: 4783
> >
> > Change-Id: I1d0ad1683a2e8345d8ea13db9b69b568ada827dc
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228573
> > Reviewed-by: Florin Malita <fmalita@chromium.org>
> > Commit-Queue: Mike Reed <reed@google.com>
>
> TBR=fmalita@chromium.org,reed@google.com
>
> Change-Id: I0bfd48ada3f8e48a774527caccf7abdb7a1cc470
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia: 4783
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229005
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=robertphillips@google.com,fmalita@chromium.org,reed@google.com

Change-Id: Ib3cd8941a63cd323b8872dd7fec1c953ab81cbdc
Bug: skia: 4783
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229010
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-07-22 20:03:36 +00:00
Robert Phillips
6dc14ded91 Revert "hide drawlooper from paint"
This reverts commit 766b42b7ba.

Reason for revert: afaict this is changing a lot of image filter GMs for the worse

Original change's description:
> hide drawlooper from paint
> 
> Bug: skia: 4783
> 
> Change-Id: I1d0ad1683a2e8345d8ea13db9b69b568ada827dc
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228573
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=fmalita@chromium.org,reed@google.com

Change-Id: I0bfd48ada3f8e48a774527caccf7abdb7a1cc470
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia: 4783
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229005
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-22 17:27:17 +00:00
Mike Reed
766b42b7ba hide drawlooper from paint
Bug: skia: 4783

Change-Id: I1d0ad1683a2e8345d8ea13db9b69b568ada827dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228573
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-07-22 16:25:41 +00:00
Brian Osman
869a3e81ea Reland "Interpreter: Bounds check array access, add bool return from run"
This is a reland of f42de9e1e5

Original change's description:
> Interpreter: Bounds check array access, add bool return from run
> 
> Out of bounds access with constant indices is a compile error.
> At runtime, causes the interpreter to fail. Made several other
> conditions trigger the same failure logic, and updated all
> uses of the interpreter to validate success.
> 
> Change-Id: I3720b3c83903220b010ec574121fc64dbe102378
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228256
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>

Change-Id: I8849de815f7efb730ac9c55b6edd296cb9ca7599
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228353
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-07-18 21:38:20 +00:00
Brian Osman
3e6aa9f528 Revert "Interpreter: Bounds check array access, add bool return from run"
This reverts commit f42de9e1e5.

Reason for revert: All the SANs

Original change's description:
> Interpreter: Bounds check array access, add bool return from run
> 
> Out of bounds access with constant indices is a compile error.
> At runtime, causes the interpreter to fail. Made several other
> conditions trigger the same failure logic, and updated all
> uses of the interpreter to validate success.
> 
> Change-Id: I3720b3c83903220b010ec574121fc64dbe102378
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228256
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>

TBR=mtklein@google.com,brianosman@google.com,ethannicholas@google.com,reed@google.com

Change-Id: I434601960d54fbd7d00e2af2dc6269a83a768c5b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228352
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-07-18 17:22:41 +00:00
Brian Osman
f42de9e1e5 Interpreter: Bounds check array access, add bool return from run
Out of bounds access with constant indices is a compile error.
At runtime, causes the interpreter to fail. Made several other
conditions trigger the same failure logic, and updated all
uses of the interpreter to validate success.

Change-Id: I3720b3c83903220b010ec574121fc64dbe102378
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228256
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-07-18 16:24:57 +00:00
Ben Wagner
acf98df7a1 Remove WallTimer class.
Only used in three somewhat dubious places.

Change-Id: I7ccd1aef41f826d0eb62606751f4d3f0ceda267d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227065
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-07-15 16:06:11 +00:00
Mike Klein
5b5dabcc56 make some SkVM benches uneven
N=15 and N=63 make for nice even looking profiles
on ARM and x86 respectively, with N=15 running 3
body loops and 3 tail loops on ARM, N=63 running
7 body loops and 7 tail loops on x86.

Change-Id: Ie7616bd99c949328bbb7d7048fc6f468ff1e3ad2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227220
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-15 02:38:26 +00:00
Brian Osman
4a47da7357 Interpreter: Disallow return statements inside loops or conditionals
These didn't work correctly, and they're extremely tricky to get right
in the vectorized execution model (vs. structured control flow). As a
side effect, determine the maximum stack depth used for the execution
masking - the same idea will be used for the primary stack in a later
CL. Add a unit test to verify the new restriction, and fix two places
that were relying on this feature before.

In addition, boolean external values need to be masks. I may implement
this in the code-gen at some point, but this is already a fringe
feature, so just fix the one unit test for now.

Change-Id: I9607ffaf67c7795dbf42e4009180aea8f3e65c44
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226849
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-07-12 16:07:16 +00:00
Mike Reed
21ba586f32 create outer forloop to support loops=-1
Change-Id: I1f76a798f3f95afb82ab739ab5343bf52b233c7d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226079
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-07-09 14:41:07 +00:00
Herb Derby
55a85fc1a6 Bulkify SkGlyphCacheBench
+ fix bug in SkBulkGlyphMetricsAndImages where the underlying SkAutoSTArray
  was not reset.

Change-Id: I94882da30e858d012aa02f79c5fdfe4bc7d2e8aa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225541
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-07-03 19:45:54 +00:00
Brian Salomon
27ae52c6f4 Make deferred render target context without config or format
config is completely redundant. No caller really cares what the backend
format is.

Change-Id: I93f1feb3ee61db6c21b7915bab3ee3fba5656f92
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225194
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-07-03 16:53:48 +00:00
Mike Klein
ac8f443f92 auto-tune nanobench in all builds
I'm kind of getting bored of having to pass --loops 0
in optimized+asserts builds.

We'd been defaulting to 1 loop in Debug and ASAN builds,
and manually setting Valgrind builds to 1 loop with 1
sample.  Remove the default so all builds auto-tune,
but set Debug and ASAN bots like Valgrind bots.

Change-Id: Ifedd98a11ea74a2c222fe59bd50b96683d12b98c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/224816
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-01 16:07:22 +00:00
Chris Dalton
6b98280469 Track if we need stencil on GrRenderTargetContext
There are a few places that have been checking whether the *proxy*
needs stencil, in order to determine if the current render target
context needs stencil. This is problematic since a render target
context can not require stencil itself, but wrap an existing proxy
that already has stencil.

Bug: skia:
Change-Id: I2719dd3a9df15fef3d64f991cda4fadea23266bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223970
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-06-27 20:29:03 +00:00
Herb Derby
a4eecd8041 findImage(const SkGlyph&) -> prepareImage(SkGlyph*)
Because it mutates the glyph.

Change-Id: Ic7ce320350764454d7a76335828d398f19b149d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223797
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-06-25 19:36:53 +00:00
Brian Salomon
d628747dfb Make GrColorSpaceInfo store GrColorType.
This is largely redundant with GrPixelConfig. However, we intend to
remove GrPixelConfig.

Bug: skia:7580

Change-Id: I03d92303be832711f7821f8a97d36387c9b04a9f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222883
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-06-25 14:29:09 +00:00
Mike Klein
1ae6ac81e6 add RP comparison for SkVM_Overhead
Looks like ~50ns overhead for RP vs ~14,000ns for SkVM.

Change-Id: I85ef73d3387657b14615fcfa5cfd9df5c2325343
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223302
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-06-25 02:52:19 +00:00
Herb Derby
511dcfc339 Remove getGlyphIDMatrics type calls.
Converting to glyph() style calls that return SkGlyph*. This is mainly preparation
for removing converting findImage(const SkGlyph&) to prepareImage(SkGlyph*).

+ Misc cleanups mainly fWidth -> width() type things.

Change-Id: Id5c9b0ba5856b3ea54353ece4d05fa495cc5a640
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223187
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-06-24 19:35:01 +00:00
Chris Dalton
6ce447a4ec Eliminate mixed samples as an FBO type or AA type
From now on, sample counts always refer to the number of actual color
samples, and render targets don't have separate color and stencil
sample counts.

If mixed samples support is available when making a
"GrAAType::kCoverage" draw, then an op may attach and use a mixed
sampled stencil buffer internally. But this will all be invisible to
the client.

After this CL, we temporarily won't have a mode to use nvpr with mixed
samples. That will soon be fixed by a follow-on CL that enables nvpr
with mixed samples in the normal "gl" and "gles" configs.

Bug: skia:
Change-Id: I1cb8277f0d2d0d371f24bb9f39cd473ed5c5c83b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221878
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-06-24 04:08:45 +00:00
Mike Klein
8b5cf82dca add SkVM_Overhead bench, simple improvements
This new bench lets us measure the overhead of program building,
optimization, and JITting.  Surprisingly, at head the optimization in
Builder::done() takes longer than the JIT.

The new bench clocks in around 40µs on my laptop at head,
  then 32µs after switching val_to_reg to be an std::vector,
  then 27µs after switching deaths to be an std::vector too,
  then 22µs after switching fIndex to be an SkTHashMap,
  then 20µs after calling program.reserve(fProgram.size()),
  then 19µs after switching JIT data maps to SkTHashMap too.

I tried swapping some std::vector for SkTDArray to no benefit, actually
a little detriment.  So I think this is roughly all the low-hanging
fruit, with time split now roughly equally between Builder::Done(),
JITting in Program::eval(), and the original calls to Builder
themselves.

Also disable perf dumps on Mac.  No real value there until I can dump a
dylib, and it's just one more thing I have to remember to disable before
running this sort of benchmark.

Change-Id: I1c6e58ed00ac94ad622c7d740712634f60787102
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222984
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-06-22 18:36:49 +00:00
Mike Klein
244ba5550b rearrange who mprotects
This moves the responsibility for allocating executable code out of
Assembler.  The pages Xbyak uses are obviously executable, so this is
redundant right now, but it'll let us switch to something simple like
std::vector<uint8_t> as we continue to cut out Xbyak.

Make how Program holds its cached JIT program slightly less of a mess.

Change-Id: I38d6f01006da1da60f4aed675e9ddf97de9aec52
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222575
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-06-21 18:40:47 +00:00
Mike Klein
397fc88fc0 first VEX ymm vector ops
- 32x8 i32 add,sub,mul
   - add I32_Naive bench/test builder to get better i32 mul coverage
   - minor refactoring all over

Change-Id: I13cc19ff37a2da0bcff289ba51baac08f456d6c5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222485
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-06-20 18:20:00 +00:00
Mike Reed
3fd3cc94c3 runtime shaders
This extends the runStriped to all for return data.
GPU impl not done yet, will be done in a follow-on CL.

Change-Id: Ib107d2945f6fdb34ce1b5405a6c88a5ae7e9f7ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221539
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-06-20 17:11:05 +00:00
Brian Osman
2b1a544fa0 Reland "Reland "Reland "Interpreter: Support striped inputs for less overhead"""
This reverts commit 01c9b89a85.

Change-Id: Ibe2184043f5aee1a252e9a693eb88dab3ed6ca65
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222100
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-06-19 20:24:50 +00:00
Brian Osman
01c9b89a85 Revert "Reland "Reland "Interpreter: Support striped inputs for less overhead"""
This reverts commit 59b22f9297.

Reason for revert: ios

Original change's description:
> Reland "Reland "Interpreter: Support striped inputs for less overhead""
> 
> This reverts commit 2c59b4e9ea.
> 
> Change-Id: I2b06936994430722b8fc3890ff9b4a6f4710db04
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221998
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

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

Change-Id: I321d257e400f5df3c6115dfe9aa18a2794a95910
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222099
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-06-19 15:37:17 +00:00
Brian Osman
59b22f9297 Reland "Reland "Interpreter: Support striped inputs for less overhead""
This reverts commit 2c59b4e9ea.

Change-Id: I2b06936994430722b8fc3890ff9b4a6f4710db04
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221998
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-06-19 13:47:12 +00:00
Brian Osman
2c59b4e9ea Reland "Revert "Interpreter: Support striped inputs for less overhead""
This reverts commit edc42b9971.

Reason for revert: Sigh

Original change's description:
> Revert "Revert "Interpreter: Support striped inputs for less overhead""
> 
> This reverts commit 645fe10313.
> 
> Change-Id: If74a15479f89f49ac33c0b6241bb0db92bc11083
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221721
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

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

Change-Id: I651d56821bbde8b91887aa885bcf2cb202707388
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221897
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-06-19 00:19:37 +00:00
Brian Osman
edc42b9971 Revert "Revert "Interpreter: Support striped inputs for less overhead""
This reverts commit 645fe10313.

Change-Id: If74a15479f89f49ac33c0b6241bb0db92bc11083
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221721
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-06-18 22:30:11 +00:00
Brian Osman
645fe10313 Revert "Interpreter: Support striped inputs for less overhead"
This reverts commit 5d89b66ff6.

Reason for revert: Chrome roll

Original change's description:
> Interpreter: Support striped inputs for less overhead
> 
> Change-Id: I8c7bd5ed3fb6aebbfb1c5c224acfd73862252621
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220778
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
> Reviewed-by: Mike Reed <reed@google.com>

TBR=mtklein@google.com,brianosman@google.com,ethannicholas@google.com,reed@google.com

Change-Id: I2275e7ed12031e58e59b6618d0ea59bec2ee2815
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221716
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-06-18 18:43:47 +00:00
Brian Osman
5d89b66ff6 Interpreter: Support striped inputs for less overhead
Change-Id: I8c7bd5ed3fb6aebbfb1c5c224acfd73862252621
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220778
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-06-18 15:53:05 +00:00
Greg Daniel
f91aeb259e Move a bunch of gpu files out of include/private and into src/gpu.
In GrRecordingContext I moved the auditTrail onto the heap and only there
when compiling for tests. This allowed us to move a lot of files out of
include private.

Change-Id: Ib76ac211c0c6fd10bacaccf0c5f93f21a59f35d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221344
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
2019-06-18 14:24:42 +00:00
Brian Osman
08a8496135 Interpreter: Simplify interface quite a bit.
Slightly sharper, but far easier to hold:

- Remove Value union from interface, everything is a 32-bit
  value type, or a collection thereof.
- Collapse to one version of Run (that takes count), and make
  it a member on ByteCode.
- Similarly, move disassemble to ByteCodeFunction.

Change-Id: I07c85e65991178b3f52e20e815c25f36bc9c4257
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220753
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-06-14 16:04:58 +00:00
Brian Osman
569f12f0e5 Interpreter: Vectorized interpreter
This converts the SkSL interpreter to operate in SIMT fashion. It handles
all the same features as the previous scalar implementation, but operates
on N lanes at a time. (Currently 8).

It's modeled after GPU and other parallel architectures, using execution
masks to handle control flow, including divergent control-flow.

Change-Id: Ieb38ffe2f55a10f72bdab844c297126fe9bedb6c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217122
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-06-13 15:50:55 +00:00
Julia Lavrova
a3552c5e6d Reland "SkParagraph"
This is a reland of 10ad0b9b01

Original change's description:
> SkParagraph
>
> Change-Id: I0a4be75fd0c18021c201bcc1edfdfad8556edeff
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/192100
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

Change-Id: I46cf43eae693edf68e45345acd0eb39e04e02bfc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219863
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2019-06-11 17:20:36 +00:00
Herb Derby
07cd38dc13 Revert "SkParagraph"
This reverts commit 10ad0b9b01.

Reason for revert: Breaks google3 build

Original change's description:
> SkParagraph
> 
> Change-Id: I0a4be75fd0c18021c201bcc1edfdfad8556edeff
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/192100
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

TBR=borenet@google.com,djsollen@google.com,halcanary@google.com,bungeman@google.com,kjlubick@google.com,reed@google.com,drott@chromium.org,jlavrova@google.com

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

Change-Id: I3f4ef2f34b7489d008c2fe92527d39fba0e16ff7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219858
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-06-10 13:16:53 +00:00
Julia Lavrova
10ad0b9b01 SkParagraph
Change-Id: I0a4be75fd0c18021c201bcc1edfdfad8556edeff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/192100
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2019-06-07 17:23:23 +00:00
Herb Derby
ac7182773e Make FindOrCreateStrikeWithNoDeviceExclusive analog for SkStrikeSpec
Add MakeWithNoDevice to avoid the threshold of converting to
paths when using MakeCanonicalized.

Change-Id: I73b49dd35ffb2f4fa3b70ba3324bfcb348ca913b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218960
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-06-07 01:29:21 +00:00
Herb Derby
36a54c1b1a Rename SkStrikeSpecStorage -> SkStrikeSpec
SkStrikeSpecStorage was a temporary name until all uses of
SkStrikeSpec were cleaned up. Do the final rename.

Change-Id: Iaba987ecdfe46ca9eee8d530d5095840cdca300d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219209
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-06-06 18:01:02 +00:00
Ethan Nicholas
fc9941665b Major rearchitecture of SkSL parsing, focused on improving performance.
Bug: skia:
Change-Id: I83e3a094d26085fc4d586e5d2581e0d61c55634e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/145080
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-06-06 14:33:32 +00:00
Mike Klein
7b7077cc36 centralize test/bench SkVM builders
Eliminate the duplicate functionality,
and better testing for the bench builders.

Change-Id: If20e52107738903f854aec431416e573d7a7d640
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218041
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-06-04 16:55:59 +00:00
Herb Derby
baf64786ba Convert over more sites to SkStrikeSpecStorage, and remove unused calls
Convert over remaining callsights for strike lookup, and reduce the SkStrikeCache
API.

- one friend decl.

Change-Id: I109a747061030f26ff908472ea55a4424d5c10f1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209109
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-06-04 14:11:45 +00:00
Michael Ludwig
663afe501a Move GrPathUtils, GrRect, and GrShape into src/gpu/geometry/
Change-Id: I864d3c2452f3affdc744bf8b11ed3b3e37d6d922
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216602
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-06-04 13:36:05 +00:00
Mike Klein
03ce675b5f fix SKVM_ benches
Things were running suspiciously well...

_I32 had a typo that cut out 3/4 of its multiplies...

_I32_SWAR was missing a mask operation needed to drop
the junk low byte of the high half after the multiply.

The bench times now make a bit more sense and are in line
with how much work we're actually doing: F32's the slowest,
I32 a little faster, and I32_SWAR fastest:

    curr/maxrss	loops	min	median	mean	max	stddev	samples   	config	bench
      35/36  MB	58	2.03ns	2.04ns	2.04ns	2.04ns	0%	▂▂▂▂▁▁█▁▂▁	nonrendering	SkVM_4096_I32_SWAR
      35/36  MB	42	3.44ns	3.48ns	3.49ns	3.59ns	1%	▂▆▅█▃▃▁▂▂▄	nonrendering	SkVM_4096_I32
      35/36  MB	30	4.9ns	5.21ns	5.11ns	5.33ns	3%	▆▇█▆▆▁▂▁▁▅	nonrendering	SkVM_4096_F32
      35/36  MB	203	0.696ns	0.697ns	0.705ns	0.758ns	3%	█▂▂▁▁▁▁▁▁▂	nonrendering	SkVM_4096_RP
      35/36  MB	942	0.188ns	0.188ns	0.188ns	0.189ns	0%	▂▁▂▁▃█▂▁▁▁	nonrendering	SkVM_4096_Opts

Change-Id: I2850dc3f9df1828f03499eb278b8231f48eaae63
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217982
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-06-03 20:35:24 +00:00
Mike Klein
68c50d015b sketch an skvm
With all the thinking around a stack-based interpreter,
I figured I'd sketch out some ideas for a register VM too.

I kind of have the hunch that this is the direction that
will actually let us replace large amounts of Skia's CPU
backend with an efficient interpreter or JIT.

Change-Id: Ia2b5ba4a3fc27556f5b6ba95cd1ace46d3217403
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216665
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-06-03 19:53:48 +00:00
Ethan Nicholas
40679c3aa5 added SkSL bench
Bug: skia:
Change-Id: I8497ddbc5c5fef4e0fa87f3b9828034ba34284cc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217636
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-06-03 16:01:30 +00:00
Mike Klein
fec9b902a6 add unit scaling mode to benchmark/nanobench
This lets you write a suite of benchmarks that
run against different sized workloads and see
numbers that normalized by that workload size,
e.g. nanoseconds / pixel.

C.f. the bench in "sketch an skvm".

Change-Id: I6106c51ceac59cd533449712a77c957bdf86846e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217416
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-06-03 14:53:29 +00:00
Jim Van Verth
8a9a371182 Reland "Added AutoreleasePool for managing pool memory in testing apps."
This is a reland of a36e089065

This is only active when Metal is enabled.

Original change's description:
> Added AutoreleasePool for managing pool memory in testing apps.
>
> This is only active on MacOS and iOS -- on other platforms it
> will do nothing as they have no need for autorelease pools.
>
> Bug: skia:8243
> Change-Id: Ib74968dab6e3455a72e726429832101d0d410076
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217126
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

Bug: skia:8243
Change-Id: I743a3dcc93b46387a6a330e855c2e8810b482544
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217379
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-05-31 15:40:01 +00:00
Kevin Lubick
c4fec06e5a Revert "Added AutoreleasePool for managing pool memory in testing apps."
This reverts commit a36e089065.

Reason for revert: Primary suspect in breaking G3

Original change's description:
> Added AutoreleasePool for managing pool memory in testing apps.
> 
> This is only active on MacOS and iOS -- on other platforms it
> will do nothing as they have no need for autorelease pools.
> 
> Bug: skia:8243
> Change-Id: Ib74968dab6e3455a72e726429832101d0d410076
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217126
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

TBR=egdaniel@google.com,jvanverth@google.com,brianosman@google.com

Change-Id: I64f6e0baba21a9d35682ab53bdf418180be8579b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8243
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217377
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2019-05-31 12:31:14 +00:00
Jim Van Verth
a36e089065 Added AutoreleasePool for managing pool memory in testing apps.
This is only active on MacOS and iOS -- on other platforms it
will do nothing as they have no need for autorelease pools.

Bug: skia:8243
Change-Id: Ib74968dab6e3455a72e726429832101d0d410076
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217126
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-05-30 19:13:34 +00:00
Hal Canary
fcea9a9161 SkPDF: MakeShader uses Color4f
Also some minor refactoring in make_image_shader().

Change-Id: I6061ebeb8c297045b1a276160fe18cc6ae54bde7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216867
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-05-30 14:52:29 +00:00
Ben Wagner
ab6eefe60e Move SkLeanWindows.h to src.
This file pulls in Windows headers in a custom way, which is somewhat
awkward for a library header. The only use in include/ has been replaced
with a single forward declaration.

Change-Id: Ibef4cf7a2d1c9957a6a5b145b95aca1a6868cb5e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214689
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-05-21 13:48:00 +00:00
Mike Reed
d93ee53aff Rework colorfilter bench
Previous structure didn't measure anything but new/free cost. All of the
constructs turned into (eventually) drawRect + color.

New version also measures that, but in a clearer way, so we can examine
all the variants, and assume that they should all be about the same.

Change-Id: I1b4a0120a3e663ce1b9daa3c1e3e26ae6b397677
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214687
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-05-20 17:02:06 +00:00
Mike Klein
a705cb93c7 remove SkLiteDL
It's been dead code since it was inlined into Android last summer.

Change-Id: I252f6392d9436ef357f22a54bab8a33c9d1b3ea9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213625
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-05-14 18:55:44 +00:00
Ben Wagner
51e15a69ce Use SkTextEncoding enum instead of macros.
Change-Id: I4b6259590fa0693ee0522b4999a1c0fe250b173d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212504
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-05-07 20:54:16 +00:00
Hal Canary
70aab82354 Shaper Tests: fix g3 build
Change-Id: Ib53a9e3224bedbbbdb6d4a99e7ed1856ff9a6717
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211997
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-05-03 18:10:46 +00:00
Hal Canary
56947a7fa3 Shaper Tests: make a macro, rename test resources.
Change-Id: Ic7bfd4784d9b2031fdcbf57e730b8c738b9ac9d3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211990
Auto-Submit: Hal Canary <halcanary@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-05-03 17:16:36 +00:00
Hal Canary
dc19391eef SkShaper: new benchmarks
For the record on my machine:

       2897.46 μs   shaper_tifnagh
       2912.11 μs   shaper_hebrew
       2943.12 μs   shaper_english
       2955.57 μs   shaper_greek
       2966.55 μs   shaper_cyrillic
       3057.37 μs   shaper_lao
       3067.87 μs   shaper_nko
       3364.01 μs   shaper_han_traditional
       7876.46 μs   shaper_han_simplified
       9060.30 μs   shaper_ethiopic
      13202.39 μs   shaper_balinese
      24200.44 μs   shaper_buginese
      27776.86 μs   shaper_kana
      29691.41 μs   shaper_sundanese
      30949.22 μs   shaper_newtailue
      34719.73 μs   shaper_tibetan
      35545.17 μs   shaper_thai
      36623.54 μs   shaper_taitham
      42048.83 μs   shaper_mandaic
      48342.53 μs   shaper_khmer
      65015.62 μs   shaper_javanese
      82198.24 μs   shaper_tamil
      99166.26 μs   shaper_bengali
      99824.46 μs   shaper_hangul
     101777.10 μs   shaper_sinhala
     105471.68 μs   shaper_cherokee
     131298.10 μs   shaper_myanmar
     134949.71 μs   shaper_thaana
     143183.11 μs   shaper_devanagari
     177995.12 μs   shaper_syriac
     186761.23 μs   shaper_vai
     236699.95 μs   shaper_emoji

Change-Id: I312c8333be2408090797cddfe25ef2ccc6eaf82b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211823
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-05-03 14:22:35 +00:00
Jim Van Verth
a5ef39726a More polyutils fixes
Bug: chromium:954891, oss-fuzz:14079
Change-Id: Ia1ee0a15ab4bfc93e67188ff02e6aa436432a3be
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211602
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-05-01 18:02:05 +00:00
Mike Reed
e869a1ed96 stop calling legacy 255-biased colormatrix
... but keep the apis for now

Bug: skia:4872
Bug: skia:9012
Change-Id: I3a9b0c9194be6897c0e59b7edd972b7218168183
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211343
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-30 16:59:36 +00:00
Mike Klein
c0bd9f9fe5 rewrite includes to not need so much -Ifoo
Current strategy: everything from the top

Things to look at first are the manual changes:

   - added tools/rewrite_includes.py
   - removed -Idirectives from BUILD.gn
   - various compile.sh simplifications
   - tweak tools/embed_resources.py
   - update gn/find_headers.py to write paths from the top
   - update gn/gn_to_bp.py SkUserConfig.h layout
     so that #include "include/config/SkUserConfig.h" always
     gets the header we want.

No-Presubmit: true
Change-Id: I73a4b181654e0e38d229bc456c0d0854bae3363e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209706
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-04-24 16:27:11 +00:00
Michael Ludwig
377befab71 Update compositing benchmark to use image-set API
Change-Id: I73de5cb894e4084ca86e43c2918a1a9fe656b11d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209323
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-04-19 17:36:34 +00:00
Mike Reed
64670cb1b8 Reland "Simplify SkTypeface::charsToGlyphs API to require UTF32 input"
This is a reland of fde841de44

Original change's description:
> Simplify SkTypeface::charsToGlyphs API to require UTF32 input
> 
> Change-Id: I486713c496c40103eef13fa6068ac4d69e32f606
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207865
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

Change-Id: I5162c93b3ea6146d09334545744b791d993397b8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208679
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-17 17:56:39 +00:00
Robert Phillips
33906ad1e2 Reland "Revert "Simplify SkTypeface::charsToGlyphs API to require UTF32 input""
This reverts commit 652b007a4c.

Reason for revert: Potentially causing Google3 errors

Original change's description:
> Revert "Revert "Simplify SkTypeface::charsToGlyphs API to require UTF32 input""
> 
> with legacy guard for google3
> 
> Needs this to land first: https://critique.corp.google.com/#review/243924283
> 
> This reverts commit 70ed05e53a.
> 
> Change-Id: I3e821dfcdbf3004382092338ebad7cceaf40cefd
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208668
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
> Auto-Submit: Mike Reed <reed@google.com>

TBR=fmalita@chromium.org,reed@google.com

Change-Id: Id2b3ed8a6157b5e33721b0c5168c5680bfac15b0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208669
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-04-17 12:03:53 +00:00
Mike Reed
652b007a4c Revert "Revert "Simplify SkTypeface::charsToGlyphs API to require UTF32 input""
with legacy guard for google3

Needs this to land first: https://critique.corp.google.com/#review/243924283

This reverts commit 70ed05e53a.

Change-Id: I3e821dfcdbf3004382092338ebad7cceaf40cefd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208668
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-17 03:08:40 +00:00
Mike Reed
70ed05e53a Revert "Simplify SkTypeface::charsToGlyphs API to require UTF32 input"
This reverts commit fde841de44.

Reason for revert: used in headless on google3, need to add a guard

Original change's description:
> Simplify SkTypeface::charsToGlyphs API to require UTF32 input
> 
> Change-Id: I486713c496c40103eef13fa6068ac4d69e32f606
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207865
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

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

Change-Id: I1d28ed5c31deaa76aa3c4b627454b0ad3356a6fc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208800
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-04-17 00:02:12 +00:00
Mike Reed
fde841de44 Simplify SkTypeface::charsToGlyphs API to require UTF32 input
Change-Id: I486713c496c40103eef13fa6068ac4d69e32f606
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207865
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-04-16 21:34:10 +00:00
Mike Reed
194cab0fd3 use slope-guess for faster charToGlyph
Made up a threshold between linear and slope searching.
For a count of 100 here are the before and after timings.
The first two lines are being changed. The latter 2 are
the native look-ups for mac.

Before

  15/15  MB	115	2.33µs	2.34µs	2.34µs	2.34µs	0%	▆▁▄█▇▇▂▄█▆	nonrendering	cmap_findcache_charToGlyph
  15/15  MB	66	3.47µs	3.48µs	3.49µs	3.55µs	1%	█▁▁▁▂▁▁▁▁▄	nonrendering	cmap_addcache_charToGlyph
  15/15  MB	1	1.1µs	1.13µs	1.21µs	1.98µs	22%	█▂▁▁▁▁▁▁▁▂	nonrendering	cmap_face_charToGlyph
  15/15  MB	190	1.09µs	1.1µs	1.19µs	1.64µs	17%	▁▁▁▆█▁▁▁▁▁	nonrendering	cmap_font_charToGlyph

After

  15/15  MB	447	448ns	449ns	448ns	449ns	0%	▂▅█▅▁▆█▂▁▆	nonrendering	cmap_findcache_charToGlyph
  15/15  MB	95	2.79µs	3.03µs	3µs	3.06µs	3%	▇▇▇▇▇███▄▁	nonrendering	cmap_addcache_charToGlyph
  15/15  MB	1	1.15µs	1.16µs	1.25µs	1.99µs	21%	█▂▁▁▁▁▁▁▁▁	nonrendering	cmap_face_charToGlyph
  15/15  MB	186	1.09µs	1.1µs	1.12µs	1.27µs	5%	█▁▁▁▂▁▁▁▁▁	nonrendering	cmap_font_charToGlyph


Bug: skia:
Change-Id: If7da4eef3cce248393815071f342607f0c8140bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208044
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-04-15 19:35:59 +00:00
Mike Reed
0c60708737 add utility for caching char2glyph
Try: out/release/nanobench --match _charToGlyph

Pseudo plan to use this:
- attach to whatever typeface backends need it (probably just freetype)
- have a purge/limiting scheme (e.g. only cache N entries)
- if we care, make the search fancier (e.g. binary, slope, etc.)

Bug: 951647
Change-Id: Ib1042ca5891d2742499faf1314579c402121a855
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207703
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-04-13 00:03:58 +00:00
Mike Reed
e3f17b911f remove SkMixer, since we have explicit lerps/blends in SkShader
Change-Id: I937861df9d8ae89c0587ea59dd740989bebd35a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207305
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-04-10 20:59:30 +00:00