Commit Graph

2155 Commits

Author SHA1 Message Date
Mike Klein
97c7cf16de remove --undefok
I think we originally added this for the bots, back in the good old days
when the bot scripts weren't versioned with Skia.  No bots use this now.

Change-Id: Icdee95d27fb928d0215601e082d056e611eb6202
Reviewed-on: https://skia-review.googlesource.com/c/181980
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
2019-01-09 18:15:07 +00:00
Brian Osman
82ebe04caf Reland "Add SkColorSpace factory from 3x3 row-major gamut and transfer function"
Moved named common transfer functions and gamuts to constexpr values in
SkColorSpace.h, in SkNamedTransferFn and SkNamedGamut namespaces.

Converted nearly all SkColorSpace::MakeRGB calls within Skia to use the
new factory with the named values. Multiple clients want a way to
extract named transfer function and gamut - this still doesn't provide
that, but this may be a better path forward for honestly advertising how
SkColorSpace works internally.

Originally landed as:
https://skia.googlesource.com/skia/+/a9549ab31630fc244094e6f1692371cbaf87f666

Re-landing with a new serialization format, but maintaining ability to
load old serialized color spaces, for SKP compatibility.

Bug: skia:
Change-Id: Ib84a6e1cd5d7d9816175773fdbaff2ca32658667
Reviewed-on: https://skia-review.googlesource.com/c/181176
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-01-05 20:06:51 +00:00
Brian Osman
d4c7458f64 Revert "Add SkColorSpace factory from 3x3 row-major gamut and transfer function"
This reverts commit a9549ab316.

Reason for revert: SKPs changed?

Original change's description:
> Add SkColorSpace factory from 3x3 row-major gamut and transfer function
> 
> Moved named common transfer functions and gamuts to constexpr values in
> SkColorSpace.h, in SkNamedTransferFn and SkNamedGamut namespaces.
> 
> Converted nearly all SkColorSpace::MakeRGB calls within Skia to use the
> new factory with the named values. Multiple clients want a way to
> extract named transfer function and gamut - this still doesn't provide
> that, but this may be a better path forward for honestly advertising how
> SkColorSpace works internally.
> 
> Bug: skia:
> Change-Id: I9296d67e8f0dab5ceb49869cb3ba24e98a05f3c4
> Reviewed-on: https://skia-review.googlesource.com/c/180360
> Reviewed-by: Mike Klein <mtklein@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

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

Change-Id: Ie888f877b3c1dba33e1a8c0f5fa92594628de7fb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/181300
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-01-04 17:07:48 +00:00
Brian Osman
a9549ab316 Add SkColorSpace factory from 3x3 row-major gamut and transfer function
Moved named common transfer functions and gamuts to constexpr values in
SkColorSpace.h, in SkNamedTransferFn and SkNamedGamut namespaces.

Converted nearly all SkColorSpace::MakeRGB calls within Skia to use the
new factory with the named values. Multiple clients want a way to
extract named transfer function and gamut - this still doesn't provide
that, but this may be a better path forward for honestly advertising how
SkColorSpace works internally.

Bug: skia:
Change-Id: I9296d67e8f0dab5ceb49869cb3ba24e98a05f3c4
Reviewed-on: https://skia-review.googlesource.com/c/180360
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-01-04 14:32:06 +00:00
Mike Reed
a6d1c0a13a start to build with no paint-text fields
Bug: skia:
Change-Id: Ie425fb73d70d45c05108ecca6ce8a89e8eafc02a
Reviewed-on: https://skia-review.googlesource.com/c/181161
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-01-04 04:54:34 +00:00
Mike Reed
89126e4550 use drawSimpleText
Bug: skia:
Change-Id: I4aa6190e66478595a409f93a406fd42f19394302
Reviewed-on: https://skia-review.googlesource.com/c/180927
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-01-03 18:27:23 +00:00
Mike Reed
212e9060ed don't use drawPosText
Skia can now build if we mark drawPosText as private,
Will hide/remove next (after Chrome CL)

Bug: skia:
Change-Id: I156560b025c119af302545bb5bd60678f7b8e8f7
Reviewed-on: https://skia-review.googlesource.com/c/179985
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2018-12-25 23:07:35 +00:00
Hal Canary
f34131ae9b SkPDF: even more PDFIndirectRefs
* SkPDFUnion.h hidden.
  * SkPDFObjectSerializer::serializeObject gone.
  * SkPDFDocument::serialize gone
  * SkPDFMetadata::MakeXMPObject return PDFIndirectRef
  * SkPDFTag rewritten from scratch.
  * SkPDFObject::addResources virtual gone.
  * SkPDFObject::drop virtual gone.
  * SkPDFArray::appendObjRef gone.
  * SkPDFDict::insertObjRef gone.
  * SkPDFDict::Record becomes std::pair
  * SkPDFObjNumMap gone;
  * SkPDFObject::fIndirectReference gone;

Bug: skia:8630
Change-Id: I7425eef30548b54f10fbfe96dd502800cb150caf
Reviewed-on: https://skia-review.googlesource.com/c/178935
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-12-19 03:20:42 +00:00
Hal Canary
9a3f554154 SkPDF: refactor streams, experimental threading
All PDF Streams are immediatly serialized, and are never long-lived
    in memory.

    if EXPERIMENTAL fExecutor is set on the Document, streams are
    compressed in parallel.

    Results for PDFBigDocBench:

        without patch                    1807885.01 μs
        with    patch without executor   1802808.35 μs
        with    patch with    executor    246313.72 μs

    SkPDFStreamOut() function replaces SkPDFStream classes.

    Page resources are all serialized early.

    Several Document-level objects are serialzied early.

    SkUUID introduced as top-level object.

    Many {insert|append}ObjRef() converted to memory efficient
    {insert|append}Ref().

Bug: skia:8630
Change-Id: Ic336917d0c8b9ac1c2423b43bfe9b49a3533fbff
Reviewed-on: https://skia-review.googlesource.com/c/176588
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-12-18 20:48:25 +00:00
Mike Reed
646107fe7f add bench to time relative gain for convexity
Bug: skia:
Change-Id: I5bd0194a49c74a8e47a210ff06ef4406ecb3bc4c
Reviewed-on: https://skia-review.googlesource.com/c/175585
Commit-Queue: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-12-07 19:02:50 +00:00
Mike Reed
ed33af4c64 add bench for textblobbuilder
Bug: skia:
Change-Id: I133c6f78f1b378c3a86dd91b59990861b5e0d09a
Reviewed-on: https://skia-review.googlesource.com/c/174840
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-12-05 19:42:56 +00:00
Mike Klein
0ec1c571c8 remove sk_atomic_inc
Change-Id: I4960b1cd055daf44637e95825f82cb7fe2ce134a
Reviewed-on: https://skia-review.googlesource.com/c/174285
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-12-04 19:01:47 +00:00
Mike Reed
94cca60bfa start to use font for measure, not paint
-- lots more where this came from

