Commit Graph

1848 Commits

Author SHA1 Message Date
Chris Dalton
078f875477 Rename GrTessellateStroke* -> GrStrokeTessellate* and friends
Almost half the files in src/gpu/tessellate were beginning with
"GrTessellat*". This CL reorders the camel case words for more
efficient tab completion and better grouping of related files.

Bug: skia:10419
Change-Id: I3df0ddbb2367cdbd880807a8aef2dd88ec12f830
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/306659
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-07-31 02:24:05 +00:00
Mike Reed
d5b51a0b97 Switch over to SkPathBuilder
Bug: skia:9000
Change-Id: If7192dfb8df01db9acb83a3c331fbbde981e5e2e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/307017
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-07-31 02:21:51 +00:00
Mike Reed
bd2b2c1cb0 demo CubicResampler
Change-Id: I1f779c60f1513e5ed28ce7e7d067b69ef4937ea4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305683
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-07-24 20:13:34 +00:00
Chris Dalton
9eea916c05 Write GPU buffers directly from GrStrokeGeometry
Removes the intermediate stroke representation that GrStrokeGeometry
used to generate. Uses GrOpFlushState::makeVertexStateAtLeast instead
and writes patches directly to a vertex buffer as we iterate the path.
If the vertex buffer runs out of room we simply allocate a new one and
draw the stroke in chunks.

Bug: skia:10419
Bug: skia:10460
Change-Id: Ic743158366e43d4d3f5a4ff97b039d48c9c9c65b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305380
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-07-24 04:38:51 +00:00
Tyler Denniston
4ccdaf6f2d Show mirror drawn with SkStroke (toy stroker)
Improves the sample slide to draw the skeleton geometry, and a mirror
image of the current path with Skia's stroker, which makes it easier to
compare.

Change-Id: I804f4304aec6025112c8ccac3bb61139559022f5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305184
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-07-22 18:49:20 +00:00
Tyler Denniston
baa2a7bdd2 Add path recorder class (toy stroker)
This will be used to add undo support (removing verbs and their points),
which SkPath and SkPathBuilder don't have right now.

Also did away with an unnecessary pointer indirection.

Change-Id: Iec42af8b7a69aabe1496266aaa70ddc7b4e907bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305181
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-07-22 18:15:40 +00:00
Tyler Denniston
e9ced4f3da Elide inner loop geometry sometimes (toy stroker)
Many times a pair of stroked line segments doesn't actually require the
inner "loop" geometry. I think I've classified where it's required into
two cases.

This CL checks for the two cases where it is necessary, and skips adding
the extra geometry if not necessary. Requires a few extra
multiplications.

Change-Id: I421e2365523c8f5b5c190b5493cbe0e0d3d3a6c0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305017
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-07-22 14:02:28 +00:00
Brian Salomon
d007281c9a Fix clang 12 Wsuggest-override and Wsuggest-destructor-override
Change-Id: Ic44e24057b95bb014504f02a736fb4341afc8971
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304856
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-07-22 01:11:36 +00:00
Tyler Denniston
f219aadebc Add inner loop geometry to miter join for toy stroker
Now the miter join matches SkStroke, adding the extra inner loop
geometry always. Next will be the harder part, which is figuring out how
to get rid of it!

Also fixed a CW/CCW rotation inconsistency to match SkStroke

Change-Id: Ie3d164053fd5683f3b678bb80f8421dc6dc48cd7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304809
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Auto-Submit: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-07-21 20:51:48 +00:00
Tyler Denniston
324578b553 Add toy stroker sample
I figure we can use this as an area for prototyping new/different
stroker ideas.

Currently the sample does line segments with butt caps. Miter joins
aren't correct, as it's not adding the inner loop geometry that
SkPathStroker does.  On the sample slide, any red pixels are ones that
Skia filled but the toy stroker didn't.

Change-Id: Iea5eb320d88dd1dc5c60fbb2a997f56eec4f4f1f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303588
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-07-21 20:04:58 +00:00
John Stiles
5933d7d54f Update GrPaint APIs to reflect lack of multiple color processors.
Change-Id: Ic7799b3c5f4294cba9ff72f8c11a2ad285ab189f
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304738
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-07-21 17:09:58 +00:00
John Stiles
39156c2ee9 Update VisualizeCoverageCountFP to accept an input FP.
This FP is used for debugging coverage in Viewer.

Change-Id: I2c49ab48457ac64f562d8b0ee6b09ab647f06d56
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304736
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-07-21 16:45:47 +00:00
Greg Daniel
426274b880 Add support for holding onto refs for input buffers from bindBuffer calls.
Mostly this is a lot of plumbing of sk_sp around instead of const*.

