Commit Graph

2783 Commits

Author SHA1 Message Date
Kevin Lubick
8499e372ce [includes] Remove more includes of SkColorSpace
While I was fixing up Chrome's uses, I found some failures
there that I did not see in Skia, and tracked them down
to a few other places where we include SkColorSpace
and it is not strictly necessary

 - SkCustomMesh.h
 - GrColorInfo.h
 - GrColorSpaceXform.h
 - SkColorSpaceXformSteps.h

For these files (and their .cpp files), I added enforcement
of include-what-you-use, and then fixed the myriad of places
which were depending on these transitive includes.

One change to help Chrome is the manual overloads of
SkImage::MakeFromAdoptedTexture instead of using default
parameters. This makes it so callers of that function
do not need to include SkColorSpace if they were going
to pass nullptr for it anyway.

Bug: skia:13052
Change-Id: I16bf8ed5e258225d887f562f2c189623b1ca9c23
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527056
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-04-06 21:58:24 +00:00
Kevin Lubick
5e8f45faf1 [includes] Prepare for moving SkColorSpace to forward declare
This updates all our callsites in preparation for removing
the #include "include/core/SkColorSpace.h" from SkImageInfo.h

According to go/chrome-includes [1], this will save ~150MB
(0.07%) from the compilation size. I think SkColorSpace is
a big include because it loads the skcms header, which is
big.

The follow-on CL will remove that link, once clients have
been updated as well.

[1] https://commondatastorage.googleapis.com/chromium-browser-clang/chrome_includes_2022-03-31_124042.html#view=edges&filter=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImageInfo%5C.h%24&sort=asize&reverse=&includer=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImageInfo%5C.h%24&included=&limit=1000

Change-Id: I1b5ff491ac495317b0e5af3a2082b080d43697ae
Bug: skia:13052
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/525639
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-31 19:50:10 +00:00
Michael Ludwig
027b9c0d38 Remove GrAA parameter from drawing functions that support per-edge AA
Bug: skia:13114
Change-Id: I653ab746927abdd1491e070e2e27252bf056d233
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526024
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2022-03-31 19:25:26 +00:00
Greg Daniel
5d67b1797a [graphite] Use finished callbacks in nanobench to manage frames.
In nanobench we want to try and simulate a GPUs swapbuffering and not
get too far ahead on the CPU. Thus we use finished callbacks to know if
we get more than 3 frames ahead of the GPU. This CL adds support for
Graphite to do this.

Bug: skia:12974
Change-Id: I8be505c5769399dcc0f5954f9f999f4448633647
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/525186
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2022-03-28 20:14:30 +00:00
Robert Phillips
6475432767 [graphite] Add failure mode to Recorder::snap
Bug: skia:12701
Change-Id: Ib7e52f26b31cfed8fb4da1929755035a69951ca5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524220
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2022-03-25 17:49:53 +00:00
Greg Daniel
00ce96456b [graphite] Add support for finished callbacks.
This also reworks a little bit about what we send to insertRecording
and what we store on Context.

Bug: skia:12974
Change-Id: I747a1cdd1559d4d5fbe928e689a23a734142557b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524012
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-03-25 14:47:05 +00:00
Michael Ludwig
0378307904 Move skgpu::v1-specific [Stroke|Path]Tessellators out of tessellate/
The static functionality for writing vertex buffers, constants, and
utility functions that were in the StrokeTessellator and PathTessellator
classes have been moved into Tessellation.h and a new
FixedCountBufferUtils.h.

The tessellator hierarchy has been moved into src/gpu/ops and all the
v1 guards are removed since they were already solely v1 after the static
functions were lifted out. The hierarchy and subclasses are preserved
but have been combined into just StrokeTessellator.h and
PathTessellator.h instead of separate files for the subclasses.

All the rest of the little changes are updating references and includes.

Bug: skia:13012
Change-Id: I90f2f53538349cf9ad1823a0c42fbdc772190a49
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523189
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2022-03-22 16:04:13 +00:00
Greg Daniel
ff138c94d6 [graphite] Add support to nanobench for Graphite.
Bug: skia:12974
Change-Id: I70f3ec7901cd32c2f61b23b3f41675fb1db16614
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516805
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-03-14 20:10:30 +00:00
Aditya Kushwah
52771e2bb3 Plumbing the label string through Skia.
This CL defines a const string in GrGPUResource and have the
constructors accept it. The label string is then plumbed through the
system for other components to accept it.

Bug: chromium:1164111
Change-Id: I6cc759f9263dedd4b2cc0c3ca7cf280be5d74174
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/508798
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-03-11 03:06:47 +00:00
Kevin Lubick
efce17de5d Reland "[includes] Remove link between SkImage.h and SkImageEncoder.h"
This is a reland of commit f60584eb0f

Client changes:
 - https://chromium-review.googlesource.com/c/chromium/src/+/3508565
 - http://cl/433225409
 - http://cl/433450799

Original change's description:
> [includes] Remove link between SkImage.h and SkImageEncoder.h
>
> According to go/chrome-includes [1], this will save about
> 210MB (0.09%) off the Chrome build. http://screen/GVdDaRRneTRuroL
>
> [1] https://commondatastorage.googleapis.com/chromium-browser-clang/include-analysis.html#view=edges&filter=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImage%5C.h%24&sort=asize&reverse=&includer=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImage%5C.h%24&included=&limit=1000
>
> Change-Id: If911ec283a9ce2b07c8509768a6a05446573a215
> Bug: 242216
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512416
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Kevin Lubick <kjlubick@google.com>