Bug: skia:2664
Change-Id: I8bb47f02c156b0b88fbb92fec73af0eb6641b1bf
Reviewed-on: https://skia-review.googlesource.com/c/173769
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-12-02 21:31:36 +00:00
Brian Salomon
2335644771 Fix occurrences of "-Wextra-semi-stmt"
Docs-Preview: https://skia.org/?cl=173761
Change-Id: Iefdb91cd28eabb4b01b7b42a4f300b0b4caf05d9
Reviewed-on: https://skia-review.googlesource.com/c/173761
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-11-30 23:23:09 +00:00
Brian Osman
c337a63229 Add SkEncodedOrigin to SkYUVASizeInfo, fix JPEG orientation in GPU decode path
Bug: skia:7523
Change-Id: I7d48e5f5930b413fa7f27aa391bf92c5af1342e9
Reviewed-on: https://skia-review.googlesource.com/c/173429
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2018-11-30 16:05:36 +00:00
Mike Reed
ef4047db96 add bench for computing convexity
Bug: skia:
Change-Id: Iaa2971c28f6a8e869b92887e0c0595c73b0aebdb
Reviewed-on: https://skia-review.googlesource.com/c/173225
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-28 17:14:17 +00:00
Mike Reed
32c6066ea8 Force clients to specify font when requesting strikecache
Bug: skia:
Change-Id: If56222039239df085d6c40e835060e91fe70940b
Reviewed-on: https://skia-review.googlesource.com/c/173166
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-28 16:14:02 +00:00
Mike Reed
2871509751 change params to getPaths callback, avoiding a xform/copy up front.
Before

  18/18  MB	1	33.1µs	33.3µs	33.4µs	34.2µs	1%	█▄▃▂▂▁▁▁▁▂	nonrendering	font-path-batch
  18/18  MB	12	43.7µs	43.8µs	43.8µs	44.1µs	0%	█▂▁▂▁▅▂▂▆▂	nonrendering	font-path-loop

After

  17/17  MB	1	10.2µs	10.3µs	10.4µs	11µs	2%	█▃▂▂▂▂▂▁▁▂	nonrendering	font-path-batch
  17/17  MB	21	23.4µs	23.4µs	23.4µs	23.4µs	0%	█▂▁▃▃▂▄▁▂▂	nonrendering	font-path-loop

Bug: skia:
Change-Id: Ib1aa886fd675326bf5936b47b0d459ba02f1681e
Reviewed-on: https://skia-review.googlesource.com/c/172743
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-25 15:32:33 +00:00
Mike Reed
c16abee8c5 impl gettextpath using SkFont
Bug: skia:
Change-Id: I23dce4ed9718e7ce2d6511e08ef350c9ee2e94b4
Reviewed-on: https://skia-review.googlesource.com/c/172645
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-11-24 18:52:59 +00:00
Mike Reed
358fcad1b8 start to hide textparams on SkPaint
Bug: skia:
Change-Id: Id73c983cc71d39fe587d355e690261627fa63aee
Reviewed-on: https://skia-review.googlesource.com/c/172643
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-23 20:54:16 +00:00
Mike Reed
2ed7820970 use SkFont in a lot of places
Bug: skia:
Change-Id: I86df3f650eb5bb0219b3251ef5f8e95403838bba
Reviewed-on: https://skia-review.googlesource.com/c/172482
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-21 20:44:03 +00:00
Michael Ludwig
dde8b55548 Add aa/non-aa, local coord, and perspective modes to rect benchmarks
Bug: skia:
Change-Id: Ib3309ec0a0a00f1471c2211282d70ab089143bb2
Reviewed-on: https://skia-review.googlesource.com/c/171727
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-11-20 21:04:42 +00:00
Michael Ludwig
eb35650f91 Update drawimage composite benchmark to force aa
Bug: skia:
Change-Id: I3a23031cdd86d844c78134ecf79fc1ccc37ec1f1
Reviewed-on: https://skia-review.googlesource.com/c/171721
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-11-20 17:41:34 +00:00
Greg Daniel
4065d45d2d Reland "Reland "Have a GrBackendFormat be stored on gpu proxies.""
This is a reland of 2f9a5ea639

Original change's description:
> Reland "Have a GrBackendFormat be stored on gpu proxies."
> 
> This reverts commit 919c9e77c3.
> 
> Reason for revert: Flutter change has landed and fixed memory issue.
> 
> Original change's description:
> > Revert "Have a GrBackendFormat be stored on gpu proxies."
> >
> > This reverts commit 51b1c12bbc.
> >
> > Reason for revert: reverting till flutter gets to 1.1 to fix build issues.
> >
> > Original change's description:
> > > Have a GrBackendFormat be stored on gpu proxies.
> > >
> > > Bug: skia:
> > > Change-Id: Iaf1fb24ab29a61d44e5fa59a5e0867ed02dcda90
> > > Reviewed-on: https://skia-review.googlesource.com/c/168021
> > > Reviewed-by: Brian Osman <brianosman@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> >
> > TBR=egdaniel@google.com,bsalomon@google.com,brianosman@google.com
> >
> > Change-Id: I574fdc084ef5994596c51fb0d60423b5dc01b885
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: chromium:903701 chromium:903756
> > Reviewed-on: https://skia-review.googlesource.com/c/169835
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com,brianosman@google.com
> 
> Change-Id: Ifd9b6b8e194af9fb9258fa626644e76e6ecf090d
> Bug: chromium:903701 chromium:903756
> Reviewed-on: https://skia-review.googlesource.com/c/170104
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

Bug: chromium:903701 chromium:903756
Change-Id: Id1360067d8e928b0a4e1848dae8bc1e7f1994403
Reviewed-on: https://skia-review.googlesource.com/c/171660
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-11-19 18:51:07 +00:00
Hal Canary
a121183204 SkPDF: move image serialization over to new immediate mode.
Change-Id: If2bd4cd61bc3231edd860b0e08f78a6f24bd3094
Reviewed-on: https://skia-review.googlesource.com/c/171532
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-11-19 16:13:58 +00:00
Mike Reed
07f93f2999 impl SkFont::getPath
Replacement for SkPaint::getTextPath and getPosTextPath
- only works with glyphIDs
- doesn't try to do positioning
- doesn't force caller to consolidate all the glyphs into one giant path

Much of the time is spent transforming the path from the cache's size to the callers.
Might consider passing the raw path + matrix rather than scaling it for them???

Bug: skia:
Change-Id: Ie13015c61ebe410eaec084282d600338cfccb51a
Reviewed-on: https://skia-review.googlesource.com/c/170881
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-14 17:28:10 +00:00
Hal Canary
f6462c4321 SkPDF: store indirect references in object
Change-Id: Ia127247fd2d680dc6d06a04161bdf1da6701762e
Reviewed-on: https://skia-review.googlesource.com/c/170728
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-11-14 16:21:30 +00:00
Greg Daniel
d7157b2ccf Revert "Reland "Have a GrBackendFormat be stored on gpu proxies.""
This reverts commit 2f9a5ea639.

Reason for revert: breaking fuchsia

Original change's description:
> Reland "Have a GrBackendFormat be stored on gpu proxies."
> 
> This reverts commit 919c9e77c3.
> 
> Reason for revert: Flutter change has landed and fixed memory issue.
> 
> Original change's description:
> > Revert "Have a GrBackendFormat be stored on gpu proxies."
> >
> > This reverts commit 51b1c12bbc.
> >
> > Reason for revert: reverting till flutter gets to 1.1 to fix build issues.
> >
> > Original change's description:
> > > Have a GrBackendFormat be stored on gpu proxies.
> > >
> > > Bug: skia:
> > > Change-Id: Iaf1fb24ab29a61d44e5fa59a5e0867ed02dcda90
> > > Reviewed-on: https://skia-review.googlesource.com/c/168021
> > > Reviewed-by: Brian Osman <brianosman@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> >
> > TBR=egdaniel@google.com,bsalomon@google.com,brianosman@google.com
> >
> > Change-Id: I574fdc084ef5994596c51fb0d60423b5dc01b885
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: chromium:903701 chromium:903756
> > Reviewed-on: https://skia-review.googlesource.com/c/169835
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com,brianosman@google.com
> 
> Change-Id: Ifd9b6b8e194af9fb9258fa626644e76e6ecf090d
> Bug: chromium:903701 chromium:903756
> Reviewed-on: https://skia-review.googlesource.com/c/170104
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

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