This does allow the d3d and vk backends to hold refs to the GrBuffers that
are bound on a command buffer. This means that our buffer alloc pools will
not try to reuse this buffers until the gpu is done with them. Previously
vk and d3d will sniff out if one of these buffers was being used again
while still active on the gpu and rip out the internal backend buffer and
allocate a new one which is not cheap. We see a lot of perf wins from
not doing this.

Change-Id: I9ffe649151ee43066dce620bd3e2763b029a9811
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303583
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-07-20 18:29:43 +00:00
Mike Reed
609ea210e2 more cleanup after removing volatile from bitmap
Change-Id: I3d7b2f59a5657640c3d60f5a2f6e1277d7593096
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302038
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-07-12 19:37:29 +00:00
Mike Reed
1434ce1aa9 Can we remove volatile from skbitmap?
Change-Id: I0faa324b91f2c291be56f5126361ffe7fd54eb65
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302037
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-07-12 17:48:59 +00:00
Adlai Holler
3d0359a318 Migrate GrGpu to GrDirectContext
Another piece of the Great Recontexting.

Change-Id: Ib089dbdba89e25add407cf816d28c96c7e5dbc05
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301303
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-07-09 20:11:22 +00:00
Robert Phillips
30ebcf730c Remove SkCanvas::getGrContext calls from samplecode
More busywork so we can deprecate getGrContext.

Change-Id: I8479985334881251e6ad814d7855681df716b1da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301542
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-07-09 18:37:02 +00:00
Mike Reed
439fe6025b show fat stroking on lines or curves
Change-Id: I31756e5f9fe0b2375f45a1263803196b6efd85d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299385
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-06-26 19:13:00 +00:00
Michael Ludwig
9689e39a69 Update complex clip GMs to only use supported clip ops
Bug: skia:10207
Change-Id: Ie87d78b12874fb87697fe22856b4a83b9f28dda8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287818
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-06-25 14:15:25 +00:00
Brian Osman
ad43e54bfb Handle kMatrixMultiply in ByteCode -> SkVM
Raster backend now draws the bump-mapped cube sample!

Change-Id: I4ad74c50a329dcd0c9b56f2a18b1e32fd5c5eccd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297815
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-06-19 20:31:10 +00:00
John Stiles
30212b7941 Fix implicit fallthroughs throughout Skia.
This CL is not fully comprehensive; for instance, it does not contain
fixes for backends that don't compile on Mac. But it does resolve the
vast majority of cases that trigger -Wimplicit-fallthrough.

A few minor bugs were found and fixed, but none that were likely to
affect normal operation.

Change-Id: I43487602b0d56200ce8b42702e04f66390d82f60
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295916
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-06-11 22:29:53 +00:00
Chris Dalton
392fa03a1b Add an interactive sample that fits cubics to circular arcs
Fits a cubic to an arc on the unit circle using the following
constraints:

  1) The endpoints and tangent directions at the endpoints must match
     the arc.
  2) The cubic must be symmetric (length(p1 - p0) == length(p3 - p2)).
  3) The height of the cubic must match the height of the arc.

Using the above constraints, we arrive at the following formula for the
control length (c) (i.e., lengths of (p1 - p0) and (p3 - p2)):

  d = x0*x1 + y0*y1
  c = (sqrt(1 + d) * kM + kA) * rsqrt(1 - d)

(Where x0,y0,x1,y1 are the endpoints, kM = -4/3, and kA = 4/3 * sqrt(2).)

The sample also comes with a root finder that finds the max error value
of the curve, which ends up serving as a semi-formal proof that:

  1) Max error always occurs at T=0.21132486540519, regardless of
     endpoints.
  2) Error is reduced by exactly 64x each time we halve the arc angle

Change-Id: I29ad60dda06743d79f71275c38ffdd97261159ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295303
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-06-09 23:04:03 +00:00
Chris Dalton
b96995d05f Handle tessellated paths that require more segments than are supported
Adds a method to determine the worst-case number of tessellated line
segments that a path might require, and disables hardware tessellation
if it is more segments than are supported (falling back on indirect
draw shaders).

If the path requires even more segments than are supported by the
indirect draw shaders (1024), we crop the path to the viewport. The
required number of segments is proportional to the square root of the
bounding box's diagonal, so we won't start cropping paths until their
device-space bounding box diagonal is nearly 175,000 pixels long.