Bug: 242216
Change-Id: Ic61e4ac2878e7a51f389312a3a434856e2e32be3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/518277
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-10 04:47:51 +00:00
Kevin Lubick
cbc954bf57 [includes] Remove include link between SkPath.h and SkPathRef.h
According to go/chrome-includes [1], this will save about
185MB (0.08%) off the Chrome build (some of which is handled
by https://skia-review.googlesource.com/c/skia/+/512776).
http://screen/3foDapQ5BN7srcG

This adds several forward declares and moves several
implementations from SkPath.h to SkPath.cpp.

This also removes privateSetConvexity from SkPathBuilder
because the SkPathConvexity being set to a non-zero default
value would have required moving the enum out of SkPathRef
or adding an include link. This private API was only used
in one location, so I just opted to remove it.

[1] https://commondatastorage.googleapis.com/chromium-browser-clang/include-analysis.html#view=edges&filter=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkPath%5C.h%24&sort=asize&reverse=&includer=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkPath%5C.h%24&included=&limit=1000

Change-Id: Ie1f83ac3eee6eb19d7ded18a41a7532f445c13ee
Bug: 242216
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512357
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2022-03-09 00:55:54 +00:00
Kevin Lubick
a573cbab1a Revert "[includes] Remove link between SkImage.h and SkImageEncoder.h"
This reverts commit f60584eb0f.

Reason for revert: Chrome and G3 issues

Original change's description:
> [includes] Remove link between SkImage.h and SkImageEncoder.h
>
> According to go/chrome-includes [1], this will save about
> 210MB (0.09%) off the Chrome build. http://screen/GVdDaRRneTRuroL
>
> [1] https://commondatastorage.googleapis.com/chromium-browser-clang/include-analysis.html#view=edges&filter=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImage%5C.h%24&sort=asize&reverse=&includer=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImage%5C.h%24&included=&limit=1000
>
> Canary-Android-Topic: image-encoder-2
> Change-Id: If911ec283a9ce2b07c8509768a6a05446573a215
> Bug: 242216
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512416
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Kevin Lubick <kjlubick@google.com>

Bug: 242216
Change-Id: Idc906ff54d8baf49989d3ee24e045d7b0ca710df
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/517676
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Kevin Lubick <kjlubick@google.com>
2022-03-08 13:09:49 +00:00
Kevin Lubick
f60584eb0f [includes] Remove link between SkImage.h and SkImageEncoder.h
According to go/chrome-includes [1], this will save about
210MB (0.09%) off the Chrome build. http://screen/GVdDaRRneTRuroL

[1] https://commondatastorage.googleapis.com/chromium-browser-clang/include-analysis.html#view=edges&filter=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImage%5C.h%24&sort=asize&reverse=&includer=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImage%5C.h%24&included=&limit=1000

Canary-Android-Topic: image-encoder-2
Change-Id: If911ec283a9ce2b07c8509768a6a05446573a215
Bug: 242216
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512416
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-07 21:32:13 +00:00
Kevin Lubick
2d86f6f5db Reland "[includes] Remove include link between SkPathRef.h and SkRRect.h"
This is a reland of 37b8239bec

Upstack changes:
 - http://ag/17004908
 - https://github.com/flutter/engine/pull/31654

Original change's description:
> [includes] Remove include link between SkPathRef.h and SkRRect.h
>
> According to go/chrome-includes [1], this will save about
> 40MB (0.02%) off the Chrome build. http://screen/4GnPjFaYpwCVHVL
>
> I'm not quite sure why the link is so expensive, but we can
> forward declare it and move the implementation from the .h
> to the .cpp file easily enough.
>
> [1] https://commondatastorage.googleapis.com/chromium-browser-clang/include-analysis.html#view=edges&filter=%5Ethird_party%2Fskia%2Finclude%2Fprivate%2FSkPathRef%5C.h%24&sort=includes&reverse=&includer=%5Ethird_party%2Fskia%2Finclude%2Fprivate%2FSkPathRef%5C.h%24&included=&limit=1000
>
> Canary-Chromium-CL: 3485346
> Change-Id: Ie3a5e7a735426f883a6c06ddbd3b8bf148bf1709
> Bug: 242216
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512158
> Reviewed-by: Robert Phillips <robertphillips@google.com>

Bug: 242216
Change-Id: I31288895528251fd59913427b95b9f88a871d14b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512776
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-07 15:15:05 +00:00
Julia Lavrova
5716c3ffa4 Reland "Reland "Adding a trace to nanobench for RP/VM comparison""
This reverts commit 0e48516aae.

Reason for revert: Again trying to land this CL
Original change's description:
> Revert "Reland "Adding a trace to nanobench for RP/VM comparison""
>
> This reverts commit 94b8dd6710.
>
> Reason for revert: https://ci.chromium.org/p/chromium/builders/try/android-marshmallow-x86-rel appears to either not support this instruction or it is disabled.
>
> Original change's description:
> > Reland "Adding a trace to nanobench for RP/VM comparison"
> >
> > This reverts commit 39728eb980.
> >
> > Reason for revert: Need to reland after I figure out what happened
> >
> > Original change's description:
> > > Revert "Adding a trace to nanobench for RP/VM comparison"
> > >
> > > This reverts commit e855b1273f.
> > >
> > > Reason for revert: breaking the tree
> > >
> > > Original change's description:
> > > > Adding a trace to nanobench for RP/VM comparison
> > > >
> > > > Run nanobench with --compare key and collect data for comparison:
> > > > ./out/Release/nanobench --csv --config 8888 --skvm --compare --loops 100 --samples 1 --match $(ls skps | grep --invert-match svg ) 2>&1 | tee VM.data
> > > > ./out/Release/nanobench --csv --config 8888 --forceRasterPipeline --compare --loops 100 --samples 1 --match $(ls skps | grep --invert-match svg ) 2>&1 | tee RP.data
> > > > awk 'BEGIN {OFS=","; fileNum = 0} ($2 ~ /MB/) && fileNum == 0 {vmvmcycles[$3] = $6; vmvmscan[$3] = $8; vmvmpixels[$3] = $10; vmvminterp[$3] = $11;  vmrpcycle[$3] = $14; vmrpscan[$3] = $16; vmrppixels[$3] = $18} ($2 ~ /MB/) && fileNum == 1  {print $3, vmvmcycles[$3], vmvmscan[$3], vmvmpixels[$3], vmvminterp[$3], $6, $8, $10, $11, $14, $16, $18} ENDFILE {fileNum += 1}' VM.data RP.data > compare.csv
> > > >
> > > > You can see an example of comparison table here:
> > > > https://docs.google.com/spreadsheets/d/1Q57oz6Jn8JPQkPzUbtO0fcZh2VhwPhxwsLaHnSb9uR0/edit#gid=406063636
> > > >
> > > > Change-Id: I8fa35e3fb087bce00ab19355a3bc021334aa7a80
> > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501337
> > > > Reviewed-by: Herb Derby <herb@google.com>
> > > > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> > >
> > > Change-Id: I6799b90ffd8bc05c65d1185bfc07a06af05e2038
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507182
> > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> > > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> >
> > Change-Id: I3668b5a40f310598e23c922b1eb6f93db4dac13c
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507183
> > Reviewed-by: Herb Derby <herb@google.com>
> > Commit-Queue: Julia Lavrova <jlavrova@google.com>
>
> Change-Id: I5d0174fca1aeaa0f3e75a8e1f643265701068f42
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/508396
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>

Change-Id: Ibf7c8957427dc8a1cdc133774608b48ab6715c7f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/508536
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2022-02-24 19:11:14 +00:00
Kevin Lubick
32b1e5d861 Revert "[includes] Remove include link between SkPathRef.h and SkRRect.h"
This reverts commit 37b8239bec.

Reason for revert: Need to update clients, including Flutter

Original change's description:
> [includes] Remove include link between SkPathRef.h and SkRRect.h
>
> According to go/chrome-includes [1], this will save about
> 40MB (0.02%) off the Chrome build. http://screen/4GnPjFaYpwCVHVL
>
> I'm not quite sure why the link is so expensive, but we can
> forward declare it and move the implementation from the .h
> to the .cpp file easily enough.
>
> [1] https://commondatastorage.googleapis.com/chromium-browser-clang/include-analysis.html#view=edges&filter=%5Ethird_party%2Fskia%2Finclude%2Fprivate%2FSkPathRef%5C.h%24&sort=includes&reverse=&includer=%5Ethird_party%2Fskia%2Finclude%2Fprivate%2FSkPathRef%5C.h%24&included=&limit=1000
>
> Canary-Chromium-CL: 3485346
> Change-Id: Ie3a5e7a735426f883a6c06ddbd3b8bf148bf1709
> Bug: 242216
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512158
> Reviewed-by: Robert Phillips <robertphillips@google.com>

Bug: 242216
Change-Id: I226c45326b67dff3eb1dc1f96c11e9ef0a12e22b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512639
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2022-02-24 12:55:26 +00:00
Kevin Lubick
37b8239bec [includes] Remove include link between SkPathRef.h and SkRRect.h
According to go/chrome-includes [1], this will save about
40MB (0.02%) off the Chrome build. http://screen/4GnPjFaYpwCVHVL

I'm not quite sure why the link is so expensive, but we can
forward declare it and move the implementation from the .h
to the .cpp file easily enough.

[1] https://commondatastorage.googleapis.com/chromium-browser-clang/include-analysis.html#view=edges&filter=%5Ethird_party%2Fskia%2Finclude%2Fprivate%2FSkPathRef%5C.h%24&sort=includes&reverse=&includer=%5Ethird_party%2Fskia%2Finclude%2Fprivate%2FSkPathRef%5C.h%24&included=&limit=1000

Canary-Chromium-CL: 3485346
Change-Id: Ie3a5e7a735426f883a6c06ddbd3b8bf148bf1709
Bug: 242216
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512158
Reviewed-by: Robert Phillips <robertphillips@google.com>
2022-02-23 22:46:44 +00:00
Jim Van Verth
d6245fc4aa Rename GrSwizzle to skgpu::Swizzle
Bug: skia:12845
Change-Id: Ia03293c4efdad4c5381a713c9d7d4857b79530c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/509398
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2022-02-16 13:30:14 +00:00
Ben Wagner
0e48516aae Revert "Reland "Adding a trace to nanobench for RP/VM comparison""
This reverts commit 94b8dd6710.

Reason for revert: https://ci.chromium.org/p/chromium/builders/try/android-marshmallow-x86-rel appears to either not support this instruction or it is disabled.

Original change's description:
> Reland "Adding a trace to nanobench for RP/VM comparison"
>
> This reverts commit 39728eb980.
>
> Reason for revert: Need to reland after I figure out what happened
>
> Original change's description:
> > Revert "Adding a trace to nanobench for RP/VM comparison"
> >
> > This reverts commit e855b1273f.
> >
> > Reason for revert: breaking the tree
> >
> > Original change's description:
> > > Adding a trace to nanobench for RP/VM comparison
> > >
> > > Run nanobench with --compare key and collect data for comparison:
> > > ./out/Release/nanobench --csv --config 8888 --skvm --compare --loops 100 --samples 1 --match $(ls skps | grep --invert-match svg ) 2>&1 | tee VM.data
> > > ./out/Release/nanobench --csv --config 8888 --forceRasterPipeline --compare --loops 100 --samples 1 --match $(ls skps | grep --invert-match svg ) 2>&1 | tee RP.data
> > > awk 'BEGIN {OFS=","; fileNum = 0} ($2 ~ /MB/) && fileNum == 0 {vmvmcycles[$3] = $6; vmvmscan[$3] = $8; vmvmpixels[$3] = $10; vmvminterp[$3] = $11;  vmrpcycle[$3] = $14; vmrpscan[$3] = $16; vmrppixels[$3] = $18} ($2 ~ /MB/) && fileNum == 1  {print $3, vmvmcycles[$3], vmvmscan[$3], vmvmpixels[$3], vmvminterp[$3], $6, $8, $10, $11, $14, $16, $18} ENDFILE {fileNum += 1}' VM.data RP.data > compare.csv
> > >
> > > You can see an example of comparison table here:
> > > https://docs.google.com/spreadsheets/d/1Q57oz6Jn8JPQkPzUbtO0fcZh2VhwPhxwsLaHnSb9uR0/edit#gid=406063636
> > >
> > > Change-Id: I8fa35e3fb087bce00ab19355a3bc021334aa7a80
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501337
> > > Reviewed-by: Herb Derby <herb@google.com>
> > > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> >
> > Change-Id: I6799b90ffd8bc05c65d1185bfc07a06af05e2038
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507182
> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> > Commit-Queue: Julia Lavrova <jlavrova@google.com>
>
> Change-Id: I3668b5a40f310598e23c922b1eb6f93db4dac13c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507183
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

Change-Id: I5d0174fca1aeaa0f3e75a8e1f643265701068f42
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/508396
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2022-02-13 19:03:40 +00:00
Julia Lavrova
94b8dd6710 Reland "Adding a trace to nanobench for RP/VM comparison"
This reverts commit 39728eb980.

Reason for revert: Need to reland after I figure out what happened

Original change's description:
> Revert "Adding a trace to nanobench for RP/VM comparison"
>
> This reverts commit e855b1273f.
>
> Reason for revert: breaking the tree
>
> Original change's description:
> > Adding a trace to nanobench for RP/VM comparison
> >
> > Run nanobench with --compare key and collect data for comparison:
> > ./out/Release/nanobench --csv --config 8888 --skvm --compare --loops 100 --samples 1 --match $(ls skps | grep --invert-match svg ) 2>&1 | tee VM.data
> > ./out/Release/nanobench --csv --config 8888 --forceRasterPipeline --compare --loops 100 --samples 1 --match $(ls skps | grep --invert-match svg ) 2>&1 | tee RP.data
> > awk 'BEGIN {OFS=","; fileNum = 0} ($2 ~ /MB/) && fileNum == 0 {vmvmcycles[$3] = $6; vmvmscan[$3] = $8; vmvmpixels[$3] = $10; vmvminterp[$3] = $11;  vmrpcycle[$3] = $14; vmrpscan[$3] = $16; vmrppixels[$3] = $18} ($2 ~ /MB/) && fileNum == 1  {print $3, vmvmcycles[$3], vmvmscan[$3], vmvmpixels[$3], vmvminterp[$3], $6, $8, $10, $11, $14, $16, $18} ENDFILE {fileNum += 1}' VM.data RP.data > compare.csv
> >
> > You can see an example of comparison table here:
> > https://docs.google.com/spreadsheets/d/1Q57oz6Jn8JPQkPzUbtO0fcZh2VhwPhxwsLaHnSb9uR0/edit#gid=406063636
> >
> > Change-Id: I8fa35e3fb087bce00ab19355a3bc021334aa7a80
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501337
> > Reviewed-by: Herb Derby <herb@google.com>
> > Commit-Queue: Julia Lavrova <jlavrova@google.com>
>
> Change-Id: I6799b90ffd8bc05c65d1185bfc07a06af05e2038
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507182
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

Change-Id: I3668b5a40f310598e23c922b1eb6f93db4dac13c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507183
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2022-02-11 21:25:46 +00:00
Julia Lavrova
39728eb980 Revert "Adding a trace to nanobench for RP/VM comparison"
This reverts commit e855b1273f.

Reason for revert: breaking the tree

Original change's description:
> Adding a trace to nanobench for RP/VM comparison
>
> Run nanobench with --compare key and collect data for comparison:
> ./out/Release/nanobench --csv --config 8888 --skvm --compare --loops 100 --samples 1 --match $(ls skps | grep --invert-match svg ) 2>&1 | tee VM.data
> ./out/Release/nanobench --csv --config 8888 --forceRasterPipeline --compare --loops 100 --samples 1 --match $(ls skps | grep --invert-match svg ) 2>&1 | tee RP.data
> awk 'BEGIN {OFS=","; fileNum = 0} ($2 ~ /MB/) && fileNum == 0 {vmvmcycles[$3] = $6; vmvmscan[$3] = $8; vmvmpixels[$3] = $10; vmvminterp[$3] = $11;  vmrpcycle[$3] = $14; vmrpscan[$3] = $16; vmrppixels[$3] = $18} ($2 ~ /MB/) && fileNum == 1  {print $3, vmvmcycles[$3], vmvmscan[$3], vmvmpixels[$3], vmvminterp[$3], $6, $8, $10, $11, $14, $16, $18} ENDFILE {fileNum += 1}' VM.data RP.data > compare.csv
>
> You can see an example of comparison table here:
> https://docs.google.com/spreadsheets/d/1Q57oz6Jn8JPQkPzUbtO0fcZh2VhwPhxwsLaHnSb9uR0/edit#gid=406063636
>
> Change-Id: I8fa35e3fb087bce00ab19355a3bc021334aa7a80
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501337
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

Change-Id: I6799b90ffd8bc05c65d1185bfc07a06af05e2038
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507182
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2022-02-10 19:34:36 +00:00
Julia Lavrova
e855b1273f Adding a trace to nanobench for RP/VM comparison
Run nanobench with --compare key and collect data for comparison:
./out/Release/nanobench --csv --config 8888 --skvm --compare --loops 100 --samples 1 --match $(ls skps | grep --invert-match svg ) 2>&1 | tee VM.data
./out/Release/nanobench --csv --config 8888 --forceRasterPipeline --compare --loops 100 --samples 1 --match $(ls skps | grep --invert-match svg ) 2>&1 | tee RP.data
awk 'BEGIN {OFS=","; fileNum = 0} ($2 ~ /MB/) && fileNum == 0 {vmvmcycles[$3] = $6; vmvmscan[$3] = $8; vmvmpixels[$3] = $10; vmvminterp[$3] = $11;  vmrpcycle[$3] = $14; vmrpscan[$3] = $16; vmrppixels[$3] = $18} ($2 ~ /MB/) && fileNum == 1  {print $3, vmvmcycles[$3], vmvmscan[$3], vmvmpixels[$3], vmvminterp[$3], $6, $8, $10, $11, $14, $16, $18} ENDFILE {fileNum += 1}' VM.data RP.data > compare.csv

You can see an example of comparison table here:
https://docs.google.com/spreadsheets/d/1Q57oz6Jn8JPQkPzUbtO0fcZh2VhwPhxwsLaHnSb9uR0/edit#gid=406063636

Change-Id: I8fa35e3fb087bce00ab19355a3bc021334aa7a80
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501337
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2022-02-10 18:24:56 +00:00
John Stiles
39b978241b Update code to prepare for -Wformat-nonliteral.
-Wformat-nonliteral does not work with variadic templates, and requires
a constant format string.

These changes uncovered one incorrect format string (%u -> %lu for a
DWORD in dm.cpp)

Change-Id: Id54a5d6cbcb607ff32c758f4a9d346a7aba70df3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506616
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-02-10 14:17:33 +00:00
John Stiles
4250effcc5 Prepare to reenable unreachable-code warnings.
Adding double-parens around an `if ((false))` squelches the warning.
In other cases, you can squelch the warning by assigning the
always-constant(-on-this-machine) check into a constexpr bool.

Change-Id: I5a344fb45779c5bd2865edb3cffaf839ba9a5d85
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/504597
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-02-04 21:45:39 +00:00
John Stiles
7c1dafe51e Remove references to skstd::optional in Skia.
In this CL, Skia has been updated to use std::optional throughout.
skstd::optional continues to exist as a synonym for std::optional so
that Flutter does not break. The typedef will be removed in a few days,
once Flutter rolls into google3 have landed.

Original change's description:
> Revert "Reland "Remove skstd::optional entirely.""
>
> This reverts commit d161e2f6ec.
>
> Reason for revert: Need to wait for Flutter fix to roll into Google3.
>
> Original change's description:
> > Reland "Remove skstd::optional entirely."
> >
> > This reverts commit 98e51006b9.
> >
> > Flutter fix: https://github.com/flutter/engine/pull/31193
> >
> > Original change's description:
> > > Revert "Remove skstd::optional entirely."
> > >
> > > This reverts commit 17d0fc087c.
> > >
> > > Reason for revert: flutter still uses the skstd class
> > >
> > > Original change's description:
> > > > Remove skstd::optional entirely.
> > > >
> > > > Skia now uses C++17's std::optional.
> > > >
> > > > Change-Id: I387069589baaefadd25e25bcec3f4cc6ee6fd090
> > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501477
> > > > Reviewed-by: Ben Wagner <bungeman@google.com>
> > > > Reviewed-by: Brian Osman <brianosman@google.com>
> > > > Commit-Queue: John Stiles <johnstiles@google.com>
> > > > Auto-Submit: John Stiles <johnstiles@google.com>
> > >
> > > Change-Id: I2c001588007640ac7b8c9f0760038b46c220a07e
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502702
> > > Auto-Submit: John Stiles <johnstiles@google.com>
> > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> > > Reviewed-by: Brian Osman <brianosman@google.com>
> > > Commit-Queue: Brian Osman <brianosman@google.com>
> >
> > Change-Id: Ia0cd41eda845b02f518c501a23293d344756a4eb
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502703
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Auto-Submit: John Stiles <johnstiles@google.com>
> > Commit-Queue: John Stiles <johnstiles@google.com>
>
> Change-Id: I8f89412292ba5dfe955c3f44c403c3c232cdad2b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503336
> Auto-Submit: Brian Osman <brianosman@google.com>
> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>

Change-Id: I28ef3f543bf74de72645485698affb54921a50f0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/504176
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-02-04 15:03:16 +00:00
John Stiles
ffeb6f2339 Remove SkSL::String class.
The previous CLs have removed the last significant differences between
SkSL::String and std::string. This CL removes SkSL::String entirely and
replaces it with std::string throughout the code.

Apologies for the very long CL, but I have done my best to make it as
simple and reviewable as possible. The vast majority of changes are
simple replacement of `SkSL::String` with `std::string`. In the rare
spots where code is moved from one place to another, it is logically
unchanged.

Change-Id: I39563d2db45da229f17f4504dfd63e00bde7a96e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503339
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-02-03 14:59:16 +00:00
Brian Osman
73262111f5 Revert "Reland "Remove skstd::optional entirely.""
This reverts commit d161e2f6ec.

Reason for revert: Need to wait for Flutter fix to roll into Google3.

Original change's description:
> Reland "Remove skstd::optional entirely."
>
> This reverts commit 98e51006b9.
>
> Flutter fix: https://github.com/flutter/engine/pull/31193
>
> Original change's description:
> > Revert "Remove skstd::optional entirely."
> >
> > This reverts commit 17d0fc087c.
> >
> > Reason for revert: flutter still uses the skstd class
> >
> > Original change's description:
> > > Remove skstd::optional entirely.
> > >
> > > Skia now uses C++17's std::optional.
> > >
> > > Change-Id: I387069589baaefadd25e25bcec3f4cc6ee6fd090
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501477
> > > Reviewed-by: Ben Wagner <bungeman@google.com>
> > > Reviewed-by: Brian Osman <brianosman@google.com>
> > > Commit-Queue: John Stiles <johnstiles@google.com>
> > > Auto-Submit: John Stiles <johnstiles@google.com>
> >
> > Change-Id: I2c001588007640ac7b8c9f0760038b46c220a07e
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502702
> > Auto-Submit: John Stiles <johnstiles@google.com>
> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Brian Osman <brianosman@google.com>
>
> Change-Id: Ia0cd41eda845b02f518c501a23293d344756a4eb
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502703
> Reviewed-by: Brian Osman <brianosman@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>

Change-Id: I8f89412292ba5dfe955c3f44c403c3c232cdad2b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503336
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2022-02-02 16:49:05 +00:00
John Stiles
d161e2f6ec Reland "Remove skstd::optional entirely."
This reverts commit 98e51006b9.

Flutter fix: https://github.com/flutter/engine/pull/31193

Original change's description:
> Revert "Remove skstd::optional entirely."
>
> This reverts commit 17d0fc087c.
>
> Reason for revert: flutter still uses the skstd class
>
> Original change's description:
> > Remove skstd::optional entirely.
> >
> > Skia now uses C++17's std::optional.
> >
> > Change-Id: I387069589baaefadd25e25bcec3f4cc6ee6fd090
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501477
> > Reviewed-by: Ben Wagner <bungeman@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: John Stiles <johnstiles@google.com>
> > Auto-Submit: John Stiles <johnstiles@google.com>
>
> Change-Id: I2c001588007640ac7b8c9f0760038b46c220a07e
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502702
> Auto-Submit: John Stiles <johnstiles@google.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

Change-Id: Ia0cd41eda845b02f518c501a23293d344756a4eb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502703
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-02-02 14:59:45 +00:00
Brian Osman
71a34c302d Improve nanobench CSV output
- Write correct column headers (with comma separators)
- Omit the "timer overhead" message

Change-Id: Id0139370a4d39c4a1a7d9bb41e018e98c37da0ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502701
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2022-02-01 19:12:45 +00:00
John Stiles
98e51006b9 Revert "Remove skstd::optional entirely."
This reverts commit 17d0fc087c.

Reason for revert: flutter still uses the skstd class

Original change's description:
> Remove skstd::optional entirely.
>
> Skia now uses C++17's std::optional.
>
> Change-Id: I387069589baaefadd25e25bcec3f4cc6ee6fd090
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501477
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>

Change-Id: I2c001588007640ac7b8c9f0760038b46c220a07e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502702
Auto-Submit: John Stiles <johnstiles@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-02-01 18:47:44 +00:00
John Stiles
17d0fc087c Remove skstd::optional entirely.
Skia now uses C++17's std::optional.

Change-Id: I387069589baaefadd25e25bcec3f4cc6ee6fd090
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501477
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-02-01 18:30:39 +00:00
Herb Derby
1197b597d3 clean up of cleanup SubRun subtypes
* Move GrBlobSubRun to the .cpp.
* Replace SlugAtlasSubRun with GrSubRun and GrAtlasSubRun to make sure
  all the Slug SubRuns are GrSubRuns.
* const all the test routines.
* Make the down cast blob specific.

Change-Id: I1c45d52cc6d245d5d3f90fd742e9a183955e575f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/500437
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2022-01-26 21:28:37 +00:00
Herb Derby
dbab4c46d5 make GrSubRun common for slugs and blobs
Use GrSubRun as the common draw and list functionality for both
slugs and blobs. This eliminates the copy of code for sub run lists
that slugs used. I also refreshed some comments.

Totally encapsulate the SubRun list in the GrTextBlob by
removing the accessor and adding draw and testingOnlyFirstSubRun.

Change-Id: I67ec946b1539de5cc58f7b6359eb70227b7e7dc4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/500277
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2022-01-26 20:25:41 +00:00
Robert Phillips
1042c00130 [graphite] Replace GrSLType with SkSLType
This is mostly mechanical. The only interesting bit is that GrSLType was in include/private while SkSLType is in src/core so some #include patterns changed.

Bug: skia:12701
Change-Id: I80bd86ee93796b145f86ded9b4cbf52f24fa59e5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/497607
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2022-01-26 17:30:12 +00:00
Michael Ludwig
9c898c54c6 Fix vertex size request in middle-out benchmark
Change-Id: I3dd8ecb7dc3a5f2781ea86e0526360a1fc3361cb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/498277
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2022-01-24 14:36:26 +00:00
Michael Ludwig
96860d3bba Add makeVertexWriter helper to GrMeshDrawTarget
Adds makeVertexWriter[AtLeast] and makeIndexWriter[AtLeast] wrappers
around the vertex-space virtuals. Updates call sites of those functions
that immediately passed the returned pointer into a VertexWriter ctor
to call the new function.

This is simplification that will make changing the ctor of VertexWriter
easier (to come in another CL).

Change-Id: I8f4f1a9bed71e368828a42ed798fa6a93030a765
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/496776
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2022-01-21 00:53:22 +00:00
Greg Daniel
60bd1cf8fb Re-enable blend micro benchs for non raster backends.
Change-Id: Ie23b2b96988a527ad035a3160a408f9d754395e5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491436
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-01-05 16:24:48 +00:00
Greg Daniel
c1bc0205d9 [graphite] Move GrResourceKey to skgpu::ResourceKey.
We'll want to reuse this key class for Graphite resources as well. There
is nothing special about these keys that is Ganesh specific.

Bug: skia:12754
Change-Id: I39fe5a9968156985865bccbfc4978583120ac2e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/487384
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-12-23 22:55:19 +00:00
Greg Daniel
cdeb092655 [graphite] Move GrProcessorKeyBuilder to generic skgpu::KeyBuilder class.
This also allows the KeyBuilder class to be used in Graphite. In Graphite
I plan to use it for other keys besides building up shaders/processors
so I dropped that from the name. There was nothing special abouts its
implementation that made it specific to Processors anyways.

Bug: skia:12754
Change-Id: I1b25730b061f9342b61e3b2e4ac43328b8074d59
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/486897
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-12-20 20:41:17 +00:00
Brian Salomon
dd9ef457d9 Reland "Add support for explicit attribute offsets and strides."
This is a reland of 6927ab9311

Original change's description:
> Add support for explicit attribute offsets and strides.
>
> Previously attribute offsets were always computed based on their
> position in an attribute array and the stride was determined
> by the offset and size of the last attribute.
>
> Now a GP has the option to create attributes with explicit offsets
> and specify an explicit vertex stride. All attributes must either
> be implicit or explicit (enforced by assert).
>
> GrGeometryProcessor::AttributeSet is now responsible for handling
> implicitly determined attribute offsets and strides. The backends
> no longer compute them.
>
> Bug: skia:12720
> Change-Id: I0211673dc70d4797c2d66b2555d8f5fb430be056
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/484736
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: skia:12720
Change-Id: Ic4975b5b2e52f2d8213154da0e585eca6dfdd78d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/486098
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-12-20 14:50:20 +00:00
Brian Salomon
38d5328926 Revert "Add support for explicit attribute offsets and strides."
This reverts commit 6927ab9311.

Reason for revert: breaking roll?

Original change's description:
> Add support for explicit attribute offsets and strides.
>
> Previously attribute offsets were always computed based on their
> position in an attribute array and the stride was determined
> by the offset and size of the last attribute.
>
> Now a GP has the option to create attributes with explicit offsets
> and specify an explicit vertex stride. All attributes must either
> be implicit or explicit (enforced by assert).
>
> GrGeometryProcessor::AttributeSet is now responsible for handling
> implicitly determined attribute offsets and strides. The backends
> no longer compute them.
>
> Bug: skia:12720
> Change-Id: I0211673dc70d4797c2d66b2555d8f5fb430be056
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/484736
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: skia:12720
Change-Id: I938bc3776d598f0906465eb2677208c79676642f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/486016
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2021-12-16 20:00:18 +00:00
Brian Salomon
6927ab9311 Add support for explicit attribute offsets and strides.
Previously attribute offsets were always computed based on their
position in an attribute array and the stride was determined
by the offset and size of the last attribute.

Now a GP has the option to create attributes with explicit offsets
and specify an explicit vertex stride. All attributes must either
be implicit or explicit (enforced by assert).

GrGeometryProcessor::AttributeSet is now responsible for handling
implicitly determined attribute offsets and strides. The backends
no longer compute them.

Bug: skia:12720
Change-Id: I0211673dc70d4797c2d66b2555d8f5fb430be056
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/484736
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-12-16 14:38:12 +00:00
Herb Derby
dc60ca197e cleanup TODOs, and warnings
The API for a remote glyph cache had a couple of TODO's left waiting
for Chromium to implement the functions. This happened three years
ago.

This is waiting for the Chromium CL to finish:
https://chromium-review.googlesource.com/c/chromium/src/+/3338117

Change-Id: If8e3de619f0f4be7044e6955204b599c5a42e802
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/484437
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2021-12-15 17:38:34 +00:00
Jim Van Verth
db9f95c888 Move ShaderUtils out of Ganesh.
This will allow us to use ShaderUtils in both Ganesh and Graphite.

Change-Id: I78e34c4eb969a0d827c459d7fb945d17fdc22efa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/482696
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2021-12-10 23:10:25 +00:00
Herb Derby
c279e7640b add bilerp atlas support flag
Move the compile-time flag SK_EXPERIMENTAL_ADD_ATLAS_PADDING,
to a runtime flag in GrContextOptions.

Bug: chromium:1275890

Change-Id: I7e051cd4834ac44958b1431976535519e8bdaa3e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/482416
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2021-12-10 20:33:57 +00:00
Herb Derby
0f2390f7fb move SkRemoteGlyphCache.h to private
Chromium has been using the remote glyph cache for a few years now.
It's time to give it a proper home.

This is an intermediate CL. The old .h file includes the new .h file.
After I change the include paths in Chromium, I will delete the old
file.

Change-Id: Iaf00c46aa0698326c0bdec9a0eed218bcc3e334e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/482700
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2021-12-10 20:20:56 +00:00
Brian Osman
3695bdb587 Refactor SkMatrixProvider slightly
There was only one virtual method, so switch that to a bool stored in
the base class. The derived types exist as hints for the reader, and an
easy way to adjust how the new localToDevice is constructed.

With this change, we don't need SkSimpleMatrixProvider. SkMatrixProvider
is concrete, so we can use it directly. SkOverrideDeviceMatrixProvider
no longer needs the original provider for anything, so remove that
parameter. It now exists solely to inhibit the hitsPixelCenters flag.

Fix a few spots (SkParticleBinding, some sites in SkRuntimeEffect) where
we used SkSimpleMatrixProvider, even though the local coordinates being
passed did not obey the hits-pixel-centers constraints.

Most importantly, document how localToDeviceHitsPixelCenters works.

Change-Id: Ibe9060bac0822d0edf52a507d390bd198d8e6dbd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/482176
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-12-09 20:10:58 +00:00
Ben Wagner
668995122f Fix when a glyph has a path
Always call generateMetrics before generatePath so that generateMetrics
can determine which glyph representation to use and if that glyph
representation can be modeled as a path.

Pass an allocator into generateMetrics so that it can set the path to
not existing. This allows generatePath to continue to work as it used
to, creating a path if any path is available. However, generateMetrics
may first set the path to not existing.

Update getPath and internalGetPath to use the path on the glyph if it
has already been set. Update makeGlyph and internalMakeGlyph to always
call generateMetrics first (which is now more like initGlyph).

Update the SkGlyph::PathData to indicate that it is a dev-path and not a
user-path. A user-path will have effects applied to it. A dev-path is
always a resolved path which is always filled -- unless it is hairline.

Update everything else for the knock on effects and to take advantage of
this information.

Bug: chromium:1266022
Change-Id: Id3f3cf5a534ab99f3a5779c910c1d1e191e68b1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478658
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2021-12-07 14:58:29 +00:00
Brian Osman
985403a274 Update SkSL benchmarks to use currently generated shaders
Things have evolved since these were last updated. In particular, we no
longer emit binding and set decorations for each individual uniform.
Backends that rely on that (SPIRV, Metal), generate SkSL that has all
the uniforms grouped in a buffer. GLSL emits the uniforms with no layout
qualifiers. SPIRV supported this already (and automatically applied the
default binding/set to the implicitly created uniform buffer). Metal
*almost* supported this - it handled the uniform buffer correctly, but
didn't apply the default binding to any un-decorated samplers.

Bug: skia:12670
Change-Id: I7b193b89f86441344cf7ad5b7ed5e07451a1cc6d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/475157
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-11-23 18:01:08 +00:00
Chris Dalton
fc0941003e Move tessellation-specific functions out of GrPathUtils
Bug: skia:12524
Change-Id: I2664c8ea707a40724bcf916e907fe28d1fa276d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/474357
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-11-20 02:47:40 +00:00