Change-Id: Ia0556355e5775b2100901b7bfa37f97bb6ccd90f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:903701 chromium:903756
Reviewed-on: https://skia-review.googlesource.com/c/171002
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-11-14 15:28:15 +00:00
Greg Daniel
2f9a5ea639 Reland "Have a GrBackendFormat be stored on gpu proxies."
This reverts commit 919c9e77c3.

Reason for revert: Flutter change has landed and fixed memory issue.

Original change's description:
> Revert "Have a GrBackendFormat be stored on gpu proxies."
>
> This reverts commit 51b1c12bbc.
>
> Reason for revert: reverting till flutter gets to 1.1 to fix build issues.
>
> Original change's description:
> > Have a GrBackendFormat be stored on gpu proxies.
> >
> > Bug: skia:
> > Change-Id: Iaf1fb24ab29a61d44e5fa59a5e0867ed02dcda90
> > Reviewed-on: https://skia-review.googlesource.com/c/168021
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com,brianosman@google.com
>
> Change-Id: I574fdc084ef5994596c51fb0d60423b5dc01b885
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: chromium:903701 chromium:903756
> Reviewed-on: https://skia-review.googlesource.com/c/169835
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

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

Change-Id: Ifd9b6b8e194af9fb9258fa626644e76e6ecf090d
Bug: chromium:903701 chromium:903756
Reviewed-on: https://skia-review.googlesource.com/c/170104
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-11-14 14:52:44 +00:00
Brian Osman
f04fb3cacb Change how GPs configure attributes
Adds setVertexAttributes and setInstanceAttributes. These take a pointer
to the first attribute, and a count. The count is the total number of
possible attributes, though some may not be initialized. The base class
computes the number of initialized attributes, pre-computes the strides,
and only allows subsequent access to the initialized attributes.

The attributes need to be allocated contiguously. Some GPs place them in
an array, though most just place them as consecutive members, and pass
a pointer to the first one.

Indexed access would be possible, but now it makes more sense to iterate
over all attributes, so enable that, and use range-based for everywhere.

Completely remove the per-attribute offset helper (again - possible, but
not real helpful), and make the stride always available. In many ops,
just use the GP's computed stride, rather than re-computing it.

Bug: skia:
Change-Id: Ie4cccb7969a98ee5a10b373e714fbd702e875b3e
Reviewed-on: https://skia-review.googlesource.com/c/169241
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-11-13 00:57:17 +00:00
Herb Derby
c34150079a Reland "Move remove ptr args to MakeRecAndEffects"
This is a reland of b07aba4214

Original change's description:
> Move remove ptr args to MakeRecAndEffects
>
> Move this conversion out through the transitive closure of calls. As you
> move up the stack, everything becomes refs instread of pointers.
>
> Reorder args of MakeRecAndEffects and setupCache to match the majority of other
> calls.
>
> Change-Id: I72baf457cd9140f76ee5f7122493284c4be5bcd0
> Reviewed-on: https://skia-review.googlesource.com/c/169765
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

Change-Id: I2ff7f218ecc7b18ae6a2b293cecdb059eea77562
Reviewed-on: https://skia-review.googlesource.com/c/170222
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-11-09 20:01:42 +00:00
Herb Derby
1062963232 Revert "Move remove ptr args to MakeRecAndEffects"
This reverts commit b07aba4214.

Reason for revert: Changes GMs

Original change's description:
> Move remove ptr args to MakeRecAndEffects
> 
> Move this conversion out through the transitive closure of calls. As you
> move up the stack, everything becomes refs instread of pointers.
> 
> Reorder args of MakeRecAndEffects and setupCache to match the majority of other
> calls.
> 
> Change-Id: I72baf457cd9140f76ee5f7122493284c4be5bcd0
> Reviewed-on: https://skia-review.googlesource.com/c/169765
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

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

Change-Id: I29e54cea5b7b5709dd6db6816cb6556d73e003e0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/170221
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-11-09 19:01:08 +00:00
Herb Derby
b07aba4214 Move remove ptr args to MakeRecAndEffects
Move this conversion out through the transitive closure of calls. As you
move up the stack, everything becomes refs instread of pointers.

Reorder args of MakeRecAndEffects and setupCache to match the majority of other
calls.

Change-Id: I72baf457cd9140f76ee5f7122493284c4be5bcd0
Reviewed-on: https://skia-review.googlesource.com/c/169765
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-11-09 18:11:50 +00:00
Greg Daniel
919c9e77c3 Revert "Have a GrBackendFormat be stored on gpu proxies."
This reverts commit 51b1c12bbc.

Reason for revert: reverting till flutter gets to 1.1 to fix build issues.

Original change's description:
> Have a GrBackendFormat be stored on gpu proxies.
>
> Bug: skia:
> Change-Id: Iaf1fb24ab29a61d44e5fa59a5e0867ed02dcda90
> Reviewed-on: https://skia-review.googlesource.com/c/168021
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: I574fdc084ef5994596c51fb0d60423b5dc01b885
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:903701 chromium:903756
Reviewed-on: https://skia-review.googlesource.com/c/169835
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-11-09 15:33:23 +00:00
Greg Daniel
51b1c12bbc Have a GrBackendFormat be stored on gpu proxies.
Bug: skia:
Change-Id: Iaf1fb24ab29a61d44e5fa59a5e0867ed02dcda90
Reviewed-on: https://skia-review.googlesource.com/c/168021
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-11-08 19:44:55 +00:00
Nigel Tao
9d4f450618 Add comment about how to run Decoder benchmarks
Bug: skia:
Change-Id: I39362ff537a87a0483356aa166e116943013fb24
Reviewed-on: https://skia-review.googlesource.com/c/169480
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-11-08 18:12:51 +00:00
Mike Reed
534e776511 add pathops bench for simplify
Bug: skia:
Change-Id: Ic4aa213d5cb394f47e07cc19a5da89f7389a7c1f
Reviewed-on: https://skia-review.googlesource.com/c/163224
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Allan MacKinnon <allanmac@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
2018-11-05 13:15:21 +00:00
Brian Salomon
dd79121e8f Make nanobench --mpd flush between canvases.
This more closely mirrors Chrome GPU raster.

Bug: skia:8514
Change-Id: I6a038fd393d45dc48808d225b84f4e215e3a79b7
Reviewed-on: https://skia-review.googlesource.com/c/166800
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-10-31 17:39:11 +00:00
Brian Osman
3b79aa3a5a On second thought, remove GrColor4s
We're going to use half-floats, which are far more future-proof.

Bug: skia:
Change-Id: I6e098017381256d6e750ac546c353072802282cb
Reviewed-on: https://skia-review.googlesource.com/c/165522
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-10-26 19:29:50 +00:00
Brian Osman
9ba9d7d1cb Use SkColor4f functionality, rather than SkPM4f.h inline functions
Gradient code still uses some of the helpers, otherwise they could
be moved to SkColor.cpp.