Change-Id: I8a9435e70bb93dda3464cc11a3e44fbe511744ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293691
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-06-05 15:33:19 +00:00
Ben Wagner
d13487e71b Regularize SkFontMgr for CoreText build.
Move SkFontHost_mac.cpp into an 'optional' like the other fontmgr build
rules. This allows building with other fontmgrs on Mac and makes the lib
dependencies explicit. In the future this helps with splitting the out
the default factory.

Change-Id: Iecef9e428acb69f89b54afa00b4e779f5858c61a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294076
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-06-04 16:45:09 +00:00
Mike Reed
b42a327926 hide savelayer's clipmask fields
Bug: skia:9208
Change-Id: Ieff64b3132e7bf4a51ce9d70ea2f1bad492616da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223923
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-31 14:06:42 +00:00
Chris Dalton
0d0758e42a Wire up mouse and keyboard events in CanvasKit viewer
Change-Id: I10b57f18edb516b48be3ba16f98a540370ec689f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292793
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-05-29 17:24:30 +00:00
Chris Dalton
a3908ef970 Merge PathText samples into one, with different modes
Change-Id: I640cd522c1c83f7534c86ebfd6a6f3904fb90206
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292734
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-05-29 16:35:25 +00:00
Michael Ludwig
7c12e28cf4 Reland "GrClips provided as pointers to GrRTC"
This reverts commit 074414fed5.

Reason for revert: updated to guard against nullptr before calling
quickContains(rrect).

