This reverts commit 2e1381ec86.
Reason for revert: This causes corrupted JSON output from
nanobench
Bug: skia:12078
Original change's description:
> Don't keep "outResultsFile" open in nanobench
>
> There is a bug on Pixel and Pixel2 devices where the program
> eventually terminates with a non-zero exit code. Closing the
> outResultsFile between JSON flushes seems to fix it (for whatever
> reason).
>
> Bug: b/143074513
> Change-Id: I935e982e88758fda19292129c8031f8501cca615
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249821
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: b/143074513
Change-Id: Iad8e4423acbc520f49365859020776110087dacc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419842
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Herb Derby <herb@google.com>
The Tessellator classes will survive in the NGA and they use
GrMeshDrawOp::Target - but GrMeshDrawOp will not survive.
This is a prelude to making all the remaining GrOp-derived classes OGA-only.
Bug: skia:11837
Change-Id: I62dc92e5f42d672342113f12dcedf3435fab993f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419198
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Like SkColorFilter, SkShader, etc., this has a public-facing component
(SkBlender) and a private subclass (SkBlenderBase) which can be
obtained via a helper function (as_BB). At present there are no public-
facing methods, but the type needs to be exposed to be usable by the
outside world.
These classes exist for SkRuntimeEffect to subclass. The blender base
provides a `program` method with the parameters that blending will use.
Change-Id: I75c772fd4108a9c21fbda84201a8b23d3750a0df
Bug: skia:12080
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/416916
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Change-Id: I17c624e9145d7152f65695ca3ce4592a11bb09a2
Bug: skia:12080
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/418637
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Change-Id: I9f4378b622699d80bef449f9857117e9cc437956
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/418140
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Change-Id: I5707d1da1b69ab1ffaa77d7a391a187ac3e8eba1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/417267
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This is a reland of bd727d0620TBR=jvanverth@google.com
Original change's description:
> Fix tessellation checks for "usesVaryingCoords"
>
> We can't use our hardware tessellation back door if any FPs in the
> program have varyings. Before this CL, we were forgetting to check the
> clip FP for strokes, and weren't checking any FPs yet for fills.
>
> Bug: skia:10419
> Change-Id: Ica631ab3cf0407fb359c02c6d53f88f5f301cddc
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/417237
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
Bug: skia:10419
Change-Id: If8c1e18efc663641b2d565314110f66a6840f8bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/417317
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Change-Id: I09cde57375a742355ff4498549fb8f57299f4610
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/417316
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
This reverts commit bd727d0620.
Reason for revert: Breaking builds.
Original change's description:
> Fix tessellation checks for "usesVaryingCoords"
>
> We can't use our hardware tessellation back door if any FPs in the
> program have varyings. Before this CL, we were forgetting to check the
> clip FP for strokes, and weren't checking any FPs yet for fills.
>
> Bug: skia:10419
> Change-Id: Ica631ab3cf0407fb359c02c6d53f88f5f301cddc
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/417237
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
TBR=egdaniel@google.com,csmartdalton@google.com
Change-Id: I30d29f078d7b8cef146463feaaec0883ba5b9872
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10419
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/417265
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This reverts commit 6b2121d0ec.
Reason for revert: Perf regressions:
https://perf.skia.org/t/?begin=1623217407&end=1623217409&subset=all
Original change's description:
> Wean tessellation off SkPathOps
>
> Now that chopping and culling are fully implemented, and the indirect
> tessellators are gone, we don't need to crop huge paths anymore. The
> recursive chopping and culling will just do their thing.
>
> Bug: skia:9795
> Bug: skia:11268
> Bug: chromium:800804
> Change-Id: Ie34920c59af67035cf37eead69c5335693703001
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/416080
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
TBR=csmartdalton@google.com,reed@google.com
Change-Id: I265bd6991627b435a2a656cf9080b7e9d17e5ded
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9795
Bug: skia:11268
Bug: chromium:800804
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/417238
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
We can't use our hardware tessellation back door if any FPs in the
program have varyings. Before this CL, we were forgetting to check the
clip FP for strokes, and weren't checking any FPs yet for fills.
Bug: skia:10419
Change-Id: Ica631ab3cf0407fb359c02c6d53f88f5f301cddc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/417237
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Bug: skia:12078
Change-Id: Ie4863284c835c5e104886c113daf524eb59b5466
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/416700
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Now that chopping and culling are fully implemented, and the indirect
tessellators are gone, we don't need to crop huge paths anymore. The
recursive chopping and culling will just do their thing.
Bug: skia:9795
Bug: skia:11268
Bug: chromium:800804
Change-Id: Ie34920c59af67035cf37eead69c5335693703001
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/416080
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Bug: skia:10419
Change-Id: Icb3395565060d736624d03ba1465926bd9188e44
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/416078
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Runtime Blend effects always take two input colors--source and
destination--instead of one. This CL adds a new ProgramKind for blend
effects, a new program module (empty for now), and adds a test to
confirm that the signature for blend functions is checked. Currently
these are only accessible via skslc; there's no Runtime Effect API to
create one and the dest color isn't hooked up to anything.
Change-Id: I5272a811d2d76b878cfdf3429efa78c9c8b3fd97
Bug: skia:12080
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/416798
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Rearranges the algebra to use "precision". This makes it consistent
with the other formulas and removes the need for the caller to think
about inverting its precision value.
Bug: skia:10419
Change-Id: I186d03393952983e86b0bef69e1f89f86cdbb423
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/414616
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
It was becoming a bit chaotic to have so many different algorithms in
one file.
Bug: skia:10419
Change-Id: I477b7b65439d16b0f983e10952cb41ec881e8183
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/413856
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
At present, only Xfer processors allow reading back from the destination
image since they are in charge of blending. However, we'd like to expose
the destination color to fragment processors and Runtime Effects in the
future. To make this possible, the DstProxyView will need to be
accessible outside of Xfer processors.
This CL migrates DstProxyView to be a top-level Ganesh class and fixes
up the references to it throughout Skia. It's interesting to note that
several call sites were already using typedefs to hide the class
nesting anyway.
Change-Id: I93a294aa097f9319a968503c4f2f7e4f388ff033
Bug: skia:12066
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/414899
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Merges the GrStrokePathShader and GrFillPathShader classes together.
Creates a new base class called GrPathTessellationShader. Now they all
have a uniform color and can all be draw to stencil and color both.
This is necessary cleanup in general, but will also allow us to create
a convex tessellation op that bypasses the stencil buffer.
Bug: skia:10419
Change-Id: Ifc492c94d3de044a36bd9ea95b1d5aa22e007905
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/413696
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
The fixed count stroke shader was executing a sort loop long enough to
handle 1024 parametric segments, when in reality it will never see
more than 48. This CL cuts the per-vertex sorting work nearly in half
by reducing the number of iterations from 10 to 6. (The indirect
tessellator continues to use 10 iterations.)
Bug: skia:10496
Change-Id: Idc21d6015d449f63915780972a8d487c9c6de6fe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/412496
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Now that hardware tessellators chop, support raw triangles, and can
handle any path, we don't need complicated logic anymore to determine
when we can't use them. This CL simplifies the criteria for selecting
a tessellation algorithm and adds a fAlwaysPreferHardwareTessellation
context option to override it.
Bug: skia:10419
Change-Id: I8492e8f285ff27eb9d0dd6b1e9817dbeeb386c63
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411496
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Previously we would completely disable hardware tessellation for a path
if there was any chance of a curve requiring more segments than
supported by the hardware. This CL updates the tessellators to simply
chop paths until they fit in patches, allowing us to finally draw any
path using hardware tessellation.
Bug: skia:10419
Change-Id: I5c9f78cda3e30b8810aff3cb908235965706f2d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/410977
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Supports drawing exact triangles as conics with infinite weight. This
is necessary for drawing inner fans, breadcrumb triangles, and extra
triangles that will be introduced when we start splitting curves that
don't fit in a single patch.
Bug: skia:10419
Change-Id: If72560be4eb38340512be55dccea93b3a083fad5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/410836
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Splits the instanced and tessellation implementations into their own
separate files and merges their common code into a shared base class.
Renames GrStrokeTessellateShader to GrStrokeShader.
Bug: skia:10419
Change-Id: Ia731509858e682a605ee65c9ced1fd163e4c03f3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/409036
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
This is a reland of 99e6f0fcfb
Original change's description:
> Reland "Reland "Use conics with w=Inf to describe triangles for the tessellator""
>
> This is a reland of ff515df5b4
>
> Original change's description:
> > Reland "Use conics with w=Inf to describe triangles for the tessellator"
> >
> > This is a reland of 84f70136ab
> >
> > Original change's description:
> > > Use conics with w=Inf to describe triangles for the tessellator
> > >
> > > Previously, only the indirect tessellator could draw triangles, and
> > > only with special index data. Using conics with w=Inf will allow us to
> > > draw triangles with the hardware tessellator as well, in addition to
> > > being able to wean the indirect tessellator off an index buffer.
> > >
> > > Bug: skia:10419
> > > Bug: chromium:1202607
> > > Change-Id: I180af9cb5410c0e0bb25a2edcfb01e17d4a2f590
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/406977
> > > Commit-Queue: Chris Dalton <csmartdalton@google.com>
> > > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> >
> > Bug: skia:10419
> > Bug: chromium:1202607
> > Change-Id: Ic12b10eaa60fddd212c66757bf7100749ee58d49
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408096
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Commit-Queue: Chris Dalton <csmartdalton@google.com>
>
> TBR=robertphillips@google.com
>
> Bug: skia:10419
> Bug: chromium:1202607
> Change-Id: Id1f8dfa133f446b9f30f2bf8493a3a7b99072e59
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408616
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
Bug: skia:10419
Bug: chromium:1202607
Change-Id: Iadc60aae395146d5da5bfaa725b980c963e6bead
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408817
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
When a stroke is zoomed in, it can require an exponential number of
chops. This CL updates the tessellators to stop recursing once a curve
is no longer in the viewport.
Bug: skia:10419
Bug: skia:11268
Bug: skia:9795
Change-Id: I6aad5355618462e88ce6ccccb57c500ae6310f22
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408576
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Bug: skia:10419
Change-Id: I061c216e6f49399e533fb9a83ba5d9f9d3af83e3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408858
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
- most of the small diffs are because I moved GrWangsFormula.h out
of the tessellate/ directory and into the geometry/ directory since
it's more general than HW tessellation.
The previous implementation was based on the heuristic that the distance
from the true curve to the line segment would be divided by 4 every time
the curve was recursively subdivided. This was a reasonable
approximation if the curve had balanced curvature on both sides of the
split. However, in the case of the new GM's curve, the left half was
already very linear and the right half had much higher curves.
This lead to the approximation reporting fewer points than required.
Theoretically, those few points that weren't utilized by the left half
of the curve could have been made available to the right half, but the
implementation of that would be tricky.
Instead, it now uses Wang's formula to compute the number of points.
Since recursive subdivision leads to linearly spaced samples assuming it
can't stop early, this point count represents a valid upper bound on
what's needed. It also then ensures both left and right halves of a
curve have the point counts they might need w/o updating the
generation implementations. However, since the recursive point
generation exits once each section has reached the error tolerance, in
scenarios where the prior approximation was reasonable, we'll end up
using fewer points than reported by Wang's. Hopefully that means there
is negligible performance regression since we won't be increasing
vertex counts by that much (except where needed for correctness).
Bug: skia:11886
Change-Id: Iba39dbe4de82011775524583efd461b10c9259fe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/405197
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Chromium has been updated to use makeAnalysisCanvas directly and there are
no more references to SkTextBlobDiffCanvas as a type in its code base.
Since the GlyphTrackingDevice extends SkNoPixelsDevice, any SkCanvas that
uses it is effectively a "no-draw" canvas. However, by returning a base
SkCanvas the text tracking now automatically happens in the context of
the base's AutoLayerForImageFilter handling it applies on every draw. This
means that drawing a text blob with an image filter that modifies the
transform state will now be analyzed in that context automatically
(simplifying code in chrome after this lands).
Another behavioral change is that all non-text draws will still go through
the base SkCanvas' virtuals and invoke the device function. Since it's an
SkNoPixelsDevice, it'll still be a no-op, it just happens a little later.
This won't really impact performance because oop-r already inspects their
operations and only plays back text and transform related ones to the
analysis canvas, so we shouldn't really see non-text draws being invoked
anyways.
Bug: chromium:1187246
Change-Id: I83f86571300751f385b3065dfe889f218fa1edc6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/405196
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
The SkM44::RectToRect function matches the semantics of
SkMatrix::RectToRect(kFill_ScaleToFit). No other ScaleToFit variants are
ported over to SkM44.
skottie uses some instances of kCenter_ScaleToFit so that functionality
may need to be added in the future (in SkM44 or in skottie). There are
no current usages of the kStart and kEnd_ScaleToFit semantics.
The SkM44::mapRect() function is implemented to correspond to the
SkMatrix::mapRect() that returns the mapped rect (instead of modifying a
pointer) and always has ApplyPerspectiveClip::kYes. This was chosen to
keep its behavior simple and because perspective clipping is almost
always the right thing to do. In the new implementation there is no
longer a performance cliff to worry about (see below). For the timebeing
mapRect is hidden behind SkMatrixPriv::MapRect().
Performance:
I added benchmarks for mapRect() on SkM44 and SkMatrix that use the same
matrices to get a fair comparison on their different specializations.
SkMatrix has a very efficient mapRect when it's scale+translate or
simpler, then another impl. for affine matrices, and then falls back to
SkPath clipping when there's perspective. On the other hand, SkM44 only
has 2 modes: affine and perspective.
On my desktop, with a Ryzen 9 3900X, here are the times for 100,000 calls
to mapRect for different types of matrices:
SkMatrix SkM44
scale+translate 0.35 ms 0.42 ms
rotate 1.70 ms 0.42 ms
perspective 63.90 ms 0.66 ms
clipped-perspective 138.0 ms 0.96 ms
To summarize, the SkM44::mapRect is almost as fast as the s+t specialization
in SkMatrix, but for all non-perspective matrices. For perspective matrices
it's only 2x slower than that specialization when no vertices are clipped,
and still almost 2x faster than the affine specialization when vertices are
clipped (and 100x faster than falling back to SkPath).
Given that, there's the open question of whether or not keeping an affine
specialization is worth it for SkM44's code size.
Bug: skia:11720
Change-Id: I6771956729ed64f3b287a9de503513375c9f42a0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/402957
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Adds counters for the number of render passes, number of MSAA render
passes, and each op that either does or would trigger MSAA. Adds a
bot that collects stats on the html (not svg) skps.
Bug: skia:11396
Change-Id: Ic48263d6310670d8f0d09ec4c4bf6a2b83fc7d02
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/401636
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Bug: skia:11900
Change-Id: I97d1f2a9523252318ffb4f479b197cb0ef9cf0b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/402920
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This new tessellator renders strokes as fixed-count triangle strip
instances. Any extra triangles not needed by the instance are emitted
as degenerate triangles. Since it draws in order, this tessellator
allows us to batch dynamic colors even when hw tessellation is not
supported.
Bug: skia:10419
Change-Id: If03a8b76319471ae4d4580dda019b69204d9197b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/398416
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Mixed samples is no longer relevant for Ganesh. DMSAA and the new
Ganesh architecture both rely on full MSAA, and any platform where
mixed samples is supported will ultimately not use the old
architecture.
Change-Id: I5acc745010e090ef26310d92ec6240be2cd494cf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/399837
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
The existing code incorrectly uses the recordTimeAllocator.
Add a SubRunAllocator to the GrArenas, and use GrArenas to
store direct glyph drawing information.
Change-Id: I38ba25658364a48af5c775315331795d3d22121f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/397476
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Bug: skia:10419
Change-Id: I656e2508e95a47e03af431734ac06cbdb41232c6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/398356
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
The old factory is deprecated. The new ones do stricter checking on the
signature of main and calls to sample, and include checks at effect
creation-time that the SkSL is valid for the requested stage.
Bug: skia:11813
Change-Id: Ibd15a6f90e74bdc9c2352d3dc61b6682f626f413
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/397477
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This ensures we don't lose the original SkSurfaceProps when creating
image filters, etc.
Bug: skia:11396
Change-Id: I6b412361c1005138278a1396faa7f7e069ec7eb2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/397291
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
These enforce stricter rules about the signature of main, and each one
uses a separate pre-include module. That prevents color filters from
being able to reference sk_FragCoord (or coords passed to main) at all.
It also limits the versions of sample() that are exposed.
In the new world, an effect created for a specific stage of the Skia
pipeline can only be used to create instances of that stage (SkShader or
SkColorFilter). For now, SkRuntimeEffect::Make uses kRuntimeEffect,
which continues to be more lenient and allow creation of either shaders
or color filters from a single effect. After we migrate all clients, we
can deprecate and then delete that mode.
Bug: skia:11813
Change-Id: I0afd79a72beeec84da42c86146e8fcd8d0e4c09f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/395716
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Modifies helpers on GrGLSLGeometryProcessor that insert, set, and make
keys for view/local matrix uniforms to not omit the uniform when
the matrix is identity or use a float4 when it is scale/trans. Always
uses a 3x3.
Bug: skia:11844
Change-Id: I0f25b60b46b8932d7e2cac4a50159d22b9cd84d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/395656
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>