Bug: skia:
Change-Id: I2e5076e9cc81669440fbf29a95113e45642b307f
Reviewed-on: https://skia-review.googlesource.com/c/165307
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-10-26 19:04:18 +00:00
Mike Klein
ca4756a368 remove RP bench
Originally I wanted to get it away from using from_srgb/to_srgb
directly, but in the end I just don't care about any of it.

Change-Id: I7ed39a92840f02c98bfe97203bef64057ee0413e
Reviewed-on: https://skia-review.googlesource.com/c/165440
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-26 17:14:31 +00:00
Brian Osman
4f598e8c82 GrColor4s, a fixed-point signed short type for wide color vertices
Bug: skia:
Change-Id: I91b9816aae74726762c123d9f3454c5961382b7b
Reviewed-on: https://skia-review.googlesource.com/c/164680
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-10-24 18:21:16 +00:00
Mike Klein
b11ab578ad remove src/jumper
The distinction between SkJumper and SkRasterPipeline used
to be important, but it's no longer.  This CL moves everything
under src/jumper to the appropriate SkRasterPipeline file.

Change-Id: I1181fffafccb3dc4c4eb5f33b442c719ee370462
Reviewed-on: https://skia-review.googlesource.com/c/164627
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-24 11:15:58 +00:00
Mike Klein
1a3eb52992 trim off more bgra stages
Same deal as before, just swap_rb where needed.

The change to SkWebpCodec could probably land independently if we want.

Change-Id: Idd53ab76232cb95eb2f41cd65c6903fa7c5b01d6
Reviewed-on: https://skia-review.googlesource.com/c/163440
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-10-18 15:05:34 +00:00
Nigel Tao
372649890e Have EncodeBench avoid superfluous setup
We only need to decode the source file once, not multiple times.

Bug: skia:
Change-Id: I1067eac6b7acc482f97fb1835c1c219d21cc37e9
Reviewed-on: https://skia-review.googlesource.com/c/163300
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-18 01:16:00 +00:00
Nigel Tao
c96bf2f643 Rename EncoderBench.cpp to EncodeBench.cpp
Dropping the "r" makes it consistent with both the class name and
Benchmark::getName.

Bug: skia:
Change-Id: I17bcf699d162c678daabf92b4e39b7230428b98b
Reviewed-on: https://skia-review.googlesource.com/c/163280
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-17 23:26:37 +00:00
Brian Osman
cb3d087e71 Remove all remaining GrColor4f (other than gradients)
This adds SkPMColor4f conversions to/from RGBA bytes (ie GrColor).
I had previously made some free functions that did the same thing.
I'm ambivalent about which option is nicer, but wanted to have one
method, so I converted everything to use the new versions.

Bug: skia:
Change-Id: I4194c44b5bd12228075fd1932a14cf31c8d6a3c1
Reviewed-on: https://skia-review.googlesource.com/c/162560
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-10-16 19:45:53 +00:00
Greg Daniel
bdf12ad8d5 Move GrBackend enum to enum class.
Bug: skia:
Change-Id: I8add2470313549723be6720b543091c444d2eb4f
Reviewed-on: https://skia-review.googlesource.com/c/161680
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-10-12 14:01:58 +00:00
Michael Ludwig
076238f306 Add clear benchmark
Bug: skia:
Change-Id: I2cfc365e41942ad7cc3fbdf9b815df6e25b1f36f
Reviewed-on: https://skia-review.googlesource.com/c/160601
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2018-10-08 21:13:26 +00:00
Herb Derby
55bc0515a7 Fixup textblob benchmark
* Correctly translate glyphs
* Make subpixel
* Use subpixel positions

Change-Id: I0011fb6cc8b985c9a7bd058f8b2fbf4b525019de
Reviewed-on: https://skia-review.googlesource.com/c/160500
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-10-08 18:44:58 +00:00
Herb Derby
434377abfb Split out SkRunFont and SkPaint
Coping paints take significant time. The ApplyFontToPaint
idiom requires a copy and a dtor. This CL keeps the paint and
font in parallel through the code until a paint is actually
needed, then a special ctor is used to create it.

Also, inline a bunch of text blob calls that were showing up
in perf.

Change-Id: I7da746a287e4d3942e45e9536ef9acdc64f084d4
Reviewed-on: https://skia-review.googlesource.com/c/159222
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-10-05 16:10:07 +00:00
Mike Klein
4429a4f82c re-precate SkMatrix44::SkMatrix44()
It's been driving me nuts that I can't just write `SkMatrix44 m;`,
and I often don't care whether it's initialized or not.  The default
identity constructor would be nice to use, but it's deprecated.

By tagging this constructor deprecated, we're only hurting ourselves;
our big clients disable warnings about deprecated routines and use it
freely.

A quick tally in Skia shows we mostly use the uninitialized constructor,
but sometimes the identity constructor, and there is a spread of all
three in Chromium.  So I've left the two explicit calls available.

I switched a bunch of calls in Skia to use the less verbose constructor
where it was clear that it didn't matter if the matrix was initialized.
Literally zero of the kUninitialized constructor calls looked important
for performance, so the only place I've kept is its lone unit test.

A few places read clearer with an explicit "identity" to read.

Change-Id: I0573cb6201f5a36f3b43070fb111f7d9af92736f
Reviewed-on: https://skia-review.googlesource.com/c/159480
Reviewed-by: Brian Osman <brianosman@google.com>
2018-10-04 14:01:11 +00:00
Brian Osman
87311c6e56 Remove SkPM4fPriv.h includes, then IWYU
Bug: skia:
Change-Id: Ie59aace6ba7ca3685d481fcb3af508629c56f0c3
Reviewed-on: https://skia-review.googlesource.com/157742
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-09-28 15:17:04 +00:00
Mike Klein
512a24450f only build stats bar chart when it'll be printed
I keep seeing it show up on the profile(usually under memmove) of tight
benchmarks and it's kind of distracting.  We don't even print it when
we pass --quiet, so that seems like a nice way to stifle it.

Change-Id: I3a67a7ca1758fd35e3b63cfeeddeac4ff1ffe38d
Reviewed-on: https://skia-review.googlesource.com/157520
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-09-27 16:22:54 +00:00
Brian Osman
5ea41fc89b Remove more SkColorSpaceXform (and friends)
- gammaencodedpremul GM was just demonstrating something that we
  understand well (and have much better testing for).
- readpixels GM was filled with workarounds for things that are no
  longer true (unpremul images, clamped F16).
- Other uses can be switched to SkConvertPixels trivially.
- Remove SkColorSpaceXformPriv and SkColorLookUpTable, all unused.
- Remove SkColorSpaceXform_skcms.cpp, no longer referenced by clients.

Bug: skia:
Change-Id: I7298bb53aa61b49ad1398ebc504d35c119fd5cf4
Reviewed-on: https://skia-review.googlesource.com/157153
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-09-26 22:30:05 +00:00
Mike Reed
c25f440d53 Reland "add getAlphaf() to pixmap/bitmap"
This is a reland of f3ebd312f2

PS 2: use faster half->float routine
PS 3: relax tolerance to 2^-10 for half, keeping others 2^-12