Original change's description:
> Revert "GrClips provided as pointers to GrRTC"
>
> This reverts commit 226b689471.
>
> Reason for revert: Breaks Android roller
>
> Original change's description:
> > GrClips provided as pointers to GrRTC
> >
> > A null clip represents no high-level clipping is necessary (the implicit
> > clip to the render target's logical dimensions is fine).
> >
> > This also removes GrNoClip and GrFixedClip::Disabled() since they are
> > replaced with just nullptr.
> >
> > By allowing nullptr to represent no intended clipping, it makes it easier
> > to require GrClip and GrAppliedClip objects to know about the dimensions
> > of the device. If we required a non-null clip object to represent no
> > clipping, we'd have to have an instance for each device based on its
> > size and that just became cumbersome.
> >
> > Bug: skia:10205
> > Change-Id: Ie30cc71820b92d99356d393a4c98c8677082e761
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290539
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com
>
> Change-Id: I42c4828bcf016ee3d30d5c20b771be96e125817b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10205
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292856
> Reviewed-by: Weston Tracey <westont@google.com>
> Commit-Queue: Weston Tracey <westont@google.com>

TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com,westont@google.com

# Not skipping CQ checks because this is a reland.

Bug: skia:10205
Change-Id: I5715a4de3b7c8847b73020dc4937d3816d879803
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292876
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-05-29 15:09:54 +00:00
Weston Tracey
074414fed5 Revert "GrClips provided as pointers to GrRTC"
This reverts commit 226b689471.

Reason for revert: Breaks Android roller

Original change's description:
> GrClips provided as pointers to GrRTC
> 
> A null clip represents no high-level clipping is necessary (the implicit
> clip to the render target's logical dimensions is fine).
> 
> This also removes GrNoClip and GrFixedClip::Disabled() since they are
> replaced with just nullptr.
> 
> By allowing nullptr to represent no intended clipping, it makes it easier
> to require GrClip and GrAppliedClip objects to know about the dimensions
> of the device. If we required a non-null clip object to represent no
> clipping, we'd have to have an instance for each device based on its
> size and that just became cumbersome.
> 
> Bug: skia:10205
> Change-Id: Ie30cc71820b92d99356d393a4c98c8677082e761
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290539
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com

Change-Id: I42c4828bcf016ee3d30d5c20b771be96e125817b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10205
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292856
Reviewed-by: Weston Tracey <westont@google.com>
Commit-Queue: Weston Tracey <westont@google.com>
2020-05-29 12:55:44 +00:00
Michael Ludwig
226b689471 GrClips provided as pointers to GrRTC
A null clip represents no high-level clipping is necessary (the implicit
clip to the render target's logical dimensions is fine).

This also removes GrNoClip and GrFixedClip::Disabled() since they are
replaced with just nullptr.

By allowing nullptr to represent no intended clipping, it makes it easier
to require GrClip and GrAppliedClip objects to know about the dimensions
of the device. If we required a non-null clip object to represent no
clipping, we'd have to have an instance for each device based on its
size and that just became cumbersome.

Bug: skia:10205
Change-Id: Ie30cc71820b92d99356d393a4c98c8677082e761
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290539
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-05-28 18:55:13 +00:00
Ben Wagner
ebebf6e2b5 Move SkParagraph bits into skparagraph directory.
This makes it more obvious that these files really are part of
SkParagraph and integrate with the Skia test framework and are not part
of core Skia. This is more like how Skottie is setup and helps prevent
misunderstandings about where additional files like this should go and
how the build should be structured.

Change-Id: Iaac060c97cffd2b0c29833c7b0403521d91bdb6a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292439
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-05-28 13:59:18 +00:00
Michael Ludwig
81d4172d86 Reland "Simplify GrRTC::clean APIs"
This reverts commit 4730f29993.

Reason for revert: Fix WIP

Original change's description:
> Revert "Simplify GrRTC::clean APIs"
> 
> This reverts commit 6cbd7c2e57.
> 
> Reason for revert: mac/generated files failures
> 
> Original change's description:
> > Simplify GrRTC::clean APIs
> > 
> > The CanClearFullscreen enum type is removed. Most usages of clear() had
> > kYes because a null scissor rect was provided, or had kNo because the
> > scissor was really critical to the behavior. A few places did provide a
> > scissor and kYes (e.g. for initializing the target).
> > 
> > To simplify this, the public GrRTC has two variants of clear(). One with
> > only a color (for fullscreen clears), and one with a rect for partial
> > clears. The private API also adds a clearAtLeast() function that replaces
> > the several cases where we'd have a scissor but could expand to fullscreen.
> > 
> > I find the current control flow in internalClear() to be hard to
> > follow (albeit I was the one to make it that way...), but later CLs
> > will improve it.
> > 
> > Bug: skia:10205
> > Change-Id: I87cf8d688c58fbe58ee854fbc4ffe22482d969c6
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290256
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> 
> TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com
> 
> Change-Id: I7131df6f5323f4f9c120cbcfd9bc57e627e2eb65
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10205
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291842
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

# Not skipping CQ checks because this is a reland.

Bug: skia:10205
Change-Id: Id5db153d7c2500279cca8478818b66f67a53e143
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291844
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-05-27 14:26:16 +00:00
Michael Ludwig
4730f29993 Revert "Simplify GrRTC::clean APIs"
This reverts commit 6cbd7c2e57.

Reason for revert: mac/generated files failures

Original change's description:
> Simplify GrRTC::clean APIs
> 
> The CanClearFullscreen enum type is removed. Most usages of clear() had
> kYes because a null scissor rect was provided, or had kNo because the
> scissor was really critical to the behavior. A few places did provide a
> scissor and kYes (e.g. for initializing the target).
> 
> To simplify this, the public GrRTC has two variants of clear(). One with
> only a color (for fullscreen clears), and one with a rect for partial
> clears. The private API also adds a clearAtLeast() function that replaces
> the several cases where we'd have a scissor but could expand to fullscreen.
> 
> I find the current control flow in internalClear() to be hard to
> follow (albeit I was the one to make it that way...), but later CLs
> will improve it.
> 
> Bug: skia:10205
> Change-Id: I87cf8d688c58fbe58ee854fbc4ffe22482d969c6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290256
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com

Change-Id: I7131df6f5323f4f9c120cbcfd9bc57e627e2eb65
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10205
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291842
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-05-26 14:37:23 +00:00
Michael Ludwig
6cbd7c2e57 Simplify GrRTC::clean APIs
The CanClearFullscreen enum type is removed. Most usages of clear() had
kYes because a null scissor rect was provided, or had kNo because the
scissor was really critical to the behavior. A few places did provide a
scissor and kYes (e.g. for initializing the target).

To simplify this, the public GrRTC has two variants of clear(). One with
only a color (for fullscreen clears), and one with a rect for partial
clears. The private API also adds a clearAtLeast() function that replaces
the several cases where we'd have a scissor but could expand to fullscreen.

I find the current control flow in internalClear() to be hard to
follow (albeit I was the one to make it that way...), but later CLs
will improve it.

Bug: skia:10205
Change-Id: I87cf8d688c58fbe58ee854fbc4ffe22482d969c6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290256
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-05-26 13:16:12 +00:00
Mike Reed
1f60733fb3 Revert "Revert "move onto new factories for SkMatrix""
This reverts commit c80ee456ad.

fix: update flutter's gn file to add guard

Change-Id: Iac5171c8475d9a862d06255dab1c6f38f10de2f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291361
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-21 16:58:39 +00:00
Mike Reed
c80ee456ad Revert "move onto new factories for SkMatrix"
This reverts commit 046c2b7d90.

Reason for revert: need to update/guard flutter

Original change's description:
> move onto new factories for SkMatrix
> 
> Just rename, no functional changes expected.
> 
> Change-Id: Id77ab1cf6b1cab35087a7c56000750912cf47383
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290831
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>

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

Change-Id: Ic74f177128913374b8c60b4df88f04cf72fbacb3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291359
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-21 16:05:20 +00:00
Mike Reed
046c2b7d90 move onto new factories for SkMatrix
Just rename, no functional changes expected.

Change-Id: Id77ab1cf6b1cab35087a7c56000750912cf47383
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290831
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-05-21 15:04:09 +00:00
Chris Dalton
e5a141d0f6 Reland GrRectanizerPow2
This brings back the pow2 rectanizer for use with various ongoing
atlas experiments. If we can further optimize the skyline rectanizer,
then pow2 will be good to have around as a baseline comparison. And
if skyline gets fast enough, then we can delete pow2 again.

Change-Id: I79088c53fba7ba0d120534af99bee7840c135e42
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290810
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-05-19 18:35:13 +00:00
Julia Lavrova
3ea86251b9 Attaching ellipsis to emoji cluster
Bug: skia:10253
Change-Id: Id6b8507331facba4b69ebc96646a87c5e0eb6da9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290132
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-05-15 21:02:30 +00:00
Brian Osman
28590d54f5 Add 'shader' as an alias for 'fragmentProcessor'
Change-Id: I2d95c63de18125e6258709b48b03abd7904b7537
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278596
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-05-15 13:52:15 +00:00
Greg Daniel
0a2464f51f Update internal skia uses to use flushAndSubmit and submit calls.
Bug: skia:10118
Change-Id: Ieb7c0eece56d3d9df56ecb52e00e76c01f038de8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289888
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-14 20:26:44 +00:00
Ben Wagner
056d543c91 Put Paragraph SkDebugf behind runtime flag.
Adds the verboseParagraph command line flag to Paragraph samples so that
the informative SkDebugf calls are not made during normal execution.

Also put everything possible into the anonymous namespace.

Change-Id: Idaeb6845e2d8f322fdd0b988441f092d276ffbf1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289441
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2020-05-13 15:38:21 +00:00
Julia Lavrova
68d1433145 Fixing minor bugs: ellipsis on justified text
Change-Id: Ic0ebf53b221defa5d07ba2832666b322a2629547
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289020
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-05-13 14:59:21 +00:00
Julia Lavrova
dd1de25896 Fix TextHeightBehavior
Change-Id: I08148d2e942691c8d12070940bc2ee28855ffe59
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288761
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-05-11 20:32:55 +00:00
Julia Lavrova
6bdbd3da5d Lines ending with hard line breaks should not be justified
Bug: skia:10036
Change-Id: I4f1a41b3497bccb9e5f4b97163113b9241128bfd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288129
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-05-06 21:14:14 +00:00
Julia Lavrova
18db52f2ee Skips in underline decorations
Bug: skia:10166
Change-Id: Ib1d71f69d8647840f71c8599ca3517cb575bf945
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287620
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-05-06 18:59:34 +00:00
Chris Dalton
de5003768b Remove SkPath::RawIter from tests/tools/samplecode
Change-Id: I66c1b4aee9b07a4db294ed0cd82d01f3097c6acb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287857
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-05-06 16:31:53 +00:00
John Stiles
70941591b8 Remove unnecessary SK_SIZE_T_SPECIFIER macro.
This macro was only necessary to support Visual Studio 2013, which did
not yet support %zu format specifiers. Skia no longer compiles on
Visual Studio 2013.

Change-Id: Ie32a66c7a8e022b8596272476ca3547df1f89a55
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287738
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-05-05 13:25:28 +00:00
Chris Dalton
8d3eb24f2e Delete ToolUtils::set_path_pt
This can be done more simply with SkPathRef::Editor::writablePoints.

Change-Id: Icef31bf3a6cc2c8c4ef6da36167c574c73a0d944
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287497
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-05-04 19:00:57 +00:00
Brian Osman
d9bde07f1e Add SkRuntimeShaderBuilder, clean up SkRuntimeEffect API a bit
Utility class for getting named access to uniforms and children of an
SkRuntimeEffect (also functions as an example of using the
SkRuntimeEffect public API).

Moved several internal SkRuntimeEffect functions to private, and added
findInput/findChild helpers.

Change-Id: I8c2e7745ea81670a49b7ab2f51ce44a8d8169278
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286516
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-05-01 20:02:35 +00:00