Original change's description:
> add getAlphaf() to pixmap/bitmap
>
> Convenient for just extracting alpha (and more efficient than getColor()) and
> works for super-normal formats w/o loss of precision.
>
> Somewhat inspired by examining multiple chrome call-sites for getColor(), where
> chrome only really cared about the alpha. This new method runs about twice
> as fast as getColor() for the simple cases (i.e. no colorspace xforms), and
> even faster in the complex cases (since retrieving alpha doesn't care about
> colorspaces).
>
> Bug: skia:
> Change-Id: I7cd5a2c7f78de781aaa69dd1aa0dba3c532fcb73
> Reviewed-on: https://skia-review.googlesource.com/155606
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

Cq-Include-Trybots: skia.primary:Test-Android-Clang-Nexus7-CPU-Tegra3-arm-Debug-All-Android,Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SK_CPU_LIMIT_SSE2,Test-Debian9-GCC-GCE-CPU-AVX2-x86_64-Release-All,Test-Win2016-MSVC-GCE-CPU-AVX2-x86_64-Release-All,Test-Win8-Clang-Golo-CPU-AVX-x86_64-Debug-All
Bug: skia:
Change-Id: Ie94e5c89e185fde12cbd6c56ed4026c4dc5a1623
Reviewed-on: https://skia-review.googlesource.com/156242
Commit-Queue: Ravi Mistry <rmistry@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-09-21 17:41:03 +00:00
Mike Klein
60900b55f9 move skpipe to experimental
Nothing's using it except test tools.
I'd like to make that a bit clearer by getting it out of src.

Disabled the fuzzer.

Removed the bench so Android's building nanobench doesn't block this.

Bug: chromium:886713

Change-Id: I761f52c40171c27ff4b699409b32647e84684ec3
Reviewed-on: https://skia-review.googlesource.com/156240
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2018-09-21 17:20:25 +00:00
Mike Klein
6e78ae5525 Reland "have SkConvertPixels use SkColorSpaceXformSteps"
This is a reland of 6d0e566e94

On second thought, it's probably better to correct the
types of the swizzle functions to express their required alignment.
This is a more involved CL, but I think leaves things better off.

Original change's description:
> have SkConvertPixels use SkColorSpaceXformSteps
>
> This ought to allow the fast paths in more cases, e.g. memcpy() when
> both src and dst are the same format.  Today if we tag a dst color space
> at all, we'll think we need to fall back to the general case pipeline.
>
> Some refactoring too, but no big functional change beyond using steps.
>
> Change-Id: I8fa01025229e3b9418e7f43241a2f03628a97288
> Reviewed-on: https://skia-review.googlesource.com/155640
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

Change-Id: Ia17d93acfe88a36c4c36d29e3a0b243f91178b61
Reviewed-on: https://skia-review.googlesource.com/156241
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-09-21 16:18:06 +00:00
Robert Phillips
be852e44ef Revert "add getAlphaf() to pixmap/bitmap"
This reverts commit f3ebd312f2.

Reason for revert: unhappy bots

Original change's description:
> add getAlphaf() to pixmap/bitmap
> 
> Convenient for just extracting alpha (and more efficient than getColor()) and
> works for super-normal formats w/o loss of precision.
> 
> Somewhat inspired by examining multiple chrome call-sites for getColor(), where
> chrome only really cared about the alpha. This new method runs about twice
> as fast as getColor() for the simple cases (i.e. no colorspace xforms), and
> even faster in the complex cases (since retrieving alpha doesn't care about
> colorspaces).
> 
> Bug: skia:
> Change-Id: I7cd5a2c7f78de781aaa69dd1aa0dba3c532fcb73
> Reviewed-on: https://skia-review.googlesource.com/155606
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

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

Change-Id: I82ce00c09d16bf3e9b04f1c1bccd8cc6aa706ab2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/156000
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-09-20 19:48:08 +00:00
Mike Reed
f3ebd312f2 add getAlphaf() to pixmap/bitmap
Convenient for just extracting alpha (and more efficient than getColor()) and
works for super-normal formats w/o loss of precision.

Somewhat inspired by examining multiple chrome call-sites for getColor(), where
chrome only really cared about the alpha. This new method runs about twice
as fast as getColor() for the simple cases (i.e. no colorspace xforms), and
even faster in the complex cases (since retrieving alpha doesn't care about
colorspaces).

Bug: skia:
Change-Id: I7cd5a2c7f78de781aaa69dd1aa0dba3c532fcb73
Reviewed-on: https://skia-review.googlesource.com/155606
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-09-20 19:25:22 +00:00
Jim Van Verth
0f1bb92097 Add new PolyUtils benches
Bug: skia:
Change-Id: I62f02a122b431e6c9a866e80c441f3e18b1e69fb
Reviewed-on: https://skia-review.googlesource.com/155842
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2018-09-20 18:34:20 +00:00
Hal Canary
23564b9249 SkDocument: Factories now located in SkPDFDocument.h and SkXPSDocument.h
Change-Id: I48e73b27e52511292c2c0bd51ef0168766f53a80
Reviewed-on: https://skia-review.googlesource.com/152780
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-09-20 18:21:07 +00:00
Brian Osman
a5c578ff3d Add Short4 vertex attributes, and benchmark them as 4.12 colors
This reverts commit 90d2d9381e.

Updated to use float in the shader (many ES2 implementations
don't support integral types as attributes).

Bug: skia:
Change-Id: I0898f1730da60ff03f8165b2f1a3ee18a7b2fec8
Reviewed-on: https://skia-review.googlesource.com/155162
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-09-19 18:56:49 +00:00
Brian Osman
133823d9a7 Load SVGs into memory before parsing
On my Z840, Windows-Clang-Debug, this cuts the total time to construct
(parse) the 72 SVG sources from 66 seconds to 40 seconds. That's still
awful, but all the time is now spent in expat, so further improvements
will require higher level changes.

Bug: skia:
Change-Id: I0dca67ee18652f6fb8647fe8706716d9a01f7cdf
Reviewed-on: https://skia-review.googlesource.com/155603
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-09-19 18:35:59 +00:00
Hal Canary
8a00144035 test,tools: whitespace changes for clang-format
Change-Id: I67529f6c0ac26da603f60af22c620f8f603d8a19
Reviewed-on: https://skia-review.googlesource.com/155564
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
2018-09-19 17:50:51 +00:00
Brian Osman
90d2d9381e Revert "Add Short4 vertex attributes, and benchmark them as 4.12 colors"
This reverts commit d2ca0473f6.

Reason for revert: Various bots failing.

Original change's description:
> Add Short4 vertex attributes, and benchmark them as 4.12 colors
> 
> This is likely our best widely portable option for encoding wide gamut
> colors that doesnt sacrifice too much performance. The benchmark uses
> them as we're likely to do: 4.12 fixed point, in the destination color
> space. We're using SINT vertex attributes for simplicity, so the encode
> and decode are simple multiply/divide by 4096.
> 
> Bug: skia:
> Change-Id: I9b544f3e187b775d81f83dc9dd44611570ad33c2
> Reviewed-on: https://skia-review.googlesource.com/155001
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

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

Change-Id: I921e29cf9a121c5752ec7d99a03470b5193afd4a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/154883
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-09-17 20:41:30 +00:00
Brian Osman
d2ca0473f6 Add Short4 vertex attributes, and benchmark them as 4.12 colors
This is likely our best widely portable option for encoding wide gamut
colors that doesnt sacrifice too much performance. The benchmark uses
them as we're likely to do: 4.12 fixed point, in the destination color
space. We're using SINT vertex attributes for simplicity, so the encode
and decode are simple multiply/divide by 4096.

Bug: skia:
Change-Id: I9b544f3e187b775d81f83dc9dd44611570ad33c2
Reviewed-on: https://skia-review.googlesource.com/155001
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-09-17 20:19:07 +00:00
Brian Osman
499bf1a599 Add half-float vertex attribute caps bit and benchmark
Updates the existing vertex color bench with a half-float mode.
Vanilla GL2/ES2 don't have half-float attributes. The extension
(OES_vertex_half_float) uses a different enum value for the type
parameter. For now, just support GL3/ES3. Otherwise, we could
add a check in GrGLGpu::setupGeometry to re-map GL_HALF_FLOAT
to GL_HALF_FLOAT_OES, based on caps?

Bug: skia:
Change-Id: I1325087db4e615023cceffe1c5b051232769d0ac
Reviewed-on: https://skia-review.googlesource.com/154822
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-09-17 17:05:35 +00:00
Brian Osman
d4c29709ca Specify CPU (buffer) and GPU (shader) types explicitly in Attribute
The CPU type is still specified using GrVertexAttribType.
The GPU type is specified directly using GrSLType.

kHalfX_GrVertexAttribType now really means half-float buffer
data, rather than float. (Caveat: The GL enum is only correct
with ES3/GL3 - ES2+extension needs a different value. Sigh.)

Bug: skia:
Change-Id: Ife101db68a5d4ea1ddc2f6c60fbec0c66d725c16
Reviewed-on: https://skia-review.googlesource.com/154628
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-09-14 21:54:03 +00:00
Hal Canary
e650b85981 SkPDF: SkPDFMakeArray; clean up pdfutils, pdfresourcedict
New templated function SkPDFMakeArray that for example replaced this
code:

    auto array = sk_make_sp<SkPDFArray>();
    array->reserve(4);
    array->appendInt(0);
    array->appendInt(0);
    array->appendInt(width);
    array->appendInt(height);

with this code:

    auto array = SkPDFMakeArray(0, 0, width, height);

Move some functions from SkPDFUtils to the only place they
are used and make them static: SkPDFUtils::AppendTransform,
SkPDFUtils::DrawFormXObject, SkPDFUtils::WriteString, and
SkPDFUtils::AppendCubic.

Also replaced SkPDFResourceDict::getResourceName with
SkPDFResourceDict::WriteResourceName and eliminated
SkPDFResourceDict::GetResourceTypePrefix.

Change-Id: I891339fa2d1e5819f22fb8d10d8d8ef75c9507e3
Reviewed-on: https://skia-review.googlesource.com/153884
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2018-09-12 21:41:35 +00:00
Cary Clark
60ebf14ccc Revert "SkStream: remove some WStream functions from public api"
This reverts commit 8b68110507.

Reason for revert: breaks bots

Original change's description:
> SkStream: remove some WStream functions from public api
> 
> move functions to SkStringPriv.h
> 
> also add SkStrAppendU32Hex() function, and re-write
> SkString::insertHex() to use SkStrAppendU32Hex.
> 
> add unit tests.
> 
> Change-Id: Ieda98fb4106db71565b607e593713a91a5ddd892
> Reviewed-on: https://skia-review.googlesource.com/151986
> Reviewed-by: Cary Clark <caryclark@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>

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

Change-Id: Idbac615092f46c18b38e08385dafba20930f0ff0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/152121
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-09-06 12:22:41 +00:00
Hal Canary
8b68110507 SkStream: remove some WStream functions from public api
move functions to SkStringPriv.h

also add SkStrAppendU32Hex() function, and re-write
SkString::insertHex() to use SkStrAppendU32Hex.

add unit tests.

Change-Id: Ieda98fb4106db71565b607e593713a91a5ddd892
Reviewed-on: https://skia-review.googlesource.com/151986
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-09-06 11:44:11 +00:00
Brian Salomon
343553a1fe Don't use MEM_MOVE=true with SkTArrays of sk_sp
The code generated from std::move()ing them should be fine.

Bug: skia:8355
Change-Id: I63ef650b5fbcf9fb6356006190eae5e0977ae642
Reviewed-on: https://skia-review.googlesource.com/151982
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-09-05 20:11:07 +00:00
Hal Canary
9e41c216de SkPDF: use more vector<>, more sk_sp<>, cleanup.
All PDFs are identical.

Change-Id: If2af8519a6440a5b61f91bf78fc7ae241f728183
Reviewed-on: https://skia-review.googlesource.com/151220
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
2018-09-05 15:12:16 +00:00
Brian Osman
6b622963a0 Reland "Stop conflating F16 with linear gamma"
This reverts commit 5f7b5e3624.

Reason for revert: Codec CL has re-landed.

Original change's description:
> Revert "Stop conflating F16 with linear gamma"
> 
> This reverts commit d1589c7213.
> 
> Reason for revert: Depends on skcms CL that's been reverted.
> 
> Original change's description:
> > Stop conflating F16 with linear gamma
> > 
> > Note to self: I debugged this, realized that the codecs
> > need to handle A2B -> XYZ, then realized that I just need
> > to wait for https://skia-review.googlesource.com/c/skia/+/136062
> > 
> > Bug: skia:
> > Change-Id: I594c22076feb3700b8a40c471a541fef5ff4e13e
> > Reviewed-on: https://skia-review.googlesource.com/137587
> > Commit-Queue: Brian Osman <brianosman@google.com>
> > Reviewed-by: Mike Klein <mtklein@google.com>
> 
> TBR=mtklein@google.com,brianosman@google.com
> 
> Change-Id: I6dca583697c8efd2563d30cb7ab9ef505b6903ae
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/148860
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

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

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

Bug: skia:
Change-Id: Iee66531049843758e7ed4130b99d8df6a553d805
Reviewed-on: https://skia-review.googlesource.com/149700
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-08-28 14:23:27 +00:00
Brian Osman
5f7b5e3624 Revert "Stop conflating F16 with linear gamma"
This reverts commit d1589c7213.

Reason for revert: Depends on skcms CL that's been reverted.

Original change's description:
> Stop conflating F16 with linear gamma
> 
> Note to self: I debugged this, realized that the codecs
> need to handle A2B -> XYZ, then realized that I just need
> to wait for https://skia-review.googlesource.com/c/skia/+/136062
> 
> Bug: skia:
> Change-Id: I594c22076feb3700b8a40c471a541fef5ff4e13e
> Reviewed-on: https://skia-review.googlesource.com/137587
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

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

Change-Id: I6dca583697c8efd2563d30cb7ab9ef505b6903ae
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/148860
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-08-23 01:57:13 +00:00
Brian Osman
d1589c7213 Stop conflating F16 with linear gamma
Note to self: I debugged this, realized that the codecs
need to handle A2B -> XYZ, then realized that I just need
to wait for https://skia-review.googlesource.com/c/skia/+/136062

Bug: skia:
Change-Id: I594c22076feb3700b8a40c471a541fef5ff4e13e
Reviewed-on: https://skia-review.googlesource.com/137587
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-08-22 19:54:57 +00:00
Mike Klein
e03a176510 streamline interface to GrColorSpaceXform::Make()
We can now pass all cs/at params, so no need for UnpremulToUnpremul().

Also found a spot to use sk_srgb_singleton().

Does this make sense to apply to GrColorSpaceXformEffect too?

Change-Id: I1ee1f5919aa2ae841a98eeb5662cb80c244b1049
Reviewed-on: https://skia-review.googlesource.com/148665
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-08-22 17:09:02 +00:00
Chris Dalton
e1639695bf ccpr: Rename GrCCPathParser to GrCCFiller
Various renames and other refactorings that will allow us to add new
stroking classes alongside the existing code for fills.

Bug: skia:
Change-Id: Ib477f9e1d87f9d4c1604719f9af0695a53614081
Reviewed-on: https://skia-review.googlesource.com/147503
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-08-20 20:25:24 +00:00
Robert Phillips
15e60a4d4f Remove occluded rrect blur benchmark
Change-Id: I7e04cfcd0d4557f0dd1e6b3848fc746cc62eb0d2
Reviewed-on: https://skia-review.googlesource.com/148100
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-08-20 19:01:00 +00:00
Mike Reed
cf7258abac add bench for cubicmap
Bug: skia:
Change-Id: Ie88de751e6f889eed02fba1d13e712345256ac72
Reviewed-on: https://skia-review.googlesource.com/147210
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2018-08-15 20:51:57 +00:00
Mike Klein
8f3d36c97d add dstAT param to xform steps
All the existing calls are ported over, and new tests cover
unpremul output. (Opaque output is an impossible request.)

Change-Id: I744d640763cf74c368d3b3aba4a262c8fd9f7a01
Reviewed-on: https://skia-review.googlesource.com/147100
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
2018-08-14 16:26:53 +00:00
Brian Osman
1e4a4daebe Remove dead code from Benchmark
Spotted the VisualBench hooks the other day, then found some more dead
code when I went to remove them.

Change-Id: Ia07f0556faf33cc69e3ec590f7a8f47f2c1f298a
Reviewed-on: https://skia-review.googlesource.com/146360
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-08-09 13:07:28 +00:00
Mike Klein
c857956fad transform colors with steps + raster pipeline in SkColorSpaceXformer
I hate SkColorSpaceXform,
and we think this is going to be faster, especially for single colors.

Add this mode of operation to our bench from yesterday.
No surprise, it's exactly as fast as pipeA.

This may DO the TODO?

Change-Id: I1b42b42d7647d85b62cd8397bb8d6f39c4829bcf
Reviewed-on: https://skia-review.googlesource.com/145823
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-08-08 00:27:53 +00:00
Herb Derby
430424bd74 Update text blob benchmark to reflect reality
w/ mtklein suggestions

Change-Id: Ifd7310ad71020c23514c663a0671400112b04e75
Reviewed-on: https://skia-review.googlesource.com/145824
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Auto-Submit: Herb Derby <herb@google.com>
2018-08-07 18:27:50 +00:00
Mike Klein
4ed73e09d3 Add a bench for various single color xforms
PipeA is where we want to be, and probably by filling in something
like the TODO I left in SkColorSpaceXformSteps.h?

    curr/maxrss	loops	min	median	mean	max	stddev	samples   	config	bench
      13/13  MB	49	82.8ns	83.2ns	83.2ns	84.1ns	0%	█▂▅▄▂▁▃▄▃▃	nonrendering	ColorSpaceXformBench_pipeB
      13/13  MB	1259	29.6ns	29.7ns	30.4ns	37.2ns	8%	▁▁▁▁▁▁▁▁▁█	nonrendering	ColorSpaceXformBench_pipeA
      13/13  MB	661	110ns	119ns	119ns	128ns	4%	▅▅▅▅▅▅▅▅█▁	nonrendering	ColorSpaceXformBench_steps
      13/13  MB	26	239ns	247ns	283ns	609ns	40%	▁▁█▁▁▁▁▁▁▁	nonrendering	ColorSpaceXformBench_xform

Change-Id: I98af634ab0a7a1522a5bcfde9ce3fc934d82ecf8
Reviewed-on: https://skia-review.googlesource.com/145643
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-08-07 14:30:28 +00:00
Brian Salomon
7eae3e04e3 Reland "Move GrGeometryProcessor's textures out of classes and into"
This reverts commit fdf05f4ff4.

Reason for revert: Android fixed after removing multitexture support from TextureOp.

Original change's description:
> Revert "Move GrGeometryProcessor's textures out of classes and into"
> 
> This reverts commit af87483873.
> 
> Revert "GrGeometryProcessor derives from GrNonAtomicRef not GrProgramElement."
> 
> This reverts commit 607be37e3d.
> 
> Revert "Store GrMeshDrawOps' meshes in GrOpFlushState's arena."
> 
> This reverts commit b948572c78.
> 
> Revert "Remove multitexturing support from GrTextureOp."
> 
> This reverts commit 986f64c601.
> 
> Revert "Make result of GrOp::combineIfPossible be an enum."
> 
> This reverts commit 641ac7daa8.
> 
> Bug: b/112244393
> Change-Id: I579491a3f2f2f2093f1e2a6141fa1e4cc7b760a4
> Reviewed-on: https://skia-review.googlesource.com/145646
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com

Change-Id: I1d41c2ecf7862e31fb025a7a00bb07bae9d83a47
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/112244393
Reviewed-on: https://skia-review.googlesource.com/145780
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-08-07 14:02:49 +00:00
Brian Salomon
fdf05f4ff4 Revert "Move GrGeometryProcessor's textures out of classes and into"
This reverts commit af87483873.

Revert "GrGeometryProcessor derives from GrNonAtomicRef not GrProgramElement."

This reverts commit 607be37e3d.

Revert "Store GrMeshDrawOps' meshes in GrOpFlushState's arena."

This reverts commit b948572c78.

Revert "Remove multitexturing support from GrTextureOp."

This reverts commit 986f64c601.

Revert "Make result of GrOp::combineIfPossible be an enum."

This reverts commit 641ac7daa8.

Bug: b/112244393
Change-Id: I579491a3f2f2f2093f1e2a6141fa1e4cc7b760a4
Reviewed-on: https://skia-review.googlesource.com/145646
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-08-06 22:27:48 +00:00
Brian Salomon
641ac7daa8 Make result of GrOp::combineIfPossible be an enum.
This is to prepare for a third value that requests that ops be linked
together so that the first op may do the work for multiple linked ops
without actually merging the GrOp objects.

Change-Id: Ib6e012a89be5edd054aee69d8475bea612331852
Reviewed-on: https://skia-review.googlesource.com/145522
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
2018-08-06 20:29:47 +00:00
Brian Salomon
986f64c601 Remove multitexturing support from GrTextureOp.
This turned out to be an optimization mostly for draws with small device
space areas. Moreover, to be an optimization rather than deoptimization
requires complicated per-GPU tuning where even different devices within
the same architecture require different tuning and tuning is different
between GL and VK.

We've decided to go another direction where we *don't* coalesce draws
but rather make it possible to switch textures quickly from within an
op. This should be a GPU-independent optimization that is also
independent of device space area covered.

Replaces the multitexturing benchmarks with a pair of benchmarks.

composting_images* simulates a layered tile-based compositor.

image_cycle draws tiny images N times each such that they can be
batched. This is to catch a particular possible regression in a
planned change to GrTextureOp where it will use "dynamic state" to
batch across textures. We want to catch a slowdown that might result
from putting draws that use the same texture into the same op but no
longer batching the actual GL level draws and instead using the dynamic
state to "switch" textures between draws.

Change-Id: Ib1cc437525b0b0d56969c30dcb66bb1effb42dc5
Reviewed-on: https://skia-review.googlesource.com/145423
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-08-06 19:59:01 +00:00
Brian Salomon
b948572c78 Store GrMeshDrawOps' meshes in GrOpFlushState's arena.
Remove late draw consolidation in GrOpFlushState. Rarely did anything
and doesn't work with new allocation strategy. Ops can use GrMesh arrays
to acheive the same thing. (Each Op that cared to would have to implement
but it isn't applicable to most Ops).

Modify GrMeshDrawOp::Target::draw() to take array of meshes, with single
mesh as a special case.

Change-Id: I552677de47b9ffd2fcaf55af85f70f290e5aa9c7
Reviewed-on: https://skia-review.googlesource.com/145426
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-08-06 14:38:22 +00:00
Brian Salomon
607be37e3d GrGeometryProcessor derives from GrNonAtomicRef not GrProgramElement.
It probably doesn't need to be ref counted at all and should be stored
in GrOpFlushState's arena but that's a larger change for another day.

Change-Id: I5f593fb426b8e7794f2ca81194f5a8d9e0f0a072
Reviewed-on: https://skia-review.googlesource.com/145332
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-08-03 20:51:48 +00:00
Hal Canary
972eba3c5c sk_tool::Registry: make an iterator.
Change-Id: Icf4e31b50bbd91b7ea330a1300f736d6dfd0a41c
Reviewed-on: https://skia-review.googlesource.com/144500
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
2018-08-01 16:59:19 +00:00
Mike Klein
e28a6b55df add explicit accessor for sRGB singleton colorspaces
SkColorSpace::MakeSRGB().get() is scary, and causes more ref/unref
pairs than strictly necessary for these singletons.

This time the implementation is still in SkColorSpace.cpp,
so these should really work as singletons.

Change-Id: I40f2942c8dcde3040663a04c4f5330aca90868ae
Reviewed-on: https://skia-review.googlesource.com/143305
Auto-Submit: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-07-25 23:51:15 +00:00
Jim Van Verth
0067369061 Reland "Reland "Add some optimizations to PolyUtils""
This is a reland of 946c37057f

Original change's description:
> Reland "Add some optimizations to PolyUtils"
> 
> This is a reland of 8bb0db3d07
> 
> Original change's description:
> > Add some optimizations to PolyUtils
> > 
> > * Switch inset/offset code to use a linked list rather than an array
> > * Use std::set to store active edge list for IsSimplePolygon rather than array
> > * Pre-alloc the priority queue for IsSimplePolygon
> > * When adding radial curves, expand the array all at once rather than pushing
> > one at a time.
> > 
> > Bug: skia:
> > Change-Id: I692f8c29c500c41ec1d1be39d924d8a752676bf4
> > Reviewed-on: https://skia-review.googlesource.com/140787
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Commit-Queue: Jim Van Verth <jvanverth@google.com>
> 
> Bug: skia:
> Change-Id: I3f5d42cfb941deab2b28bed020b37ce199e91d3d
> Reviewed-on: https://skia-review.googlesource.com/142200
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>

Bug: skia:
Change-Id: I598d4be9108d009d0f885cfa72bf9197fc286b3a
Reviewed-on: https://skia-review.googlesource.com/142920
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2018-07-23 15:50:56 +00:00
Brian Osman
387eaff6c1 Vertex color xform bench
Measures two different strategies for dealing with color space transform
of per-op colors. Assuming we already use vertex colors, is it better to
transform them on the CPU, and use float4 color attributes, or transform
them on the GPU, and use ubyte4 color attributes?

So far, looks like ubyte4 w/GPU transform wins.

Change-Id: If49d75303f669fe7f78af8771af906fa0e872577
Reviewed-on: https://skia-review.googlesource.com/142801
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-07-20 21:07:16 +00:00
Ben Wagner
e9dd316a00 Revert "Reland "Add some optimizations to PolyUtils""
This reverts commit 946c37057f.

Reason for revert: strict weak ordering: ((__x LT __y) && (__y LT __x)) != false

Original change's description:
> Reland "Add some optimizations to PolyUtils"
> 
> This is a reland of 8bb0db3d07
> 
> Original change's description:
> > Add some optimizations to PolyUtils
> > 
> > * Switch inset/offset code to use a linked list rather than an array
> > * Use std::set to store active edge list for IsSimplePolygon rather than array
> > * Pre-alloc the priority queue for IsSimplePolygon
> > * When adding radial curves, expand the array all at once rather than pushing
> > one at a time.
> > 
> > Bug: skia:
> > Change-Id: I692f8c29c500c41ec1d1be39d924d8a752676bf4
> > Reviewed-on: https://skia-review.googlesource.com/140787
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Commit-Queue: Jim Van Verth <jvanverth@google.com>
> 
> Bug: skia:
> Change-Id: I3f5d42cfb941deab2b28bed020b37ce199e91d3d
> Reviewed-on: https://skia-review.googlesource.com/142200
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>

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

Change-Id: Ie8cdf2375613c51dedaf0d11125d6d22d88821df
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/142281
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-07-18 21:28:02 +00:00
Jim Van Verth
946c37057f Reland "Add some optimizations to PolyUtils"
This is a reland of 8bb0db3d07

Original change's description:
> Add some optimizations to PolyUtils
> 
> * Switch inset/offset code to use a linked list rather than an array
> * Use std::set to store active edge list for IsSimplePolygon rather than array
> * Pre-alloc the priority queue for IsSimplePolygon
> * When adding radial curves, expand the array all at once rather than pushing
> one at a time.
> 
> Bug: skia:
> Change-Id: I692f8c29c500c41ec1d1be39d924d8a752676bf4
> Reviewed-on: https://skia-review.googlesource.com/140787
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>

Bug: skia:
Change-Id: I3f5d42cfb941deab2b28bed020b37ce199e91d3d
Reviewed-on: https://skia-review.googlesource.com/142200
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2018-07-18 18:37:03 +00:00
Jim Van Verth
3229e65886 Revert "Add some optimizations to PolyUtils"
This reverts commit 8bb0db3d07.

Reason for revert: Breaking Google3.

Original change's description:
> Add some optimizations to PolyUtils
> 
> * Switch inset/offset code to use a linked list rather than an array
> * Use std::set to store active edge list for IsSimplePolygon rather than array
> * Pre-alloc the priority queue for IsSimplePolygon
> * When adding radial curves, expand the array all at once rather than pushing
> one at a time.
> 
> Bug: skia:
> Change-Id: I692f8c29c500c41ec1d1be39d924d8a752676bf4
> Reviewed-on: https://skia-review.googlesource.com/140787
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>

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

Change-Id: Ie8afecd899fa9bd79d22fdf46ec82a0c9e94e893
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/141980
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2018-07-17 20:22:51 +00:00
Jim Van Verth
8bb0db3d07 Add some optimizations to PolyUtils
* Switch inset/offset code to use a linked list rather than an array
* Use std::set to store active edge list for IsSimplePolygon rather than array
* Pre-alloc the priority queue for IsSimplePolygon
* When adding radial curves, expand the array all at once rather than pushing
one at a time.

Bug: skia:
Change-Id: I692f8c29c500c41ec1d1be39d924d8a752676bf4
Reviewed-on: https://skia-review.googlesource.com/140787
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2018-07-17 18:47:11 +00:00