Commit Graph

8145 Commits

Author SHA1 Message Date
Ethan Nicholas
a15f2bfb6f Reland "Revert "Omit dead SkSL functions""
This reverts commit fd1173ac71.

Reason for revert: TSAN failure: https://chromium-swarm.appspot.com/task?id=4c93823229fa6a10

Original change's description:
> Revert "Revert "Omit dead SkSL functions""
> 
> This reverts commit 7c969f26bc.
> 
> Change-Id: I8fb99f271e2ecaeb83d570cc2d2cf8851bc776f0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293338
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

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

# Not skipping CQ checks because this is a reland.

Change-Id: Iab3ee5a336074676ebd0b761922ececf189752ef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293843
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-06-03 17:14:18 +00:00
Ethan Nicholas
fd1173ac71 Revert "Revert "Omit dead SkSL functions""
This reverts commit 7c969f26bc.

Change-Id: I8fb99f271e2ecaeb83d570cc2d2cf8851bc776f0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293338
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-06-03 14:22:18 +00:00
Brian Salomon
392780277b Remove submit from async read pixels. User must submit.
Bug: chromium:1087118

Change-Id: Iab152ac483787fbdcca448aee0c4b9d2b354a92b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292840
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-06-02 16:55:04 +00:00
Leon Scroggins III
1adcac52d6 Remove transform_scanline from SkWebpEncoder
Bug: skia:10178

These functions can be performed generically using SkRasterPipeline
or skcms. Further, the reason we used a function pointer anyway was
so that we could call the same function on each row separately. But
libwebp's API doesn't let us do a single row at a time anyway.
Simplify this method by using readPixels when necessary and
skipping conversion entirely when possible.

Add support for encoding from unpremul 4444. It is simpler to support
it, and it's not obvious why we didn't support it before.

Keep the behavior of not supporting A8, and apply the same to the
other alpha-only formats. Note that we could support encoding such an
image to alpha, r=0, g=0, b=0, but I'd rather leave adding that
feature to a separate change, which enables it for all encoders (and
accounts for the internal use of PNGs as a round-trip for
kAlpha_8_SkColorType).

Add GMs to test the newly supported SkColorTypes.

Change-Id: I4d86c5621792fb6dc3cb68b736a1eb35d577e3a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292962
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-06-02 15:37:29 +00:00
Brian Osman
6b3d6e9210 Rewrite SkVertices serialization to use SkReadBuffer/SkWriteBuffer
These classes are much safer (there's no way to safely deserialize a
string with SkReader32 without knowledge of how it works internally).
Prior to this CL, SkVertices was the only complex type that had manual
serialization using the lower level types - now it works like everything
else. Additionally: the versioning can now be tied to picture versions
going forward (like everything else).

Bug: oss-fuzz:22909
Bug: oss-fuzz:22918
Bug: skia:9984
Bug: skia:10304
Change-Id: I3cf537eb765b5c8ce98b554c0f200e5d67c33d14
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293349
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-06-02 14:45:18 +00:00
Leon Scroggins III
995b467563 SkIcoCodec: Read the entire stream into data
Bug: 932080
Bug: b/142252770

An ICO file has a directory of images that are stored later in the file.
The directory contains the offset and size of the images. SkIcoCodec
uses these to create embedded SkPng/SkBmpCodecs. The old implementation
allocated a block of memory for each image and copied the stream into
those blocks so that the embedded SkCodecs could independently read
their encoded data.

Although SkIcoCodec checks for null, this still allows large (albeit
temporary - since we'll discard them if the stream does not contain
enough data to fill them) allocations and the potential for over-
commit.

Instead, read the entire stream into a contiguous buffer. If the stream
is already actually a buffer, just use that directly. In this case, the
new code will do less work. Otherwise, the memory we allocate is
limited by the size of the stream.

Note that this is a behavior change for a stream that contains two
consecutive ICOs, where the client expects to be able to read the second
one later. This was an issue for PNGs on Android (b/34073812), but I
suspect no one is relying on this behavior for ICO. Update Codec_end
test to remove the ICO test.

Alternatives to consider:
- only buffer the individual encoded images. This will allow us to
continue passing the Codec_end test.
- lazily read the embedded streams. Currently we read their start to
verify they are valid images (at least in the header) and read their
actual sizes and bit-depths, which could differ from that listed in
the directory. We use those to make a guess at the "best" image to use.
An image with mismatched sizes may now decode differently.

Change-Id: I30e5f6c8c2e5a0fa135348f61efe151a7f5d4756
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277058
Auto-Submit: Leon Scroggins <scroggo@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2020-06-01 21:14:09 +00:00
John Stiles
8c5786622b Reland "Remove double support from SkSL."
This reverts commit 59aa4b7187.

Reason for revert: ASAN failures were actually unrelated to this CL.

Original change's description:
> Revert "Remove double support from SkSL."
> 
> This reverts commit 71a35d49b7.
> 
> Reason for revert: ASAN failures on swarming bots
> 
> Original change's description:
> > Remove double support from SkSL.
> > 
> > Doubles are not supported by Metal or GLSL pre-4.0, are not supported in
> > most backends, and aren't used in any GMs. There isn't any good way to
> > use them in new code as it would just degrade to float on many of our
> > supported platforms. (This is assuming that our backends actually know
> > how to degrade doubles to floats, which is not universally the case.)
> > 
> > Change-Id: Ieacc69db4bdacca104a15a6eef33e05f977d1ffa
> > Bug: skia:10299
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292846
> > Commit-Queue: John Stiles <johnstiles@google.com>
> > Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> > Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> > Auto-Submit: John Stiles <johnstiles@google.com>
> 
> TBR=bsalomon@google.com,ethannicholas@google.com,johnstiles@google.com
> 
> Change-Id: I175e42420bcae8dfacd0bfeb269dd84e0b3c9d25
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10299
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293268
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>

TBR=bsalomon@google.com,ethannicholas@google.com,johnstiles@google.com

# Not skipping CQ checks because this is a reland.

Bug: skia:10299
Change-Id: I5cdd71a1512228175514a0d29e19ae91afc78b6a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293273
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-06-01 16:10:29 +00:00
John Stiles
59aa4b7187 Revert "Remove double support from SkSL."
This reverts commit 71a35d49b7.

Reason for revert: ASAN failures on swarming bots

Original change's description:
> Remove double support from SkSL.
> 
> Doubles are not supported by Metal or GLSL pre-4.0, are not supported in
> most backends, and aren't used in any GMs. There isn't any good way to
> use them in new code as it would just degrade to float on many of our
> supported platforms. (This is assuming that our backends actually know
> how to degrade doubles to floats, which is not universally the case.)
> 
> Change-Id: Ieacc69db4bdacca104a15a6eef33e05f977d1ffa
> Bug: skia:10299
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292846
> Commit-Queue: John Stiles <johnstiles@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>

TBR=bsalomon@google.com,ethannicholas@google.com,johnstiles@google.com

Change-Id: I175e42420bcae8dfacd0bfeb269dd84e0b3c9d25
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10299
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293268
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-06-01 15:24:42 +00:00
Ethan Nicholas
7c969f26bc Revert "Omit dead SkSL functions"
This reverts commit 97fe0cbed2.

Reason for revert: ASAN failures

Original change's description:
> Omit dead SkSL functions
> 
> Now that SkSL inlines functions, dead functions are very common. This
> change causes them to be omitted from the final output.
> 
> Change-Id: Ie466a3f748812eff1a368498365c89d73ab0b7be
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292684
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

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

Change-Id: Id20c5be67dd574d30d6f978ba610e43aa5018416
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293241
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-06-01 15:00:00 +00:00
Ethan Nicholas
97fe0cbed2 Omit dead SkSL functions
Now that SkSL inlines functions, dead functions are very common. This
change causes them to be omitted from the final output.

Change-Id: Ie466a3f748812eff1a368498365c89d73ab0b7be
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292684
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-06-01 14:27:38 +00:00
John Stiles
71a35d49b7 Remove double support from SkSL.
Doubles are not supported by Metal or GLSL pre-4.0, are not supported in
most backends, and aren't used in any GMs. There isn't any good way to
use them in new code as it would just degrade to float on many of our
supported platforms. (This is assuming that our backends actually know
how to degrade doubles to floats, which is not universally the case.)

Change-Id: Ieacc69db4bdacca104a15a6eef33e05f977d1ffa
Bug: skia:10299
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292846
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-06-01 14:08:17 +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
Greg Daniel
6c6caf420a Add GrBackendMutableState object to handle shared texture state.
This is will be the main struct used to synchronize changes of certain
texture/image between clients and Skia. With this change we
implement support for the Vulkan shared state as POC.

Bug: skia:10254
Change-Id: I10543357635c347838b193874e4da4496a0dcf06
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292311
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-05-29 16:53:08 +00:00
Stephen White
fdba6c8b76 Modify SurfaceTest to only test readbacks from supported surfaces.
Dawn: support readbacks in caps only from Texture-based surfaces.
Change-Id: I3681b9418f592d9c511931cb422f0f8fb113ff73
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291973
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2020-05-29 16:21:45 +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
John Stiles
1bdafbf016 Reland "Improve matrix construction abilities in Metal codegen."
This is a reland of daa573eb91

Original change's description:
> Improve matrix construction abilities in Metal codegen.
>
> GLSL (and thus SkSL) is flexible about the input parameters to a matrix
> constructor. You can mix vectors and scalars freely, and it will
> populate them into your matrix as if it was a flat list of scalars.
>
> Metal does not natively support this, and requires the proper number of
> floatNs to be passed in. However, the Metal code generator will now emit
> constructor helper functions that will fix this up automatically.
>
> Additionally, this CL simplifies the Metal codegen for single-scalar
> matrix construction. This should create a matrix with the passed-in
> scalar running along the matrix diagonal. The Metal codegen previously
> emitted a helper function to do this work on our behalf. However,
> that's not necessary; Metal already contains a single-argument matrix
> constructor that will do this work automatically for us.
>
> Change-Id: I76901bfe167502797aa4cb98d0e8986d9ebc51e5
> Bug: skia:10280
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292477
> Auto-Submit: John Stiles <johnstiles@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>

Bug: skia:10280
Change-Id: If5591392bb96e1cfb643d4e3c19a0ee4affec58d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292689
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-05-28 22:20:10 +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
John Stiles
1fa15b1642 Revert "Improve matrix construction abilities in Metal codegen."
Doesn't build with `skia_compile_processors = true`

This reverts commit daa573eb91.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Improve matrix construction abilities in Metal codegen.
> 
> GLSL (and thus SkSL) is flexible about the input parameters to a matrix
> constructor. You can mix vectors and scalars freely, and it will
> populate them into your matrix as if it was a flat list of scalars.
> 
> Metal does not natively support this, and requires the proper number of
> floatNs to be passed in. However, the Metal code generator will now emit
> constructor helper functions that will fix this up automatically.
> 
> Additionally, this CL simplifies the Metal codegen for single-scalar
> matrix construction. This should create a matrix with the passed-in
> scalar running along the matrix diagonal. The Metal codegen previously
> emitted a helper function to do this work on our behalf. However,
> that's not necessary; Metal already contains a single-argument matrix
> constructor that will do this work automatically for us.
> 
> Change-Id: I76901bfe167502797aa4cb98d0e8986d9ebc51e5
> Bug: skia:10280
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292477
> Auto-Submit: John Stiles <johnstiles@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>

TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com

Change-Id: I18610167e980eb1437842930deb9cc7509364f70
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10280
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292573
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-05-28 17:37:20 +00:00
John Stiles
daa573eb91 Improve matrix construction abilities in Metal codegen.
GLSL (and thus SkSL) is flexible about the input parameters to a matrix
constructor. You can mix vectors and scalars freely, and it will
populate them into your matrix as if it was a flat list of scalars.

Metal does not natively support this, and requires the proper number of
floatNs to be passed in. However, the Metal code generator will now emit
constructor helper functions that will fix this up automatically.

Additionally, this CL simplifies the Metal codegen for single-scalar
matrix construction. This should create a matrix with the passed-in
scalar running along the matrix diagonal. The Metal codegen previously
emitted a helper function to do this work on our behalf. However,
that's not necessary; Metal already contains a single-argument matrix
constructor that will do this work automatically for us.

Change-Id: I76901bfe167502797aa4cb98d0e8986d9ebc51e5
Bug: skia:10280
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292477
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2020-05-28 17:03:21 +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
Ethan Nicholas
70728ef8e7 Revert "Reland "Revert "SkSL function inlining"""
This reverts commit 04ff61faae.

Change-Id: Ieb69c76b161ec9e003982d36bb2e28d055ad47a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292266
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-05-28 13:27:58 +00:00
Michael Ludwig
22534f2098 Expose sk_FragCoord for runtime effects
This is needed for the inline dither effect to use device coordinates
instead of local coords for dithering.

The builtin is not "in float4" because that trips up the runtime effect
assertions about what types of in variables are allowed.

Change-Id: I580fc461fdc9cbd812592b2571f51868a7a3ea4b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292262
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-05-27 23:06:09 +00:00
Michael Ludwig
5e6b3cd259 Store float value for settings in SkSL v2
If you used 'in float foo' in a runtime effect it would always have the
value cast to an int. I don't think we saw this in .fp files because
the cpp generation handled those values directly (if I remember correctly)

Just uses a union of float and int, differentiated by fKind, so that it
compiles in standalone mode (vs. using SkFloat2Bits, etc.).

Also updated to add a unit test.

Change-Id: I420f43d1b54638883af0b8df6ccba2416c587868
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292315
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-05-27 22:15:19 +00:00
Ethan Nicholas
04ff61faae Reland "Revert "SkSL function inlining""
This reverts commit 2dd272bf15.

Reason for revert: breaking angle

Original change's description:
> Revert "Revert "SkSL function inlining""
> 
> This reverts commit 1b63b4ac69.
> 
> Change-Id: I8120bb10cecc6889f4f4fd7b4c3a61d250e49219
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291358
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

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

# Not skipping CQ checks because this is a reland.

Change-Id: Ib3117efd1b77e97899e636bcbc4d84200118bc36
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292264
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-05-27 19:57:58 +00:00
Ethan Nicholas
2dd272bf15 Revert "Revert "SkSL function inlining""
This reverts commit 1b63b4ac69.

Change-Id: I8120bb10cecc6889f4f4fd7b4c3a61d250e49219
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291358
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-05-27 18:26:47 +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
Greg Daniel
55822f17bd Add submittedProc to GrFlushInfo.
Bug: skia:10118
Change-Id: Iad848310d0f2fb22f19e9890209548fda103bd27
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291078
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-27 12:48:43 +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 Klein
ec8e0bf6d7 clean up legacy sRGB stages
Nothing terribly interesting.

Change-Id: I8956c5bc3fa9098337bad8fa143de1d95f987f9f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291655
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-05-24 19:47:08 +00:00
Herb Derby
88a3b46296 turn off 2M glyph test
This test is causing some ios and android tests to fail with out
of memory.

Change-Id: I6e8eab502860097be307bf5e9c09983a66e783dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291656
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-05-22 16:13:44 +00:00
Herb Derby
317dce5c81 Drop SkTextBlobs with > 2M glyphs.
This will guard against buffer overflows
for large text blobs.

Bug: chromium:1080481
Change-Id: I13a10869babfa149a70c2f4caebb3a1ae4452b77
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291456
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-05-21 22:45:55 +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
Leon Scroggins III
87caae61cd Move SkBitmapRegionCodec into client_utils/android
Bug: skia:10154

This will make it clear that these files are for Android use and
avoid compiling them for other clients.

Update testing tools to use android::skia::BitmapRegionDecoder, but
only if SK_ENABLE_ANDROID_UTILS is defined.

Take this opportunity to clean up the class:
- The base class, which was originally designed to allow switching
  amongst different implementations, is no longer needed. Rename
  SkBitmapRegionCodec to android::skia::BitmapRegionDecoder
  (following the new convention and matching the Java API name).
  Continue to inherit from SkBitmapRegionDecoder temporarily, to
  allow Android to switch to the new API.
- Use std::unique_ptr instead of passing raw pointers.

Add a test to verify that we only create a BitmapRegionDecoder if
it is one of the supported types.

Change-Id: Ied13fc8acb105fde042553331846d95ae15d6b57
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287498
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2020-05-20 20:06:48 +00:00
Greg Daniel
04283f3f6f Reland "Implement submit API to GrContext."
This reverts commit 9ee15d7b57.

Reason for revert: relanding with fixes

Original change's description:
> Revert "Implement submit API to GrContext."
> 
> This reverts commit 40f288c72e.
> 
> Reason for revert: canvaskit breaking for some reason???
> 
> Original change's description:
> > Implement submit API to GrContext.
> > 
> > Change-Id: Ib813d42abb5f63e2ecdbf245d416658143853288
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289033
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com,penghuang@chromium.org,vasilyt@chromium.org
> 
> Change-Id: Iee6c8342cccc601edf64ea011f1303e5d72559a9
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290917
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,penghuang@chromium.org,vasilyt@chromium.org

# Not skipping CQ checks because this is a reland.

Change-Id: I5203676f88893cbbaba685301b8a713b40396b48
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290960
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-20 19:00:25 +00:00
Greg Daniel
49de1031d4 Reland "Remove deprecated flush calls."
This reverts commit 5e6d789ce4.

Reason for revert: Relanding with fix landed in chrome

Original change's description:
> Revert "Remove deprecated flush calls."
> 
> This reverts commit d8fd0bf574.
> 
> Reason for revert: chrome roll
> 
> Original change's description:
> > Remove deprecated flush calls.
> > 
> > Bug: skia:10118
> > Change-Id: I13758b5416784c296b8b5be9f3228230ac1be05f
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290540
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com
> 
> Change-Id: I49d35cdb258e632f645974c5ec62075d3392efe0
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10118
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290834
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

# Not skipping CQ checks because this is a reland.

Bug: skia:10118
Change-Id: Ie24d7845a4ad75f95afe59037ea80a9f38082f13
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290918
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-20 15:48:46 +00:00
Greg Daniel
5e6d789ce4 Revert "Remove deprecated flush calls."
This reverts commit d8fd0bf574.

Reason for revert: chrome roll

Original change's description:
> Remove deprecated flush calls.
> 
> Bug: skia:10118
> Change-Id: I13758b5416784c296b8b5be9f3228230ac1be05f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290540
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I49d35cdb258e632f645974c5ec62075d3392efe0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10118
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290834
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-19 20:58:40 +00:00
Greg Daniel
9ee15d7b57 Revert "Implement submit API to GrContext."
This reverts commit 40f288c72e.

Reason for revert: canvaskit breaking for some reason???

Original change's description:
> Implement submit API to GrContext.
> 
> Change-Id: Ib813d42abb5f63e2ecdbf245d416658143853288
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289033
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,penghuang@chromium.org,vasilyt@chromium.org

Change-Id: Iee6c8342cccc601edf64ea011f1303e5d72559a9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290917
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-19 20:55:27 +00:00
Greg Daniel
40f288c72e Implement submit API to GrContext.
Change-Id: Ib813d42abb5f63e2ecdbf245d416658143853288
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289033
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-05-19 20:08:38 +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
Greg Daniel
d8fd0bf574 Remove deprecated flush calls.
Bug: skia:10118
Change-Id: I13758b5416784c296b8b5be9f3228230ac1be05f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290540
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-05-19 18:01:24 +00:00
Robert Phillips
1b63b4ac69 Revert "SkSL function inlining"
This reverts commit b65024b5f2.

Reason for revert: Shader compilation failures

Original change's description:
> SkSL function inlining
> 
> This first pass adds "one size fits all" function inlining, without any
> allowances for simple functions that don't need all of this machinery
> in place. Followup CLs will simplify common cases by e.g. not storing
> arguments in variables if they're already variables and not wrapping
> the function body in a loop when it isn't necessary.
> 
> Change-Id: I4fd8c1655ff48b9e4708bcca03a506df34ceadd9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290127
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

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

Change-Id: Ia6e643e0dcb66a4f0c2a377b89117047bbc5d058
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290801
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-05-19 16:10:51 +00:00
Ethan Nicholas
b65024b5f2 SkSL function inlining
This first pass adds "one size fits all" function inlining, without any
allowances for simple functions that don't need all of this machinery
in place. Followup CLs will simplify common cases by e.g. not storing
arguments in variables if they're already variables and not wrapping
the function body in a loop when it isn't necessary.

Change-Id: I4fd8c1655ff48b9e4708bcca03a506df34ceadd9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290127
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-05-19 14:22:10 +00:00
Herb Derby
e7825ff7e3 Reland "direct mask biased to (0,0)"
This is a reland of 56cde4923f

Original change's description:
> direct mask biased to (0,0)
>
> Create mask rectangles in device space.
> But, instead of offsetting to the drawing text blob origin
> offset to 0,0 to simplify mapping from source space to
> device space.
>
> Bug: skia:10251
>
> Change-Id: Ic637eb78879bcfae7e7944053d67d9eaef8490cc
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290133
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

Bug: skia:10251
Change-Id: I622ed5c3c16379b06989bf737e74a7752984c158
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290441
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-05-18 15:58:37 +00:00
Robert Phillips
1040e38363 Revert "direct mask biased to (0,0)"
This reverts commit 56cde4923f.

Reason for revert: may be blocking Chrome roll

Original change's description:
> direct mask biased to (0,0)
> 
> Create mask rectangles in device space.
> But, instead of offsetting to the drawing text blob origin
> offset to 0,0 to simplify mapping from source space to
> device space.
> 
> Bug: skia:10251
> 
> Change-Id: Ic637eb78879bcfae7e7944053d67d9eaef8490cc
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290133
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

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

Bug: skia:10251
Change-Id: I54b078d3eb88f209ce2a857e5fcf763c4d577ac3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290439
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-05-18 13:15:47 +00:00
Herb Derby
56cde4923f direct mask biased to (0,0)
Create mask rectangles in device space.
But, instead of offsetting to the drawing text blob origin
offset to 0,0 to simplify mapping from source space to
device space.

Bug: skia:10251

Change-Id: Ic637eb78879bcfae7e7944053d67d9eaef8490cc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290133
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-05-15 20:24:13 +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
Herb Derby
79c5674a4c Place transformed drawing data at source space (0,0)
The direct device remains fully positioned,
and will be addressed in a following CL.

This is a step towards making the vertex data
constant. The path data is positioned at draw
time instead of at creation time.

The GPU data is not constant at this time, but
when all the vertex data is placed at (0,0) the
data can be const.

Bug: skia:10251

Change-Id: I24991e1ba76ab77f06bf040d88de93bc31002b31
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289880
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-05-14 18:29:53 +00:00
Stephen White
dbb3e1dc2e Remove some asserts that prevent Dawn from completing a DM run.
Dawn does not support readback from a bare render target, so it will
continued to fail those tests. But it should fail without dm halting
execution.

Change-Id: If7955106d5dbb4eaea86af58de96bcc7e74aac85
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288902
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2020-05-14 17:15:23 +00:00
Herb Derby
8f3963f281 Add array initializer
Generate an array with initialized values based on
a function of the index.

Change-Id: I1d7d83ba9cacde47b8c736f26dedc15294929937
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289489
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-05-14 14:34:12 +00:00
Chris Dalton
f6bf516926 Reland "Add an implementation and log2 variants for Wang's formula"
This is a reland of e278e1c1c7

Original change's description:
> Add an implementation and log2 variants for Wang's formula
>
> Wang's formulas for cubics and quadratics (1985) tell us how many line
> segments a curve must be chopped into when tessellating. This CL adds
> an implementation along with optimized log2 variants, as well as tests
> and a benchmark.
>
> Change-Id: I3f777b8d0312c57c3a1cc24307de5945c70be287
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288321
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

TBR=bsalomon@google.com

Change-Id: Ie3822c62439fc579a59ea8adb49583224de41aa5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289680
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-05-14 02:57:59 +00:00
Mike Klein
6c3db04c8b Revert "Add an implementation and log2 variants for Wang's formula"
This reverts commit e278e1c1c7.

Reason for revert: i think we need to do that add with an unsigned, or test instead of always += (1<<23)-1.

Original change's description:
> Add an implementation and log2 variants for Wang's formula
> 
> Wang's formulas for cubics and quadratics (1985) tell us how many line
> segments a curve must be chopped into when tessellating. This CL adds
> an implementation along with optimized log2 variants, as well as tests
> and a benchmark.
> 
> Change-Id: I3f777b8d0312c57c3a1cc24307de5945c70be287
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288321
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

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

Change-Id: I24dfd8549054b632f38f7b05b4d857b640cf5cd1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289658
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-05-13 22:10:47 +00:00
Greg Daniel
b2365d81d0 Reland "Reland "Add api on GrContext to update the data of GrBackendTextures.""
This reverts commit ed219fe171.

Reason for revert: relanding with fix

Original change's description:
> Revert "Reland "Add api on GrContext to update the data of GrBackendTextures.""
> 
> This reverts commit 83c6626946.
> 
> Reason for revert: technospark is failing to upload pixmaps to non base mip levels
> 
> Original change's description:
> > Reland "Add api on GrContext to update the data of GrBackendTextures."
> > 
> > This reverts commit 93ca54e0ac.
> > 
> > Reason for revert: relanding with fix
> > 
> > Original change's description:
> > > Revert "Add api on GrContext to update the data of GrBackendTextures."
> > > 
> > > This reverts commit ac09f7cd7a.
> > > 
> > > Reason for revert: breaking bots, may need to use swizzled color for
> > > correctness test
> > > 
> > > Original change's description:
> > > > Add api on GrContext to update the data of GrBackendTextures.
> > > > 
> > > > Change-Id: I680f12bf58fc7b66a6b2f3fa4c4723ae84d3f949
> > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288555
> > > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > > 
> > > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> > > 
> > > Change-Id: I47f41f536619ac13ca3ceeb216e7eaed9a9af255
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288630
> > > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > 
> > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> > 
> > # Not skipping CQ checks because this is a reland.
> > 
> > Change-Id: I82283b2437e523b80acead71c5f7c651180620db
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288631
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> 
> Change-Id: I5d6614db8db59a69ded511726507a186596cfbd4
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288907
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

# Not skipping CQ checks because this is a reland.

Change-Id: I35fa1ae7dc47a697bbc358655f5c821942033234
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288909
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-13 21:49:25 +00:00
Chris Dalton
e278e1c1c7 Add an implementation and log2 variants for Wang's formula
Wang's formulas for cubics and quadratics (1985) tell us how many line
segments a curve must be chopped into when tessellating. This CL adds
an implementation along with optimized log2 variants, as well as tests
and a benchmark.

Change-Id: I3f777b8d0312c57c3a1cc24307de5945c70be287
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288321
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-05-13 21:39:24 +00:00
Michael Ludwig
c002d5619e Simplify GrClip::getConservativeBounds() signature
It turns out no one was using the intersection of rect functionality on
GrClip, and this helps simplify what the new clip stack needs to define.

Bug: skia:10205
Change-Id: If85a0c744dd68a8ad2f380b54a539ac74850e4ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289440
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-05-13 18:59:13 +00:00
Chris Dalton
b8d7e00098 Move makeDraw(Indexed)IndirectSpace into GrMeshDrawOp::Target
Change-Id: I9e7e483d2baf24c8c87f22b9658969b9dbed72f9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289458
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-05-13 17:52:51 +00:00
Herb Derby
537dc05d41 Fix SkSpan supspan() add test
Change-Id: Ida683aa054fef977b91b3232b063f74344ffc2c9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289448
Auto-Submit: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-05-13 16:51:31 +00:00
Greg Daniel
dd68b78917 Fix VkProtectedContextTest to correctly make SkSurfaces.
Change-Id: I7815e8967ae180c8a45d82c610b77fab4c36323d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289246
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-12 19:15:55 +00:00
Adlai Holler
684838f1f5 Mark SkStringPrintf as SK_PRINTF_LIKE
Change-Id: I3d2ee8dca1d2e962794ce8c3c391779bff357f0c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288762
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
2020-05-12 15:22:14 +00:00
Mike Klein
c74db7998b remove Assembler::here()
It's just a shortcut for

   Assembler::Label l;
   a->label(&l);

and it never really took off.
It's easier to work on Label without it.

Change-Id: I4a060f78f235ac3fcc87b996f5d9404ffba43c53
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288997
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-05-11 17:42:40 +00:00
Greg Daniel
ed219fe171 Revert "Reland "Add api on GrContext to update the data of GrBackendTextures.""
This reverts commit 83c6626946.

Reason for revert: technospark is failing to upload pixmaps to non base mip levels

Original change's description:
> Reland "Add api on GrContext to update the data of GrBackendTextures."
> 
> This reverts commit 93ca54e0ac.
> 
> Reason for revert: relanding with fix
> 
> Original change's description:
> > Revert "Add api on GrContext to update the data of GrBackendTextures."
> > 
> > This reverts commit ac09f7cd7a.
> > 
> > Reason for revert: breaking bots, may need to use swizzled color for
> > correctness test
> > 
> > Original change's description:
> > > Add api on GrContext to update the data of GrBackendTextures.
> > > 
> > > Change-Id: I680f12bf58fc7b66a6b2f3fa4c4723ae84d3f949
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288555
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > 
> > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> > 
> > Change-Id: I47f41f536619ac13ca3ceeb216e7eaed9a9af255
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288630
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> 
> # Not skipping CQ checks because this is a reland.
> 
> Change-Id: I82283b2437e523b80acead71c5f7c651180620db
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288631
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: I5d6614db8db59a69ded511726507a186596cfbd4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288907
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-11 15:48:40 +00:00
Greg Daniel
83c6626946 Reland "Add api on GrContext to update the data of GrBackendTextures."
This reverts commit 93ca54e0ac.

Reason for revert: relanding with fix

Original change's description:
> Revert "Add api on GrContext to update the data of GrBackendTextures."
> 
> This reverts commit ac09f7cd7a.
> 
> Reason for revert: breaking bots, may need to use swizzled color for
> correctness test
> 
> Original change's description:
> > Add api on GrContext to update the data of GrBackendTextures.
> > 
> > Change-Id: I680f12bf58fc7b66a6b2f3fa4c4723ae84d3f949
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288555
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> 
> Change-Id: I47f41f536619ac13ca3ceeb216e7eaed9a9af255
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288630
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

# Not skipping CQ checks because this is a reland.

Change-Id: I82283b2437e523b80acead71c5f7c651180620db
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288631
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-11 14:45:08 +00:00
Greg Daniel
93ca54e0ac Revert "Add api on GrContext to update the data of GrBackendTextures."
This reverts commit ac09f7cd7a.

Reason for revert: breaking bots, may need to use swizzled color for
correctness test

Original change's description:
> Add api on GrContext to update the data of GrBackendTextures.
> 
> Change-Id: I680f12bf58fc7b66a6b2f3fa4c4723ae84d3f949
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288555
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: I47f41f536619ac13ca3ceeb216e7eaed9a9af255
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288630
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-08 15:38:21 +00:00
Greg Daniel
ac09f7cd7a Add api on GrContext to update the data of GrBackendTextures.
Change-Id: I680f12bf58fc7b66a6b2f3fa4c4723ae84d3f949
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288555
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-08 15:15:00 +00:00
Chris Dalton
957189bfc2 Remove RawIter usages from pathops
Change-Id: Ib988271088cb1459d026faeb497eeed793172928
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287887
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-05-07 19:38:50 +00:00
Greg Daniel
16032b33d9 Split apart creating and updating GrBackendTextures internally.
This change does not any public APIs but just pulls apart the create and
update steps inside of createBackendTexture. A future CL will allow just
calling update from the public API with an already create texture.

This change only splits apart the work for non compressed textures.
Compressed support can be added at a future time, but for many backends
it should be fairly trivial since the update call handles compressed and
uncompressed already.

Change-Id: Iae99e9f140c347effe66b5d669c6f39bce023115
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287856
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-06 20:02:04 +00:00
Michael Ludwig
29c2f71cb8 Fix false positive in SkRRectPriv::ConservativeIntersect
Change-Id: I754fde671fcbaa2acf6443eb0a737b546e5c6f7e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287889
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-05-06 19:49:39 +00:00
Greg Daniel
dddf709101 When creating with data, always set vk GrBackendTexture layout to sampled.
We won't lose much by not going to color attachment layout since when the
renderable GrBackendTexture gets wrapped in an SkSurface we still will put
in a barrier to protect from write after write. The barrier will now just
also include a layout change.

Change-Id: I91cddd0a4de415760c3e7e4382c243946f788301
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288136
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-05-06 17:56:14 +00:00
Greg Daniel
c1ad77cf48 Add finisehd proc to backend texture creation.
The callback lets the caller know when the data uploads to the texture
from the create call are finished. This is important since the caller
cannot delete the backend texture till the gpu is finished on vulkan
and d3d.

This change also removes the hard sync in vulkan during creation.

Change-Id: I660d142219474e22b1337d2b0c81cda66fe18a4b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286517
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-05-06 16:50:33 +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
Ben Wagner
e2a944384c Fix SkBitSet.
Rename methods to be more like std::bitset and boost::dynamic_bitset.
Also fix findFirst to actually find the first and add tests.

Change-Id: Ic812c0a6d0ce1740c1cda900516f609ebbf5811c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287676
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2020-05-05 20:04:11 +00:00
Ben Wagner
e8ffb088c1 Close file before writing in SkVMTest.
On Windows each time the test is run one gets

sk_fopen: fopen("resources\SkVMTest.expected", "wb") returned nullptr (errno:22): Invalid argument

due to 'expected' holding a read lock on the file when trying to open
the same file for writing. Windows locks files aggressively and in this
case there is no good reason to keep the read access when trying to
truncate and write to this file path.

This also changes the logic to only update the file in the error case
when the content would actually change. Previously it seems this file
would be re-written (usually with the same content) every time this test
ran.

Change-Id: I9c96f1e7e0692e57326fec351c7353c423014c9a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287381
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-05-05 15:10:09 +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
Mike Klein
962020fe39 simplify binary ops too
Rename apply() to unary(), then add binary().

Fix unary to calculate N=base-inst+1.

Convert to simpler `auto&& fn` mode by renaming
approx_atan(y,x) to approx_atan2.  Now we can pass
functions, lambdas, non-lambda functors, whatever.

Change-Id: I17a6aa137f224edc0accd0509c5023a30980fe39
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286900
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-05-01 20:43:09 +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
Robert Phillips
ef41d500cc Disable MTLPixelFormatBGR10A2Unorm on iOS
This is a bit overkill. Support for BGR10_A2 was added in iOS 11 but we support iOS 9 and up.

Bug: skia:10195
Bug: 1068416
Change-Id: I0b66c3ac676ef14d5bc2c7fcf194047b51017e83
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286878
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2020-05-01 14:47:55 +00:00
Michael Ludwig
f38b711222 Reland "Refactor geometry union capabilities out of GrStyledShape"
This reverts commit af312c9d40.

Reason for revert: improved performance, updated empty point cap behavior
to make chrome happy.

Because of the performance regression in the original CL, this is a bit
more to it than just updating cap behavior. Summary of changes for perf:
1. In asPath(), only call reset() if the type isn't a path or arc.
   Otherwise it was just a wasted realloc of an empty path ref.
2. Rewrote the GrShape::simplify() to not progress through every shape
   type in order, it just jumps to the appropriate type.
3. Have simplify() return whether or not the shape started out closed,
   so we don't have to call GrShape::closed(), which is costly when the
   shape is a path.
4. Expose the GrShape's type enum so GrStyledShape's key writing can use
   switches instead of a giant block of ifs (where path happened to be
   last)

The regressions showed up most heavily on desk_mapsvg and desk_chalkboard
SKPs on the Android skpbench marks. On my system, I was able to
reproduce a similar %-regression from ToT and the original CL on the
chalkboard (but not mapsvg).

Master ranged between 5.1 and 5.3ms, original CL ranged from 5.6-5.8
and after the changes listed above, I got it down to 5.3-5.5. It's not
ideal but I haven't been able to figure out anything more substantial
that it could be. At this point it may just be code layout and/or the
fact that it's now split into two types.


Original change's description:
> Revert "Refactor geometry union capabilities out of GrStyledShape"
>
> This reverts commit 2becdde074.
>
> Reason for revert: likely breaking cc unit test due to empty shape cap change.
>
> Original change's description:
> > Refactor geometry union capabilities out of GrStyledShape
> >
> > The geometry union part of GrStyledShape is now held in GrShape. For the
> > most part, GrShape is entirely style agnostic and focuses on storing
> > the various types of geometry, and destructing them gracefully. It also
> > provides a public API that unifies functionality across all shape types,
> > such as contains() and bounds().
> >
> > GrStyledShape now just owns a GrShape and a GrStyle, and handles the
> > additional simplification logic that relies on knowing the effects of
> > the style on the draw. This is where GrShape makes some allowances for
> > style. Its simplify() function accepts flags that enable/disable various
> > simplification optimizations. Currently these are designed around
> > what is needed to respect path effects and stroking behaviors in
> > GrStyledShape. The main other user of GrShape (the new clip stack) will
> > always provide all flags since it treats every shape as if it were
> > simply filled.
> >
> > Several other related refactorings were taken at the same time:
> > 1. The implementations for asNestedRects, asRRect, etc. were moved out
> >    of the header and into the cpp file for GrStyledShape.
> > 2. GrRenderTargetContext relies on GrStyledShape for its stroke rect
> >    fallbacks.
> > 3. GrShape can hold points, lines, and rects explicitly. This let me
> >    simplify the stroke reasoning.
> >
> > Change-Id: I9fe75613fee51c30b4049b2b5a422daf80a1a86e
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284803
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Reviewed-by: Chris Dalton <csmartdalton@google.com>
>
> TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com
>
> Change-Id: I2af5782e072e0ccb4a87f903bb88cbe335b9613f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286039
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

Change-Id: I8c614573582084f2e9ee0d73f93812e0a7c13983
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286396
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-04-30 19:36:43 +00:00
Robert Phillips
cbc9667025 Add some missed BGRA_1010102 testing tidbits
A follow up to:
https://skia-review.googlesource.com/c/skia/+/285356 (Add BGR_10A2 support to Ganesh)

Change-Id: If19e234bf80d4affd515d6168f1faeec13f4fcf8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285856
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-30 18:31:37 +00:00
Mike Klein
5cf6b31fc8 Revert "retry absl"
This reverts commit 1d256d66ec.

Reason for revert: Build-Debian10-Clang-arm64-Debug-Android_ASAN can't find <cxxabi.h>.

Original change's description:
> retry absl
> 
> This time around, cut the absl deps down to just what's
> needed to compile, link, and run AbseilTest.cpp.
> 
> Add basic absl::btree_map test.
> 
> Bug: skia:10165
> Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-arm-Debug-Chromebook_GLES;skia/skia.primary:Test-Mac10.13-Clang-MacBookPro11.5-CPU-AVX2-x86_64-Release-All-TSAN
> Change-Id: I53d632a04cba8dadd484b2c4d0ceefb314676486
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286070
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

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

Change-Id: I2465ed155f7311c6ca35259ea1bf1b610020a66d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10165
Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-arm-Debug-Chromebook_GLES;skia/skia.primary:Test-Mac10.13-Clang-MacBookPro11.5-CPU-AVX2-x86_64-Release-All-TSAN
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286477
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-30 16:11:14 +00:00
Mike Klein
1d256d66ec retry absl
This time around, cut the absl deps down to just what's
needed to compile, link, and run AbseilTest.cpp.

Add basic absl::btree_map test.

Bug: skia:10165
Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-arm-Debug-Chromebook_GLES;skia/skia.primary:Test-Mac10.13-Clang-MacBookPro11.5-CPU-AVX2-x86_64-Release-All-TSAN
Change-Id: I53d632a04cba8dadd484b2c4d0ceefb314676486
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286070
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-30 16:01:41 +00:00
Robert Phillips
9a30ee09b0 Add BGR_10A2 support to Ganesh (take 2)
This is no different from the first try but a Chrome-side bug fix has landed:

https://chromium-review.googlesource.com/c/chromium/src/+/2173388 (Map RGBA/BGRA_1010102 to their correct SkColorType equivalents)

TBR=bsalomon@google.com
Bug: 1068416
Change-Id: Ic6ee758b0f0537d83262b0d708f9b7b15a4cb1c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286036
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-30 15:25:20 +00:00
Adlai Holler
5ba50afeed Replace skstd::exchange with std::exchange
Change-Id: Id8065e4ff7299c12b1469468dab278b771c0382d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286277
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-30 11:14:20 +00:00
Mike Klein
77083c7d74 Revert "replace SkSharedMutex"
This reverts commit cfdc07aa0e.

Reason for revert: nope, flutter windows bots don't have it.  we got caught.

Original change's description:
> replace SkSharedMutex
> 
> I am debugging an issue with SkSharedMutex and noticed
> how sparsely it is used.  That got me curious to see if
> we can replace it with a std::shared_mutex (from C++17).
> 
> Bug: skia:10177
> Change-Id: I1ce4d2a5897af198d6ae5fb850548ff917a58f50
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285691
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

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

Change-Id: Iab4e55d749e386233ff0e2ba2c1cd10d5e6f1615
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10177
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286124
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-29 18:50:39 +00:00
Mike Klein
cfdc07aa0e replace SkSharedMutex
I am debugging an issue with SkSharedMutex and noticed
how sparsely it is used.  That got me curious to see if
we can replace it with a std::shared_mutex (from C++17).

Bug: skia:10177
Change-Id: I1ce4d2a5897af198d6ae5fb850548ff917a58f50
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285691
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-29 14:15:42 +00:00
Michael Ludwig
af312c9d40 Revert "Refactor geometry union capabilities out of GrStyledShape"
This reverts commit 2becdde074.

Reason for revert: likely breaking cc unit test due to empty shape cap change.

Original change's description:
> Refactor geometry union capabilities out of GrStyledShape
> 
> The geometry union part of GrStyledShape is now held in GrShape. For the
> most part, GrShape is entirely style agnostic and focuses on storing
> the various types of geometry, and destructing them gracefully. It also
> provides a public API that unifies functionality across all shape types,
> such as contains() and bounds().
> 
> GrStyledShape now just owns a GrShape and a GrStyle, and handles the
> additional simplification logic that relies on knowing the effects of
> the style on the draw. This is where GrShape makes some allowances for
> style. Its simplify() function accepts flags that enable/disable various
> simplification optimizations. Currently these are designed around
> what is needed to respect path effects and stroking behaviors in
> GrStyledShape. The main other user of GrShape (the new clip stack) will
> always provide all flags since it treats every shape as if it were
> simply filled.
> 
> Several other related refactorings were taken at the same time:
> 1. The implementations for asNestedRects, asRRect, etc. were moved out
>    of the header and into the cpp file for GrStyledShape.
> 2. GrRenderTargetContext relies on GrStyledShape for its stroke rect
>    fallbacks.
> 3. GrShape can hold points, lines, and rects explicitly. This let me
>    simplify the stroke reasoning.
> 
> Change-Id: I9fe75613fee51c30b4049b2b5a422daf80a1a86e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284803
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Chris Dalton <csmartdalton@google.com>

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

Change-Id: I2af5782e072e0ccb4a87f903bb88cbe335b9613f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286039
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-04-29 13:32:34 +00:00
Robert Phillips
a50ce3c983 Revert "Add BGR_10A2 support to Ganesh"
This reverts commit 44fc53b7f5.

Reason for revert: Test to see if this is causing the linux-rel MediaColorTest.Yuv420pHighBitDepth failure on the Chrome roll

Original change's description:
> Add BGR_10A2 support to Ganesh
> 
> Bug: 1068416
> Change-Id: I40aa84b7f3f770ba550b7bea44c10173ae9a7ddf
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285356
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: I0ad0197ebd8de9b8761f84ba808c9f90891b9238
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1068416
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285958
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-28 22:30:46 +00:00
Michael Ludwig
2becdde074 Refactor geometry union capabilities out of GrStyledShape
The geometry union part of GrStyledShape is now held in GrShape. For the
most part, GrShape is entirely style agnostic and focuses on storing
the various types of geometry, and destructing them gracefully. It also
provides a public API that unifies functionality across all shape types,
such as contains() and bounds().

GrStyledShape now just owns a GrShape and a GrStyle, and handles the
additional simplification logic that relies on knowing the effects of
the style on the draw. This is where GrShape makes some allowances for
style. Its simplify() function accepts flags that enable/disable various
simplification optimizations. Currently these are designed around
what is needed to respect path effects and stroking behaviors in
GrStyledShape. The main other user of GrShape (the new clip stack) will
always provide all flags since it treats every shape as if it were
simply filled.

Several other related refactorings were taken at the same time:
1. The implementations for asNestedRects, asRRect, etc. were moved out
   of the header and into the cpp file for GrStyledShape.
2. GrRenderTargetContext relies on GrStyledShape for its stroke rect
   fallbacks.
3. GrShape can hold points, lines, and rects explicitly. This let me
   simplify the stroke reasoning.

Change-Id: I9fe75613fee51c30b4049b2b5a422daf80a1a86e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284803
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2020-04-28 19:17:08 +00:00
Robert Phillips
44fc53b7f5 Add BGR_10A2 support to Ganesh
Bug: 1068416
Change-Id: I40aa84b7f3f770ba550b7bea44c10173ae9a7ddf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285356
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-28 17:07:57 +00:00
Jim Van Verth
9145f784f3 Implement D3D copySurface.
Also fixes a minor assert in GrD3DBuffer, and removes an unused dxgi format

Change-Id: I4aa533b5c514d573fc606622c28ea7e2181bd7cb
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285499
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-04-28 16:37:57 +00:00
Brian Osman
548de7451e Change Marker IDs to be strings
They are hashed to uint32_t at the API boundary (SkCanvas, SkVertices),
but making them functionally strings will make the SkSL interaction much
nicer.

Change-Id: I0979871bf3d21373812129eb7e994987b3030e00
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285664
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-04-28 14:12:30 +00:00
Mike Klein
5763b37ffb Revert "Reland "Add Abseil to third_party.""
This reverts commit 78debd6f6d.

Reason for revert: unexpectedly, Test-Mac10.13-Clang-MacBookPro11.5-CPU-AVX2-x86_64-Release-All-TSAN

Original change's description:
> Reland "Add Abseil to third_party."
>
> This is a reland of 816226e822
>
> Original change's description:
> > Add Abseil to third_party.
> >
> > At present, this is a proof-of-concept which only supports a small
> > subset of absl modules:
> > - Base
> > - Hash
> > - Numeric
> > - String
> >
> > This is only used by one unit test, which builds a string and then
> > hashes it.
> >
> > Bug: skia:10165
> > Bug: b/154848688
> >
> > Change-Id: I016250bf700b522c7a6bc78cf1844abff2260c35
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284805
> > Reviewed-by: Derek Sollenberger <djsollen@google.com>
> > Commit-Queue: John Stiles <johnstiles@google.com>
> > Auto-Submit: John Stiles <johnstiles@google.com>
>
> Bug: skia:10165, b/154848688
> Change-Id: I618bb4411445fe5b45a91741934ca888a09adf05
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285537
> Commit-Queue: John Stiles <johnstiles@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

TBR=djsollen@google.com,mtklein@google.com,johnstiles@google.com

Change-Id: I434da738bcc7fa76b46d0fa0fcbdd58c85b70fe7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10165, skia:10177, b/154848688
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285685
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-04-27 18:46:29 +00:00
John Stiles
78debd6f6d Reland "Add Abseil to third_party."
This is a reland of 816226e822

Original change's description:
> Add Abseil to third_party.
>
> At present, this is a proof-of-concept which only supports a small
> subset of absl modules:
> - Base
> - Hash
> - Numeric
> - String
>
> This is only used by one unit test, which builds a string and then
> hashes it.
>
> Bug: skia:10165
> Bug: b/154848688
>
> Change-Id: I016250bf700b522c7a6bc78cf1844abff2260c35
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284805
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>

Bug: skia:10165, b/154848688
Change-Id: I618bb4411445fe5b45a91741934ca888a09adf05
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285537
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-04-27 06:07:43 +00:00
Mike Klein
6d54e84dc5 Revert "Add Abseil to third_party."
This reverts commit 816226e822.

Reason for revert: 

https://chromium-swarm.appspot.com/task?id=4bc69ffc0a889110

/mnt/pd0/s/w/ir/clang_linux/bin/clang++ -rdynamic -Wl,-rpath,\$ORIGIN --target=armv7a-linux-gnueabihf --sysroot=/mnt/pd0/s/w/ir/armhf_sysroot -static-libstdc++ -static-libgcc -B/mnt/pd0/s/w/ir/armhf_sysroot/bin -B/mnt/pd0/s/w/ir/armhf_sysroot/gcc-cross -L/mnt/pd0/s/w/ir/armhf_sysroot/gcc-cross -L/mnt/pd0/s/w/ir/armhf_sysroot/lib -L/mnt/pd0/s/w/ir/chromebook_arm_gles/lib -Wl,--start-group @./dm.rsp  -Wl,--end-group -lpthread -ldl -lGLESv2 -lEGL -o ./dm
libabsl.a(libabsl.numbers.o): In function `absl::string_view::substr(unsigned int, unsigned int) const':
/mnt/pd0/s/w/ir/skia/third_party/externals/abseil-cpp/absl/strings/string_view.h:387: undefined reference to `absl::base_internal::ThrowStdOutOfRange(char const*)'
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)


Original change's description:
> Add Abseil to third_party.
> 
> At present, this is a proof-of-concept which only supports a small
> subset of absl modules:
> - Base
> - Hash
> - Numeric
> - String
> 
> This is only used by one unit test, which builds a string and then
> hashes it.
> 
> Bug: skia:10165
> Bug: b/154848688
> 
> Change-Id: I016250bf700b522c7a6bc78cf1844abff2260c35
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284805
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>

TBR=djsollen@google.com,johnstiles@google.com

Change-Id: If9936f1beaf6ac9c85718ce445e823bf2f57a6fa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10165, b/154848688
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285491
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-24 20:15:42 +00:00
John Stiles
816226e822 Add Abseil to third_party.
At present, this is a proof-of-concept which only supports a small
subset of absl modules:
- Base
- Hash
- Numeric
- String

This is only used by one unit test, which builds a string and then
hashes it.

Bug: skia:10165
Bug: b/154848688

Change-Id: I016250bf700b522c7a6bc78cf1844abff2260c35
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284805
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-04-24 19:53:21 +00:00
Leon Scroggins III
63cfb3638c Reland "Move SkFrontBufferedStream into Android-only dir"
This reverts commit b25f30348b.

Bug: skia:10154

Original message:
> Add client_utils for code that is specifically for a single client.
> Move SkFrontBufferedStream into its android/ subdir. Rename the class
> to android::skia::FrontBufferedStream. Temporarily leave in
> SkFrontBufferedStream until Android updates to the new API.
>
> Add a new optional target for client_utils/android. It is built in dev
> builds for testing, and when building for the Android framework.

Deliberately do not include client_utils in Google3, since the whole
point is to only include where necessary.

Change-Id: I48938c56aabb98e1ed820240d43ffcd0fdce7956
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285104
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-04-24 17:36:30 +00:00
Mike Klein
48c51bb51e test vcmpeqps with label offset
We're getting this wrong today, and likely also these several
other instructions.  We need to account for the immediate byte
that follows the ip-relative offset!

Add imm_byte_after_operand() to take care of this.

Change-Id: If0f4359b0a8e9d769bfde0d8456726e82f798123
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285237
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-24 13:22:45 +00:00
Leon Scroggins
565f17f29d Reland "Make SkBitmap/SkPixmap::erase* do so in sRGB"
This reverts commit 832c931d5b.

Reason for revert: To confirm whether it was blocking, and update
Chrome if necessary

Bug: skia:8663

Original change's description:
> Revert "Make SkBitmap/SkPixmap::erase* do so in sRGB"
>
> This reverts commit 6f44647e52.
>
> Reason for revert: checking to see if this is blocking the Chrome roll
>
> Original change's description:
> > Make SkBitmap/SkPixmap::erase* do so in sRGB
> >
> > We generally consider untagged colors to be sRGB, so this makes us more
> > consistent with other parts of the API.
> >
> > Add a test.
> >
> > Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
> > Change-Id: I5468c86ad92164797a65ffd9fbe471e01a97a2ca
> > Reviewed-on: https://skia-review.googlesource.com/c/179245
> > Commit-Queue: Leon Scroggins <scroggo@google.com>
> > Reviewed-by: Mike Reed <reed@google.com>
> > Reviewed-by: Mike Klein <mtklein@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
>
> TBR=djsollen@google.com,mtklein@google.com,scroggo@google.com,brianosman@google.com,reed@google.com
>
> Change-Id: Ia592adf2c790d294da1e32c1e83f9f34e81d79cc
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
> Reviewed-on: https://skia-review.googlesource.com/c/182083
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=djsollen@google.com,mtklein@google.com,robertphillips@google.com,scroggo@google.com,brianosman@google.com,reed@google.com

Cq-Include-Trybots: luci.chromium.try:linux-blink-rel;luci.chromium.try:android-kitkat-arm-rel;luci.chromium.try:android-marshmallow-arm64-rel;luci.chromium.try:linux-chromeos-rel;luci.chromium.try:linux_chromium_asan_rel_ng;luci.chromium.try:win7_chromium_rel_ng;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:mac_chromium_rel_ng;luci.chromium.try:linux_chromium_tsan_rel_ng;luci.chromium.try:linux_chromium_rel_ng;

Change-Id: I226fd5b6f298fad648b1d05c8a8e806eac874a46
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/182142
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2020-04-23 20:07:09 +00:00
Joe Gregorio
b25f30348b Revert "Move SkFrontBufferedStream into Android-only dir"
This reverts commit 513720f28e.

Reason for revert: Breaking the google3 roll:
   https://sponge.corp.google.com/invocation?tab=Build+Log&id=5f96970b-8171-4c2f-abf3-006e11b8fff9

Original change's description:
> Move SkFrontBufferedStream into Android-only dir
> 
> Bug: skia:10154
> 
> Add client_utils for code that is specifically for a single client.
> Move SkFrontBufferedStream into its android/ subdir. Rename the class
> to android::skia::FrontBufferedStream. Temporarily leave in
> SkFrontBufferedStream until Android updates to the new API.
> 
> Add a new optional target for client_utils/android. It is built in dev
> builds for testing, and when building for the Android framework.
> 
> Change-Id: Ie0f425051ea370aab7861d61150a3d6007214a93
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284721
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>

TBR=djsollen@google.com,scroggo@google.com,reed@google.com

Change-Id: Iaeedaed184cc35f507d5441631ae709e1c5cb1ac
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10154
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285100
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
2020-04-23 18:23:30 +00:00
Leon Scroggins III
513720f28e Move SkFrontBufferedStream into Android-only dir
Bug: skia:10154

Add client_utils for code that is specifically for a single client.
Move SkFrontBufferedStream into its android/ subdir. Rename the class
to android::skia::FrontBufferedStream. Temporarily leave in
SkFrontBufferedStream until Android updates to the new API.

Add a new optional target for client_utils/android. It is built in dev
builds for testing, and when building for the Android framework.

Change-Id: Ie0f425051ea370aab7861d61150a3d6007214a93
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284721
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2020-04-23 17:02:18 +00:00
John Stiles
57a996b4c5 Disallow empty interface blocks in SkSL.
The GLSL grammar appears to require at least one member-declaration in the member-list:
https://www.khronos.org/registry/OpenGL/specs/gl/GLSLangSpec.4.60.html#interface-blocks

Change-Id: Ic67469272b3d59e7b8764333899f204e95584778
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284418
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-04-21 20:36:54 +00:00
Brian Salomon
3b8486afd3 Reland "Notify RTC when OpsTask is closed so it can drop ownership"
This reverts commit 777f239a65.

Assigns observer in GrRenderTargetContext constructor.

Change-Id: Ie1d4a425eb959f7b822b5fc4988b2bb6ca2ed6a5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284733
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-04-21 19:59:45 +00:00
Brian Salomon
777f239a65 Revert "Notify RTC when OpsTask is closed so it can drop ownership"
This reverts commit 198393b2de.

Reason for revert: android crash

Original change's description:
> Notify RTC when OpsTask is closed so it can drop ownership
> 
> Change-Id: I95d32ed89447995541f33bf80730876ce9c0747a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284519
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: I5133fa1b8f90182864ffbee3b60bfd5781dc16bd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284728
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-04-21 16:38:21 +00:00
Brian Salomon
198393b2de Notify RTC when OpsTask is closed so it can drop ownership
Change-Id: I95d32ed89447995541f33bf80730876ce9c0747a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284519
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-04-21 15:38:54 +00:00
Michael Ludwig
76312fbf97 Add conservative round rect intersect function
Change-Id: I1012a4b6c6eb67e01923f767baeb78ebc18a0fd5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284477
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-04-20 22:53:16 +00:00
Mike Klein
21e85eb549 Reland "Reland "gather8/16 JIT support""
This is a reland of 1283d55f35

... this time, also checking for HSW feature set.

Original change's description:
> Reland "gather8/16 JIT support"
>
> This is a reland of 54659e51bc
>
> ... now expecting not to JIT when under ASAN/MSAN.
>
> Original change's description:
> > gather8/16 JIT support
> >
> > The basic strategy is one at a time, inserting 8- or 16-bit values
> > into an Xmm register, then expanding to 32-bit in a Ymm at the end
> > using vpmovzx{b,w}d instructions.
> >
> > Somewhat annoyingly we can only pull indices from an Xmm register,
> > so we grab the first four then shift down the top before the rest.
> >
> > Added a unit test to get coverage where the indices are reused and
> > not consumed directly by the gather instruction.  It's an important
> > case, needing to find another register for accum that can't just be
> > dst(), but there's no natural coverage of that anywhere.
> >
> > Change-Id: I8189ead2364060f10537a2f9364d63338a7e596f
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284311
> > Reviewed-by: Herb Derby <herb@google.com>
> > Commit-Queue: Mike Klein <mtklein@google.com>
>
> Change-Id: I67f441615b312b47e7a3182e85e0f787286d7717
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284472
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

Change-Id: Id0e53ab67f7a70fe42dccca1d9912b07ec11b54d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284504
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-20 20:25:06 +00:00
Mike Klein
7d5342d9ac Revert "Reland "gather8/16 JIT support""
This reverts commit 1283d55f35.

Reason for revert: one more try...

Original change's description:
> Reland "gather8/16 JIT support"
> 
> This is a reland of 54659e51bc
> 
> ... now expecting not to JIT when under ASAN/MSAN.
> 
> Original change's description:
> > gather8/16 JIT support
> >
> > The basic strategy is one at a time, inserting 8- or 16-bit values
> > into an Xmm register, then expanding to 32-bit in a Ymm at the end
> > using vpmovzx{b,w}d instructions.
> >
> > Somewhat annoyingly we can only pull indices from an Xmm register,
> > so we grab the first four then shift down the top before the rest.
> >
> > Added a unit test to get coverage where the indices are reused and
> > not consumed directly by the gather instruction.  It's an important
> > case, needing to find another register for accum that can't just be
> > dst(), but there's no natural coverage of that anywhere.
> >
> > Change-Id: I8189ead2364060f10537a2f9364d63338a7e596f
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284311
> > Reviewed-by: Herb Derby <herb@google.com>
> > Commit-Queue: Mike Klein <mtklein@google.com>
> 
> Change-Id: I67f441615b312b47e7a3182e85e0f787286d7717
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284472
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

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

Change-Id: I953fcd2aef308fd901880618fa540ac9f6d88e84
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284503
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-20 17:05:52 +00:00
Mike Klein
1283d55f35 Reland "gather8/16 JIT support"
This is a reland of 54659e51bc

... now expecting not to JIT when under ASAN/MSAN.

Original change's description:
> gather8/16 JIT support
>
> The basic strategy is one at a time, inserting 8- or 16-bit values
> into an Xmm register, then expanding to 32-bit in a Ymm at the end
> using vpmovzx{b,w}d instructions.
>
> Somewhat annoyingly we can only pull indices from an Xmm register,
> so we grab the first four then shift down the top before the rest.
>
> Added a unit test to get coverage where the indices are reused and
> not consumed directly by the gather instruction.  It's an important
> case, needing to find another register for accum that can't just be
> dst(), but there's no natural coverage of that anywhere.
>
> Change-Id: I8189ead2364060f10537a2f9364d63338a7e596f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284311
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

Change-Id: I67f441615b312b47e7a3182e85e0f787286d7717
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284472
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-20 16:47:04 +00:00
Mike Klein
86975cd168 Revert "gather8/16 JIT support"
This reverts commit 54659e51bc.

Reason for revert: ASAN

Original change's description:
> gather8/16 JIT support
> 
> The basic strategy is one at a time, inserting 8- or 16-bit values
> into an Xmm register, then expanding to 32-bit in a Ymm at the end
> using vpmovzx{b,w}d instructions.
> 
> Somewhat annoyingly we can only pull indices from an Xmm register,
> so we grab the first four then shift down the top before the rest.
> 
> Added a unit test to get coverage where the indices are reused and
> not consumed directly by the gather instruction.  It's an important
> case, needing to find another register for accum that can't just be
> dst(), but there's no natural coverage of that anywhere.
> 
> Change-Id: I8189ead2364060f10537a2f9364d63338a7e596f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284311
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

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

Change-Id: I912273e6ffc9258537ba806951a5964be0218d58
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284471
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-20 15:27:49 +00:00
Mike Klein
54659e51bc gather8/16 JIT support
The basic strategy is one at a time, inserting 8- or 16-bit values
into an Xmm register, then expanding to 32-bit in a Ymm at the end
using vpmovzx{b,w}d instructions.

Somewhat annoyingly we can only pull indices from an Xmm register,
so we grab the first four then shift down the top before the rest.

Added a unit test to get coverage where the indices are reused and
not consumed directly by the gather instruction.  It's an important
case, needing to find another register for accum that can't just be
dst(), but there's no natural coverage of that anywhere.

Change-Id: I8189ead2364060f10537a2f9364d63338a7e596f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284311
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-20 15:19:37 +00:00
Michael Ludwig
eaeb996253 Add inner bounds of round rect function
Change-Id: I6d48d4aebfffcf106ab22b511e43f76a4f8972c6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284276
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-04-20 13:58:10 +00:00
Brian Osman
449b1157a7 Plumb SkMatrixProvider throughout Ganesh
Renames the provider to SkMatrixProvider, which is now also able to
provide the local-to-device matrix. Everywhere that does paint
conversion and FP generation now has access to the entire matrix
provider, instead of just the CTM.

This will allow the SkSL FP (and others) to fetch other matrix state.

Change-Id: Iffb00bae0d438da0e8de3eebe75183ed6d440fd6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284040
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-04-20 13:48:40 +00:00
John Stiles
0ebc69c9ef Fix modulo-by-zero crash during SPIR-V conversion.
Array-stride calculation did not check for zero-sized objects before
performing a modulo. This would lead to undefined behavior (crash)
while attempting to build the AST.

Change-Id: I84b4662978955d49a3ca28f6bb577d15c87cccb6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284354
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-04-18 13:41:40 +00:00
Michael Ludwig
2686d69bf0 Reland "Rename GrShape to GrStyledShape"
This reverts commit 73b86c1ade.

Reason for revert: wasn't the problem, relanding

Original change's description:
> Revert "Rename GrShape to GrStyledShape"
> 
> This reverts commit f3f08af010.
> 
> Reason for revert: maybe this is breaking the ios perf bot; it is the first CL that caused the bot to fail, but I can't really say why this would break them.
> 
> Original change's description:
> > Rename GrShape to GrStyledShape
> > 
> > Change-Id: Ic457e634b4b95356f5615cff3fce1ca7d7677c26
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284036
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> 
> TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
> 
> # Not skipping CQ checks because original CL landed > 1 day ago.
> 
> Change-Id: I2e5adbfc820811fbbde9cb57af28f86a7ba40bd9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284231
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

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

Change-Id: Ifdd52f8bacb5d66a7bf58efd328675c4c443ac8a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284376
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-04-17 20:24:53 +00:00
Brian Salomon
b0aab2c7d1 Reland "Revert "Revert "GrDisplacementEffect uses GrTextureEffect."""
This is a reland of 16abfa5e42

Original change's description:
> Revert "Revert "GrDisplacementEffect uses GrTextureEffect.""
> 
> Also further limits the number of FP stages on ANGLE D3D9 to avoid
> varying limit.
> 
> This reverts commit 0b406736c1.
> 
> Bug: skia:10139
> 
> Change-Id: Ifda0b932ab8ce176f1a1cd1ca9c2deaf1fda20bd
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284048
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: skia:10139
Change-Id: I542506a87fadeeb54e2f749b199806d2155c6cab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284230
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-04-17 20:19:48 +00:00
Michael Ludwig
73b86c1ade Revert "Rename GrShape to GrStyledShape"
This reverts commit f3f08af010.

Reason for revert: maybe this is breaking the ios perf bot; it is the first CL that caused the bot to fail, but I can't really say why this would break them.

Original change's description:
> Rename GrShape to GrStyledShape
> 
> Change-Id: Ic457e634b4b95356f5615cff3fce1ca7d7677c26
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284036
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

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

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

Change-Id: I2e5adbfc820811fbbde9cb57af28f86a7ba40bd9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284231
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-04-17 19:38:34 +00:00
Mike Klein
b8e041e5f5 refactor arm instructions
Funnel the ARM instructions through two op() helpers, one for 3-arg
vector instructions, another for all others (0,1,2 arg, optional imm).

More consistent use of (immN & N_mask) to make things clearer.

Add missing imm12 offset to load and store instructions, with tests.
Notice they're in element counts, so we can go up to 4096 16-byte stack
entries, not 256 entries like you might think.

Change-Id: I99a3ad30b7b0926f93da671f00d89759934e65b4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284255
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-17 17:12:13 +00:00
Mike Klein
48e782486f set up stack frames on aarch64
Going to be easier to work on stack/register things if we
don't have to keep thinking of aarch64 as a special case.

This just sets up the frames, will follow up with JITMode::Stack.

Change-Id: Ic0df4c5deb9c7d55eb73a62e4b6b1c9919996974
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284243
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-17 16:44:53 +00:00
Stephen White
af564a5d0b Dawn: implement fences, callbacks and Finish (syncGpu) semantics.
Change-Id: I04e6c829fb122dc8b2192911bda94e5106927bff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275437
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2020-04-17 16:05:43 +00:00
Brian Salomon
f49debf07d Fix two GrProcessor names that are not valid idenitfiers
Change-Id: I123caca8649097316f52f6fb0aed2e6ed0d5090a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284256
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-04-17 15:08:12 +00:00
Kevin Lubick
1bf127479c Reland "Revert "GrDisplacementEffect uses GrTextureEffect.""
This reverts commit 16abfa5e42.

Reason for revert: Appears to have made ANGLE and ios unhappy

Original change's description:
> Revert "Revert "GrDisplacementEffect uses GrTextureEffect.""
> 
> Also further limits the number of FP stages on ANGLE D3D9 to avoid
> varying limit.
> 
> This reverts commit 0b406736c1.
> 
> Bug: skia:10139
> 
> Change-Id: Ifda0b932ab8ce176f1a1cd1ca9c2deaf1fda20bd
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284048
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: I0e4b135a59f713342bf5c6c258779975762ccd1f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10139
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284217
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2020-04-17 11:51:47 +00:00
Brian Salomon
16abfa5e42 Revert "Revert "GrDisplacementEffect uses GrTextureEffect.""
Also further limits the number of FP stages on ANGLE D3D9 to avoid
varying limit.

This reverts commit 0b406736c1.

Bug: skia:10139

Change-Id: Ifda0b932ab8ce176f1a1cd1ca9c2deaf1fda20bd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284048
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-04-17 00:07:38 +00:00
Mike Klein
c15c936c3e GP64 Operand conversion
Move all the non-vector instructions together,
and convert them to use Operand where possible.

In general that can be any of
   - (Operand, imm)
   - (Operand, GP64)
   - (GP64, Operand)
and that means there are two ways to encode (GP64,GP64)
instructions, so there's a disambiguator added.

Our measure of sucess is eliminating calls to rex()
except from our one helper, and so far, so good.

I haven't seen a need for Label Operands yet, and they're
only useful as (GP64, Operand) style arguments (can't
really be destinations in read-only memory) but we could
add support pretty easily if we find the need.

Tweak one test to avoid int/pointer ambiguity about 0.

Changed some of the instructions to always use a REX
prefix just to make it easier to funnel everything
through one place.  movzbl -> movzbq, etc.

Change-Id: I606f94e76e0ef8f491409f23748f5c8dcb607491
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284023
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-16 19:39:11 +00:00
Michael Ludwig
f3f08af010 Rename GrShape to GrStyledShape
Change-Id: Ic457e634b4b95356f5615cff3fce1ca7d7677c26
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284036
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-04-16 18:05:51 +00:00
Mike Klein
8390f2ead6 lots more refactoring
Rename YmmOperand to Operand, focusing on that side of things for
now.  And delete unused GP64Operand... might not need to return.

Big refactor around W and L bits and the helper op() functions.
Lots more is now funneled through a single core op() function.

Support Xmm and GP64 (direct moves) as Operands too.

As a rule of thumb I measured my progress by counting vex() calls.
Ideally we call it only in that centralized op().

I think I got as close as we can get, with only vgatherdps calling vex()
itself.  Given its weird encoding, there's no good way to work
vgatherdps into the abstraction.  It's close to Mem{base,0,index,scale},
but the index is a Ymm register, and there isn't any corresponding
special cases for it like there is normally for rsp in SIB.

Change-Id: I48e4583293e1df386a18d37ad54197016ce13251
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283806
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-04-16 16:55:32 +00:00
Mike Reed
56aa710832 separate m44 tests
Change-Id: I33db5286538cd5721ad0cf6095eef82c42ff1e35
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283916
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-16 10:53:37 +00:00
Mike Reed
938b4532b4 Revert "transition matrix44 to opt-in only"
This reverts commit 0f1f87d7bd.

Reason for revert: google3 and flutter also need the guard

Original change's description:
> transition matrix44 to opt-in only
> 
> In service of https://chromium-review.googlesource.com/c/chromium/src/+/2067862/
> 
> Change-Id: Ib6fd24c16c295fb4211dc295268af1e6f7f3fc45
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283661
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

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

Change-Id: I7c8cf2bc67aa267d442d0ca663e8378aa8feb409
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283896
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-16 10:01:29 +00:00
Mike Klein
edc2dacb3a convert load_store / stack_load_store to new style
This replaces most vmovups variants with two: load to register from
flexible operand, or store from register to flexible operand.

And upgrade the zero-extending loads too to finish off load_store().

More to come in small steps.

Change-Id: I80645f264ee91662260046c8e0a45ba6d1bf98c6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283753
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-15 22:54:46 +00:00
Michael Ludwig
9e1e913c81 Add rect subtraction utility function+tests
This operation came when updating aggregate inner and outer bounds
for Ganesh' new clip stack (particularly when accounting for the effect
of a difference operation). This geometric operation is theoretically
more general purpose so I moved it out to SkRectPriv.

Change-Id: Ibd76f9b95efc1790ecda1038779c124155031d8f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283756
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-04-15 21:44:36 +00:00
Mike Klein
9bb88673f5 start on operand refactoring
This introduces Mem, a way of expressing x86 addressing:

   addr = base reg + offset imm + (scale imm * index reg)

using the usual x86 convention of index = rsp to indicate no index.

And then, this introduces GP64Operand and YmmOperand, which are
generalizations like YmmOrLabel that fold over all the types of
arguments available at that position.  (YmmOperand replaces YmmOrLabel).

There's still much to do, but I've started by generalizing most
of the Ymm instructions to take YmmOperand, and added some new
unit tests for vmovdqa to make sure all the various modes work.

Change-Id: Ie6cc1186310ff39c52a2a061431a91d10816c98a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283344
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-15 20:41:09 +00:00
Mike Reed
0f1f87d7bd transition matrix44 to opt-in only
In service of https://chromium-review.googlesource.com/c/chromium/src/+/2067862/

Change-Id: Ib6fd24c16c295fb4211dc295268af1e6f7f3fc45
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283661
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-15 18:34:26 +00:00
Brian Salomon
63410e921c Pass description of GrSurface to GrSurfaceProxy lazy callbacks.
Also make GrDynamicAtlas directly use the GrSurface callback type rather
than go through a springboard.

Change-Id: I3e3c155bbc1e2e794e0d6828b0ea3c64c6a7f3e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283226
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-04-14 21:34:05 +00:00
Ethan Nicholas
5843012837 Add sample(child, matrix) to SkSL.
This allows fragment processors to sample their children with their
local coordinate system transformed by a matrix.

Change-Id: Ifa848bbd85b939bbc5751fec5cf8f89ee904bf39
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282590
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-04-14 16:07:34 +00:00
Mike Reed
1b84ef2b50 [skvm] approx_atan2
I propose landing this, but then pause on extending math functions until
we develop a clearer migration story for sksl.

Change-Id: Id42ec37071da058e6e7809abe1ed0570d48df8e7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283229
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-13 22:31:40 +00:00
Mike Klein
45d9cc86b3 remove i16x2 ops
These are neat but mostly just a distraction for now.
I've left all the assembly in place and unit tested
to make putting these back easy when we want to.

Change-Id: Id2bd05eca363baf9c4e31125ee79e722ded54cb7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283307
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-04-13 19:08:11 +00:00
Mike Klein
cb5110443f impl uniform16
One new instruction movzwl needed.

Change-Id: Ic70ba34d667eb6d570aeca88c4243e0c3309525f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283305
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-13 19:04:11 +00:00
Mike Klein
10fc1e66a9 skvm unit test cleanup
- let skvm tell us if FMAs are supported
  - unguard previously LLVM-only tests
  - simplify testing JIT and interpreter

We're getting close enough to always being able to JIT that carefully
marking what JITs and what doesn't is more annoying than helpful.
Now just test the JIT if present, and always test the interpreter.

Change-Id: I83762b38e0773ccaee795ae0fc9907e86628d73e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283275
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-04-13 18:48:01 +00:00
Robert Phillips
f3953d04a0 Non-substantive GrText-related changes
These are the dregs of the omnibus GrDrawOpAtlas CL

Change-Id: I0723346db293dd6650b905f661053955d2f46a1d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279908
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-13 18:10:29 +00:00
Greg Daniel
dabe38f611 Add submits after flushes in ProgramsTest.
This looks to be the culprit behind the failing/flaky metal bots. Not
sure what the direct cause is because it was different tests that were
failing and I would have thought we'd eventually submit at the end of
ProgramsTest when tearing things down. Maybe we just created such a
backlog of work submitted to the actual GPU that the GPU got put into
a bad state?

Bug: skia:10118
Change-Id: I318428e228e08fbcaaa12b23ad2869ecc35cc786
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283136
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-04-13 13:31:12 +00:00
Mike Reed
d468a1619a [skvm] approx_[asin,acos,atan]
Starting on atan2, but there is a lot of quadrant clean-up, so will
do that in a separate CL.

Change-Id: Ie1e70051a6ecb19a2e521b56ed09796e8e745276
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283016
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-13 12:17:02 +00:00
Greg Daniel
fe159621e6 Reland "Split apart flushing and submitting in the GrGpu classes and GrDrawingManager."
This reverts commit 2faa33772b.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Revert "Split apart flushing and submitting in the GrGpu classes and GrDrawingManager."
> 
> This reverts commit 6341d92280.
> 
> Reason for revert: metal tests failing
> 
> Original change's description:
> > Split apart flushing and submitting in the GrGpu classes and GrDrawingManager.
> > 
> > Bug: skia:10118
> > Change-Id: I53e3b9f1bd28a00276a3d35b5160aa0cfec30cfd
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282417
> > Reviewed-by: Jim Van Verth <jvanverth@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com,senorblanco@chromium.org
> 
> Change-Id: I2cb98b470e3a066c09012b686e9942edb5a3979b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10118
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282852
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

Bug: skia:10118
Change-Id: I9a77abe995a991275a87ee1d38bcab4deb361a9d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282976
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-04-10 19:29:17 +00:00
Mike Reed
801ba0d606 approx_tan for skvm
Change-Id: I22c120db2535929bd20df3068cca1aecc57ae746
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282744
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-10 17:09:17 +00:00
Greg Daniel
2faa33772b Revert "Split apart flushing and submitting in the GrGpu classes and GrDrawingManager."
This reverts commit 6341d92280.

Reason for revert: metal tests failing

Original change's description:
> Split apart flushing and submitting in the GrGpu classes and GrDrawingManager.
> 
> Bug: skia:10118
> Change-Id: I53e3b9f1bd28a00276a3d35b5160aa0cfec30cfd
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282417
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com,senorblanco@chromium.org

Change-Id: I2cb98b470e3a066c09012b686e9942edb5a3979b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10118
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282852
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-04-10 16:24:17 +00:00
Greg Daniel
6341d92280 Split apart flushing and submitting in the GrGpu classes and GrDrawingManager.
Bug: skia:10118
Change-Id: I53e3b9f1bd28a00276a3d35b5160aa0cfec30cfd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282417
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-04-10 15:48:48 +00:00
Greg Daniel
58b5a54707 More robust fix for command buffer context crash.
There apparently were other tests that had similar issues and this fix
is much better and is more future proof.

Change-Id: I4835c7e5772b9e70249a69255aae8808be172eef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282681
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-04-09 19:28:06 +00:00
Greg Daniel
34bd2c3ccb Fix PinnedImageTest to make current original context at end.
Change-Id: I6f47bb8aa9d743925ea98d2614058137914e0531
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282637
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-04-09 18:07:06 +00:00
Mike Reed
7fe6ee30c4 Add markCTM(id) api, to replace functionality of saveCamera.
Will need followups on Vertices and SkSL to use these handles.

Change-Id: If775cb01168f601541e889bfa2421129e505b4a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282416
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-04-09 17:07:36 +00:00
Mike Klein
210288fdcd add SkVM_min_max unit test
Tests min() / max() float behavior fairly exhaustively.

We sometimes specialize into min_f32_imm and max_f32_imm, so it's
important to test with constant values as each argument to cover that
specialization, and to test with both as non-constant values to cover
when that specialization does not apply.

Change-Id: Ib021fd5a6d322058af2f504048b9ed02d0510732
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282315
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-04-08 19:05:36 +00:00
Mike Klein
5e9f0ee13f add and test stack load/store
Change-Id: Ie0d29e31bd8c156ecd46cd658b5a4c53d8d2e11d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282115
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-07 21:15:47 +00:00
Chris Dalton
03fdf6a9a9 Implement support for indirect draws
Change-Id: Ib1c0570d747bf9f46be3486f37eba3af53ed1e3d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281642
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2020-04-07 19:41:18 +00:00
Mike Reed
82ff25e02c approximate sine for skvm
Change-Id: I90f12cb305ff8daf64b07e5f47bb3a158df95bee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282120
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-04-07 18:32:17 +00:00
Julia Lavrova
cd2d4e4835 Mixed languages text crashes
Extending text to grapheme edges should correct glyph range
Bug: skia:10087
Change-Id: I254901aaaa40c2782d1afbd5d5390599bdd7c922

Change-Id: I1d51076656d09e4d2e35e3ddad28bfd60fc87081
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281756
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-04-07 17:43:57 +00:00
Chris Dalton
a77cdee048 Reland "Rename instanceAttribSupport -> drawInstancedSupport"
This is a reland of 17f05c737e

Original change's description:
> Rename instanceAttribSupport -> drawInstancedSupport
>
> Change-Id: I7d8ff8597849f2b910928867842857e25a12b4b1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281582
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com

Change-Id: I2e15ac72d86747c30e71bb50d30da48a5a342772
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282118
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-04-07 16:54:37 +00:00
Robert Phillips
e19babf996 Remove GrAtlasManager.h from all other .h files
Having GrAtlasManager.h in GrContextPriv.h was needlessly propagating dependence on that header.

Change-Id: Idf5836f1e217ecd2da91f751b488a63a884c02ce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281739
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-04-07 12:43:46 +00:00
Chris Dalton
31c028c54b Revert "Rename instanceAttribSupport -> drawInstancedSupport"
This reverts commit 17f05c737e.

Reason for revert: chrome

Original change's description:
> Rename instanceAttribSupport -> drawInstancedSupport
> 
> Change-Id: I7d8ff8597849f2b910928867842857e25a12b4b1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281582
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I2b28e3066f27b9d63713f93c0b44d7ba92fcdba9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281868
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-04-06 22:22:37 +00:00
Ethan Nicholas
16464c3232 Tracking uniform ownership
This is a prerequisite change for the upcoming sample(child, matrix)
function. By itself, this CL doesn't really change anything; it just
adds an ownership tracking feature which sample(child, matrix) depends
on.

Change-Id: I98b12e5fb062a2535af367931e7a932ea9c63a59
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281337
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-04-06 19:02:37 +00:00
Chris Dalton
17f05c737e Rename instanceAttribSupport -> drawInstancedSupport
Change-Id: I7d8ff8597849f2b910928867842857e25a12b4b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281582
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-04-06 18:53:57 +00:00
Mike Reed
3ef77ddf9e clean up public m44 and camera api
saveCamera() is no longer experimental

In a separate CL, will stage changes to concat virtual to take M44.

Change-Id: Iaf37ce2f24ab1223c54aeb1e79eaebf18f87fece
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281589
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-06 15:34:17 +00:00
Robert Phillips
6d3bc2951d Consolidate the conversion of plot location to uvs to be w/in GrDrawOpAtlas
Bug: 1056730
Change-Id: Icb3e8e32585d1abc38205e1baf86b5a5291c8d8a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281196
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-06 15:26:47 +00:00
Mike Klein
4067a9429a the return of bit_clear
bit_clear is at least useful as a special case for select(),
which helps with code readability.

Add is_NaN() and use these all together in sweep gradient.

Change-Id: I57a54f8956f85e0db0662b33f8446b8dc7342d8d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281685
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-05 16:44:16 +00:00
Mike Klein
aa68109a59 special-case overhaul
- new this-> convention: never use it when calling common public
    Builder methods like splat(), bit_and(), etc like you'd see in
    normal user code, but always use it when calling private methods
    like this->push(), this->isImm(), this->allImm().

  - use c++17 if-statements to scope this->allImm() variables tighter.

  - check for x.id == y.id cases where applicable, including a tweak
    to min() and max() to make them able to hit the special case.

  - add special cases for I32 +,-,*, and remove an old unimportant
    unit test that assumed we didn't fold these.

  - add special cases for select(), and use select() in a few more
    places where it's clearer and now just as efficient.

Change-Id: Idaac9250ac5a95a48d33eeba1cc4380c8c91629d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281678
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-05 15:41:36 +00:00
Chris Dalton
d4dec974e3 Add an option to GrMeshTest to save to png
Change-Id: Ie877e995642fe6be48b7e242aa955e87ecc14fb0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281385
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-04-03 18:18:04 +00:00
Mike Klein
cca2acfb77 remove little-used bit_clear() and bytes()
bit_clear() is just another bit_and(),
and bytes() is a way of expression pshufb
that we never really use (yet).

Can always add them back later, but there's
some extra complexity to think about for each
that I'd like to not think about now:

  - common sub-expression elimination between bit_and and bit_clear
  - large constant management JIT'ing bytes

Change-Id: I3a54afa963231fec1d5de949acc647e3430ed0d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281557
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-03 18:16:54 +00:00
Brian Osman
b08cc024cd Switch back to stack-based SkSL interpreter
It's slower, but code size is quite a bit smaller, memory usage is
smaller, and we think that mapping it to SkVM is just as easy.

This effectively reverts all of the following commits:

"Fix gcc9 warning around size of memset."
https://skia-review.googlesource.com/c/skia/+/279861

"Remove unused (and misleading) 'instruction' from SkSLInterpreter.h"
https://skia-review.googlesource.com/c/skia/+/278177

"Interpreter: Fix intrinsics when called with vector types"
https://skia-review.googlesource.com/c/skia/+/272721

"Make it easier to add vector versions of byte code instructions"
https://skia-review.googlesource.com/c/skia/+/272527

"Interpreter: Support returns from runStriped"
https://skia-review.googlesource.com/c/skia/+/268941

"add SkSLInterpreter vector instructions"
https://skia-review.googlesource.com/c/skia/+/266560

"Fix crash when editing particle scripts"
https://skia-review.googlesource.com/c/skia/+/269487

"Revert "Revert "Complete rewrite of the SkSL interpreter"""
https://skia-review.googlesource.com/c/skia/+/266205

Change-Id: I4258596399c4ca94489d4faf8aacfec88afeee13
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281205
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-04-03 17:20:04 +00:00
Brian Salomon
c524378621 Don't require color type to make proxy copies.
Bug: skia:10078

Change-Id: I3ce0d97f8ada55403cc3f88bb16659085449ea29
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281207
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-04-03 15:25:34 +00:00
Mike Klein
5b701e127c pass around programs by value
It's clearer to see the flow of data this way and to read each pass'
implementation without all the pointer indirection, and move semantics
should let this be just as efficient.

Change-Id: I1ac211fbe54bec37de6d126eec0c211573c2a568
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281218
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-02 16:44:06 +00:00
Mike Klein
b7d87903df pull out schedule, finalize
This finishes up the main refactoring.
Still some follow-ups I want to try.

I got tired of typing usage.users(id) so I converted that to operator[],
which I think is clear for now.  If we add more methods that don't refer
to the users, we can undo?

Change-Id: I0ac563cfb1899f7a3f8b2cb6d50ca1646dd05071
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281216
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-02 16:37:29 +00:00
Brian Salomon
8afde5f395 Rename outputView->writeView and outputSwizzle->writeSwizzle
Change-Id: Ib09550201bc1556e04555fc7dc9408ab469684a0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280964
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-04-02 15:06:16 +00:00
Brian Salomon
c3ce54a8a7 Remove color type from promise image proxy callback.
The color type used to influence the GrPixelConfig and the swizzles
used with the proxy and its GrTextures. So we had to create a new proxy
if the same API texture was used to fulfill a promise image of a
different color type. That has all been removed or lifted out of proxies
and into views. So now it is fine to reuse the same proxy/GrTexture with
a different color type.

Also remove unit test that checked required a new GrTexture be made if
a different color type was used.

Bug: skia:10078

Change-Id: Ib74c419b5d54d382ea95720af7026640e35013f0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281056
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-04-02 14:59:18 +00:00
Mike Klein
7542ab5e5b reframe liveness_analysis as eliminate_dead_code
Seems nicer to keep encapsulated in a program->program pass
so nothing upstream of it has to think about liveness.

I will be circling back around to profiling the cost of these
tempoaries, copies, etc.  I just want to start writing them as
if cost were no object first.

Change-Id: I1d1187b521fbe963e720e0d8de90316a549f7797
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281182
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-02 14:44:36 +00:00
Brian Osman
46aacc7710 Fix SkVertices serialization bug. Also remove Builder getters for counts.
We already checked the SkSafeRange earlier (after its last use). Here we
need to be checking the SkSafeMath object. Oops.

The counts are directly copied from the constructor to the vertices'
fields - the user already knows what they are (and the tests are
verifying a tautology).

Bug: skia:9984
Change-Id: I33c62e02825718e497834b0dfa40d0d56e46a197
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280963
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-04-02 00:28:36 +00:00
Brian Osman
ffd11f4ab3 Adding attribute types to SkVertices
Adds structure to the per-vertex (now custom) data.
Attributes currently just have a type, but the next
step is to augment that with semantic flags to handle
transformation logic in the vertex shader.

Added unit tests and GMs that exercise attributes of
varying float counts, as well as normalized bytes.

Bug: skia:9984
Change-Id: I02402d40b66a6e15b39f71125004efb98bc06295
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280338
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-04-01 23:23:26 +00:00
Ethan Nicholas
7c75226854 Renamed the various 'stage' shader functions to have the actual effect name
This is purely to make debugging easier, as the shaders now make more sense
to read.

Change-Id: Ie8e9b9d36112fda3ff997d088955de5a0e2c787a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281017
Auto-Submit: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-04-01 19:07:04 +00:00
Mike Klein
4f90a8e399 Uses refactoring
Instead of copying fIndex and marching it forward,
we can tick down our existing uses counts backward,
saving one temporary std::vector.

Our implementation does guarantee the Instructions
returned by users() are sorted, so let's lean into
that... that means we can find the death time of any
instruction simply by looking at users().back()
(if there are any, of course).

Everything else is names and formatting, the biggest
being renaming Uses -> Usage.  There's enough mention
of "users" and "uses" contrasting with each other that
I think it makes sense for the type to have the nice
middle-ground neutral name Usage, reflecting the arrow
and not which way we're thinking about it pointing.

Change-Id: I32ea9af6eb6430a162bee6da4810a599e8ed0dfd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281003
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-04-01 18:18:13 +00:00
Brian Salomon
982f546cc1 Rename outputSwizzle->writeSwizzle.
It is also used for writes to surfaces other than fragment shader
output. e.g. clears.

Change-Id: Id1eb79be6d1a8aed936456bffa59dee32661cec8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280344
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-03-31 21:50:38 +00:00
Brian Salomon
8a78e9cdc3 Don't require color type to wrap a texture/RT.
Change-Id: Ic6c0de262e13c3c3ea9e7777ccdd04f22ff6ae0a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280345
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2020-03-31 19:18:39 +00:00
Herb Derby
f20400e2a1 Introduce Liveness and Uses into existing scheduler
Liveness tracks all the live instructions in the instruction stream.
Uses maps this value to instructions that use it.

Uses is overkill for the current schedule, but will be needed for
spilling.

Change-Id: Id20b7b7a90901e156d323bb612c5908f91405967
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277744
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-03-31 17:53:07 +00:00
Brian Osman
8cbedf9855 Improve SkVerticesPriv ergonomics
Rather than two separate (partially overlapping) ways of accessing the
private portions of SkVertices, use a single privileged helper class
(similar to GrContextPriv).

Change-Id: I76b14b63088658ed8726719cce126577e5a52078
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280601
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-03-31 16:10:07 +00:00
Brian Salomon
469046c096 Revert "Revert "Remove GrCaps::isFormatTexturableAndUploadable""
This reverts commit 8176508cc6.

Replaces incorrect check for Read pixels support with Write check.

Change-Id: Idc80aaaa41ba35014339df450bb8b583fb6dab51
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280399
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-03-31 13:41:27 +00:00
Ben Wagner
14ba58ff01 Add GrTAllocator::push_back(T&&)
Allow push_back to take an rvalue to move into the allocator, which has
the nice side effect of making the test for it a bit better.

Change-Id: I7e313cf75c1ad65fbf765b10c4717672063b5570
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280412
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-03-30 22:37:25 +00:00
Mike Reed
853c15cdaa remove unused SkLightingShader
Change-Id: I60a3569b47b599b710c0f3a9522241748f15360d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280409
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-03-30 20:55:34 +00:00
Brian Osman
01e6d17fe8 Stop including SkCanvas.h from GrTypesPriv.h
It was too easy to get into circular include chains. Added static
asserts to ensure we keep our quad AA flags in sync. Also, IWYU.

Change-Id: I01aefa264aa56420ab5a46a8ecd9e63c021c79ab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280405
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-03-30 20:43:34 +00:00
Brian Salomon
8176508cc6 Revert "Remove GrCaps::isFormatTexturableAndUploadable"
This reverts commit c18dad25e4.

Reason for revert: Revealed thread safety issue in GrGLCaps, picked up by viz_unittests/TSAN.

Original change's description:
> Remove GrCaps::isFormatTexturableAndUploadable
> 
> Instead separately check texturability and uploadability using existing
> queries.
> 
> Also remove unused renderable param from onGetDefaultBackendFormat()
> 
> Change-Id: I8751e6d62263ddabd713c850beb788620a78bf10
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279996
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: I8cd90fb35091009e51f283db1ee55df6088a8fe1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280398
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-03-30 18:16:34 +00:00
Brian Salomon
c18dad25e4 Remove GrCaps::isFormatTexturableAndUploadable
Instead separately check texturability and uploadability using existing
queries.

Also remove unused renderable param from onGetDefaultBackendFormat()

Change-Id: I8751e6d62263ddabd713c850beb788620a78bf10
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279996
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-03-30 14:20:40 +00:00
Ben Wagner
7363af8c51 Fix gcc 9 warnings.
GCC 9 warns about this pessimizing-move. It isn't clear why clang isn't
as well.

GCC 9 has a working redundant-move diagnostic. Clang has an old (C++11
style) redundant-move diagnostic which only warns when moving a
parameter. The GCC warning conflicts with Clang's
return-std-move-in-c++11, which we want to keep until we can drop
support for older compilers. So just disable redundant-move warnings
until we can remove return-std-move-in-c++11.

This change allows us to compile without warnings on gcc 9.3.0.

Change-Id: If21fcfb2944ce49e27fc84d40805752895ae68cf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279958
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-03-27 23:00:54 +00:00
Brian Salomon
2f23ae6b8e Rename SkColorTypeComponentFlags to SkColorChannelFlags.
Precusor step for making this public and adding a method to
GrBackendFormat to query its channels.

Bug: skia:10078
Change-Id: I2d8fa6586721c35961bc328a15eef8e2ebd4406e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279422
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-03-27 21:48:41 +00:00
Chris Dalton
07e5b8f0ed Rename TessellatingPathRendererTests.cpp -> "Triangulating"
Change-Id: Ie0525d71bb8cc15da2ebe61821c92e213f8dd3c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279896
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-03-27 19:42:03 +00:00
Brian Salomon
df1bd6dd0a Remove texture swizzle from GrSurfaceProxy.
Bug: skia:9556


Change-Id: I2c450c51e1a0987aacebdfcf32ef76cd31f0e80b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279656
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-03-27 17:01:07 +00:00
Brian Osman
9a3ee1913a Remove arbitrary limit on number of composed color filters
This effectively reverts https://codereview.chromium.org/972153010/

Note that we have no such hard limit on SkShaders, and it's never
been a problem. Complex SkPaint objects can generate too many FPs
for us to handle, but those are rare, and better managed by just
reporting the shader compile error (which we do).

Change-Id: Iee5dc3d65ec130f2ce0a29e55fbe3c25b00dc828
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279836
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-03-27 15:01:32 +00:00
Jim Van Verth
6ec5688413 Rename GrD3DTextureInfo to GrD3DTextureResourceInfo.
Also renames GrD3DSurfaceResource to GrD3DTextureResource. This makes
things consistent with our naming convention in Vulkan, and with the
terminology used in Direct3D.

Bug: skia:9935
Change-Id: I6e6d2066ac70eb8a0d63c1b5731f31851a3017d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279338
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-03-26 16:26:44 +00:00
Chris Dalton
17dc41870a Rename CPU tessellation to "triangulation"
Ambiguity has come up re: what "tessellation" means in Ganesh. I
believe that, in the context of a graphics library, "tessellation"
should refer to the hardware pipeline feature of submitting patches
and tessellating them on the GPU. This CL therefore renames classes
that triangulate things on the CPU to call it "triangulation".

Change-Id: Ic8515ea6a33000f1b638a852d5122bc9bd6b38f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279236
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-03-26 16:21:39 +00:00
Michael Ludwig
4519134e07 Implement GrTAllocator in terms of GrBlockAllocator
Previously, the GrAllocator header defined three types: GrAllocator,
GrTAllocator, and GrSTAllocator. GrAllocator was generic, and would
manage the blocks of memory (fixed size to hold N * sizeof(item)). It
stored an SkTArray of pointers to each block. GrTAllocator wrapped
the GrAllocator to add template support for a specific T. GrSTAllocator
extended GrTAllocator to include a template arg for inline storage.

In this CL, GrAllocator is no longer defined, and its memory functionality
is replaced with the use of GrBlockAllocator. For the most part, the
implementation of GrTAllocator on top of GrBlockAllocator remains the
same, although there is explicit array to the block pointers so indexing
is slightly different. GrSTAllocator is also removed entirely, so that
GrTAllocator's template includes initial storage size.

The iteration over the allocated items
is updated to wrap GrBlockAllocator's block iterator, and then iterate
by index within each block. Documentation on GrAllocator already recommended
using the iterator instead of random access, and these changes further
reinforce it. It turns out that many of the use cases of GrAllocator
were written to use random access, so many of the files outside of
GrAllocator.h have just been updated to use the new for-range iteration
instead of a random access for loop.


Change-Id: I28b0bc277c323fd7035d4a8442ae67f058b2b64c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272058
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2020-03-24 18:00:33 +00:00
Dominic Mazzoni
c227f4a826 Add support for tagging link annotations in PDFs.
Properly tagging links in PDFs just required a small change: at the time
an annotation is drawn, we need to keep track of the bounding rect, the
url and/or named destination, and now additionally the node ID. Instead
of keeping track of separate maps of rects/urls and rects/dests, this
patch combines them into a vector of SkPDFLinks.

Then, at the time the annotation is written to the file, an object
reference to that annotation can be saved and passed to the document
structure tree, where it can be included as an additional child of
the node with that node ID.

That allows for properly tagging the link and optionally giving it alt
text (like for an image link).

Bug: chromium:1039816
Change-Id: I97e47d3c70949020c3e0a69b8c9fc743748f3a7b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277426
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-03-24 15:52:55 +00:00
Mike Reed
bcb46c06c7 Add approx_pow/log2/pow2 to SkVM builder
... in support of programs for colorspacexforms

Change-Id: I72ace09f10511ef8994038a4af3feab8bc1a299e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278466
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-03-23 22:17:04 +00:00
Mike Reed
f5ff4c25a0 add loadF() and storeF() helpers to Builder
Change-Id: I5fe1ca090868cfb9fa930753232e9cbb42737d9a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278473
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-03-23 19:25:43 +00:00
Robert Phillips
709e2408fe Revert "Make TessellationTestOp and GrPipelineDynamicStateTestOp surface their programInfos at record time"
This reverts commit bc0fe058f8.

Reason for revert: red

Original change's description:
> Make TessellationTestOp and GrPipelineDynamicStateTestOp surface their programInfos at record time
> 
> These aren't high priority but it would be nice to have all the ops go through the same system.
> 
> Bug: skia:9455
> Change-Id: Idbd8b0829faf12703c82f5a016f5b0e7c3efb762
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277757
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=egdaniel@google.com,robertphillips@google.com

Change-Id: I579ad16f144d17afaec9ee1b9000eaaa5c04228c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9455
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278508
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-03-23 18:29:33 +00:00
Robert Phillips
bc0fe058f8 Make TessellationTestOp and GrPipelineDynamicStateTestOp surface their programInfos at record time
These aren't high priority but it would be nice to have all the ops go through the same system.

Bug: skia:9455
Change-Id: Idbd8b0829faf12703c82f5a016f5b0e7c3efb762
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277757
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-03-23 17:39:23 +00:00
Brian Salomon
f4ba4ec796 Revert "Revert "Revert "Revert "Don't build GL on Metal, Vulkan, Dawn, Direct3D bots""""
Updated to use sentinel GL context even when GL backend is not built.

This reverts commit 1171d314ef.

Change-Id: Ia94bbe4865ddd4e898446c13886877c539f0eb0b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277976
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-03-20 17:11:58 +00:00
Brian Salomon
1171d314ef Revert "Revert "Revert "Don't build GL on Metal, Vulkan, Dawn, Direct3D bots"""
This reverts commit fb27c9a25f.

Revert "Remove MoltenVK support"

Reason: TSAN Vulkan bots hanging.

This reverts commit 6cafe73da9.

Change-Id: I8ec9db35c112f3c8da8636dab2065e6f18de7d0b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277936
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-03-19 13:10:59 +00:00
Brian Salomon
fb27c9a25f Revert "Revert "Don't build GL on Metal, Vulkan, Dawn, Direct3D bots""
This reverts commit 00ba5ef4a6.

Bug: skia:10051

Change-Id: I13fd5494b7e7e64159e6330f168ab8c16a2db149
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277609
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-03-18 18:12:11 +00:00
Robert Phillips
c655c3aa8b Make GrOp::onPrePrepare be pure virtual
This makes onPrePrepare match onPrepare & onExecute. Most of the new method bodies will-have-to/should be filled in anyway.

Change-Id: Ifc897feaeb2d8fe6eec3ac3a8e91f99393ad6758
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277542
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-03-18 18:06:02 +00:00
Brian Salomon
bc074a68df Add SkBudgeted parameter to SkImage::makeTextureImage().
Also strengthens/adds some guarantees about this function:
* Always returns the same image if the original is texture-backed and
compatible with GrMipMapped (WRT HW MIP support)
* If a new texture backed image is returned it is always an uncached
texture that is not shared with another image or owned by an image
generator.

Adds a GrImageTexGenPolicy that allows control through image/bitmap
GrTextureProducers of whether a new texture must be made and whether
that texture should be budgeted or not.

Increases unit test coverage of this API.

Bug: skia:8669

Change-Id: Ifc0681856114a08fc8cfc57ca83d22efb1c1f166
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274938
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-03-18 17:27:41 +00:00
Chris Dalton
304e14d883 Remove FixedDynamicState from GrProgramInfo and GrPipeline
Everybody uses explicit binding now.

Change-Id: Idb6f64104eddd31d28dd2ba19f9743520a4e5170
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277541
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-03-17 23:09:08 +00:00
Chris Dalton
3bf2f3a9da Remove DynamicStateArrays from GrProgramInfo and GrPipeline
Every op that updates dynamic state between draws has now been
migrated to explicit binding.

Change-Id: Ibd13c9c0ffb16a205c073dfb4fd21d93f496dc52
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277493
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-03-17 19:12:18 +00:00
Chris Dalton
be45742933 Change GrProgramInfo::visitProxies to "visitFPProxies"
We are removing dynamic state from the ProgramInfo, so the Ops will
need to invoke visits on their own primProc proxies.

Change-Id: I7ab227ab71208b7c7bcb7a9deb56b9abd556d6aa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277236
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-03-17 15:06:55 +00:00
Chris Dalton
765ed36ad4 Delete GrOpsRenderPass::drawMeshes
Everyone is responsible to set up their own scissor and textures now.

Change-Id: Ic3547f00c0e7908409631951de4b7237b9bce23b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277177
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-03-17 15:05:54 +00:00
Michael Ludwig
cd01979004 Refactor GrMemoryPool into reusable GrBlockAllocator
This moves the byte block linked list structure outside of GrMemoryPool
into a new type, GrBlockAllocator. This new type is solely responsible
for managing the byte blocks, tracking where the next allocation
occurs, and creating/destroying the byte blocks. It also tries to
encapsulate all of/most alignment related math, while making it
convenient for clients to add per-allocation padding/metadata.

It has added functionality compared to the original block linked list
that was embedded in GrMemoryPool:
 - Supports resetting the entire allocator
 - Supports resizing the last allocation
 - Is able to rewind an entire stack of allocations, instead of just the
   last allocation.
 - Supports multiple block growth policies instead of just a fixed size.
 - Supports templated alignment, and variable alignment within a single
   GrBlockAllocator
 - Query the amount of available memory
 - Performs as much math as possible in 32-bit ints with static asserts
   that ensure overflow won't happen.

Some of this flexibility was added so that the GrBlockAllocator can be
used to implement an arena allocator similar to SkArenaAlloc, or to
replace the use of SkTArray in GrQuadBuffer. It is also likely possible
that GrAllocator can be written on top of GrBlockAllocator. I will try
to perform these consolidations in later CLs.

Change-Id: Ia6c8709642369b66b88eb1bc46264fb2aa9b62ab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262216
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-03-17 14:41:14 +00:00
Mike Klein
6b48e62ed2 remove unused mutate() apis
Whether we should shrink at the end of mutate() turns out to be moot.

:)

Change-Id: Ic29df5734e3057f165f695b2d03f8e7eb0eeb4dd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277299
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-03-16 20:44:36 +00:00
Herb Derby
3b946c1618 Check fullness and purge on every strike lookup
In the old code, the cache was checked and perged on every reattach
of a strike. That was left out of the multi-threaded code. Add the
check and purge back in to maintain cache size.

* Removed minimum cache size from setCacheSizeLimit.

Bug: skia:10046
Change-Id: I2438c83f04b6da8133c161a29604c3c3d7f58cd8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277066
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-03-16 19:59:56 +00:00
Mike Klein
a30aeae875 impl SkTDynamicHash with SkTHashTable
The only vaguely tricky thing to adapt from templating on T to T*.

Don't think there's a need for the unit tests now right?

Bug: skia:9703
Change-Id: Ib8fcebd9e0e35bea5ef23e6fd5962654a28d587b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277214
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-03-16 19:59:26 +00:00
Chris Dalton
aa0e45c232 Add pass-through helper methods from GrOpFlushState to GrOpsRenderPass
Change-Id: Ifa18e909978367a4502dbf6b35a62a437e83b5c2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276842
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-03-16 19:53:26 +00:00
Chris Dalton
eb694b767c Rename GrMesh to GrSimpleMesh
Change-Id: Ib164ff3ec41cb798385f2feea8ad09c037dbc30d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276837
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-03-16 16:18:30 +00:00
Chris Dalton
37c7bdda22 Remove GrMesh::setVertexData
Fuses the relevant functionality into the set() calls.

Change-Id: I3a764219425c35967942366c60a6b9ee6ec48e11
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276836
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-03-16 14:32:50 +00:00
Mike Klein
cff6396875 begin refactoring SkTDynamicHash and SkTMultiMap
The biggest mismatch between these and SkTHash{Map,Set,Table}
is the old ones provide Iter and ConstIter, the new ones foreach().

This CL,

   - adds foreach() methods to the old types,
   - replaces all uses of ConstIter with foreach(),
   - replaces most uses of Iter with foreach(),

I'm leaving one spot using Iter to walk the table and remove its
elements for its own CL... it'll be a little more complicated to get
that right.

From there it should be straightforward to turn SkTDynamicHash
into a thin wrapper over an SkTHashTable.

Bugs: skia:9703
Change-Id: Ia6ba87c35b89585c42b5b9f118f4cbf3abd04f0d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277098
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-03-16 14:06:30 +00:00
Mike Klein
16701eecd5 Shrink SkTHashTables
Since we grow when size >= 3/4 cap, shrink when size <= 1/4 cap?

Keeping a minimum table size of 4 preserves the invariant that tables
with non-zero capacity always have at least one empty slot, allowing
find() to determine a particular key is not in the table by stumbling
upon that empty slot on the key's hash chain.  That's effectively what
we're asserting at SkTHash.h:84.

Bug: skia:10041
Change-Id: I4247e4ff155fd11561086547525354365bc69f55
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277096
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-03-16 13:38:10 +00:00
Florin Malita
e05b1b7229 [svgdevice] Handle text path effects
(follow-up to https://skia-review.googlesource.com/c/skia/+/276576)

Force drawing of text as path in the presence of path effects.

Additionally, ensure that all glyph runs are rendered as a single path
(instead of one path per run).

Change-Id: Ibc69b0f93ff09af349f3376f79ed3fce18151a14
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276956
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2020-03-13 16:19:06 +00:00
Bryce Thomas
75e29072e7 Implement support for path effects in SkSVGDevice backend.
Bug: NONE
Change-Id: I1559d05a0c126b1c7aa72296f2fdd8f6c93fb46b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276576
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2020-03-13 13:20:05 +00:00
Mike Reed
ba96256581 hide getters so we can change the internals of SkVertices
Bug: skia:9984
Change-Id: Id8d8d568fb29b006d19079248c579282207279c1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275692
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-03-13 12:08:12 +00:00
Mike Klein
5caf7dee25 restore Op::round
While I think trunc(mad(x, scale, 0.5)) is fine for doing our float
to fixed point conversions, round(mul(x, scale)) was kind of better
all around:

   - better rounding than +0.5 and trunc
   - faster when mad() is not an fma
   - often now no need to use the constant 0.5f or have it in a register
   - allows the mul() in to_unorm to use mul_f32_imm

Those last two points are key... this actually frees up 2 registers in
the x86 JIT when using to_unorm().

So I think maybe we can resurrect round and still guarantee our desired
intra-machine stability by committing to using instructions that follow
the current rounding mode, which is what [v]cvtps2dq inextricably uses.

Left some notes on the ARM impl... we're rounding to nearest even there,
which is probably the current mode anyway, but to be more correct we
need a slightly longer impl that rounds float->float then "truncates".
Unsure whether it matters in practice.  Same deal in the unit test that
I added back, now testing negative and 0.5 cases too. The expectations
assume the current mode is nearest even.

I had the idea to resurrect this when I was looking at adding _imm Ops
for fma_f32.  I noticed that the y and z arguments to an fma_f32 were by
far most likely to be constants, and when they are, they're by far likely
to both be constants, e.g. 255.0f & 0.5f from to_unorm(8,...).

llvm disassembly for SkVM_round unit test looks good:

~ $ llc -mcpu=haswell /tmp/skvm-jit-1231521224.bc -o -
	.section	__TEXT,__text,regular,pure_instructions
	.macosx_version_min 10, 15
	.globl	"_skvm-jit-1231521224"  ## -- Begin function skvm-jit-1231521224
	.p2align	4, 0x90
"_skvm-jit-1231521224":                 ## @skvm-jit-1231521224
	.cfi_startproc
	cmpl	$8, %edi
	jl	LBB0_3
	.p2align	4, 0x90
LBB0_2:                                 ## %loopK
                                        ## =>This Inner Loop Header: Depth=1
	vcvtps2dq	(%rsi), %ymm0
	vmovupd	%ymm0, (%rdx)
	addl	$-8, %edi
	addq	$32, %rsi
	addq	$32, %rdx
	cmpl	$8, %edi
	jge	LBB0_2
LBB0_3:                                 ## %hoist1
	xorl	%eax, %eax
	testl	%edi, %edi
	jle	LBB0_6
	.p2align	4, 0x90
LBB0_5:                                 ## %loop1
                                        ## =>This Inner Loop Header: Depth=1
	vcvtss2si	(%rsi,%rax), %ecx
	movl	%ecx, (%rdx,%rax)
	decl	%edi
	addq	$4, %rax
	testl	%edi, %edi
	jg	LBB0_5
LBB0_6:                                 ## %leave
	vzeroupper
	retq
	.cfi_endproc
                                        ## -- End function

Change-Id: Ib59eb3fd8a6805397850d93226c6c6d37cc3ab84
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276738
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-03-12 21:10:34 +00:00
Chris Dalton
bb7684276a Migrate GrMeshTest to the new bind/draw API
Also adds a drawIndexPattern() helper method to GrOpsRenderPass, and
starts testing a base index with drawIndexedInstanced.

Change-Id: I3fbb1b5a2a1012a4fcbe126c54ddbc8c17ce80b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276739
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-03-12 19:24:07 +00:00
Robert Phillips
2669a7b74a More programInfo cleanup
This CL moves the boiler-plate implementation of onPrePrepareDraws up to GrMeshDrawOp. This, unfortunately, required the addition of a 'programInfo' virtual but that may go away in the future.


The only GrMeshDrawOp-derived classes left are:
  AAHairlineOp - which has 3 programInfos
  AAFlatteningConvexPathOp - which has >=1 mesh (but just 1 programInfo)
  GrAtlasTextOp - which has inline uploads
  SmallPathOp - which, maybe, has inline uploads
  TextureOp - which has chaining

Bug: skia:9455
Change-Id: Id10f70e764054134751545ad38b99f0a0778de76
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276642
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-03-12 18:29:37 +00:00
Robert Phillips
6941f4a01d Update three GrMeshDrawOps to surface their programInfos at record time
The lucky three are:

    GrShadowRRectOp
    PrimitiveProcessorTest::Op
    VertexColorSpaceBench::Op

Bug: skia:9455
Change-Id: I7133be41e62aa183b8395f2402f52a6a88191aca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276482
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-03-12 15:40:11 +00:00
Brian Osman
f0aee749bf Remove (unused) shader caps from default GP factory functions
Change-Id: Id3313169be2fecfb8a11045f08a55490fbec9b9e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276486
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-03-12 13:59:40 +00:00
Robert Phillips
4133dc4e0b Clean up programInfo creation in GrMeshDrawOp-derived Ops
This CL:
  Renames the existing createProgramInfo method to onCreateProgramInfo and makes it a virtual on GrMeshDrawOp

  Moves the non-virtual createProgramInfo (helper) calls to GrMeshDrawOp

  Changes onCreateProgramInfo to not return a ProgramInfo*. This is setting up to handle ops that create >1 programInfo (e.g., AAHairlineOp)

This CL leaves the following 8 ops in need of an onCreateProgramInfo implementation:

AAHairlineOp
AAFlatteningConvexPathOp
GrAtlasTextOp
GrShadowRRectOp
SmallPathOp
GrTextureOp
PrimitiveProcessorTest::Op
VertexColorSpaceBench::Op

Bug: skia:9455
Change-Id: Id7e2b8a40cac86ede6bf3c0e544da5500ff47d8a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276403
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-03-12 13:00:40 +00:00
Brian Osman
dafbf121a8 SkVertices: Remove volatile/nonvolatile bit
No one was using this, and it added significant complexity to
GrDrawVerticesOp.

Bug: skia:9984
Change-Id: I23f38b3f5d853a8e531f13b6931cd57b5985a2c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276407
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-03-11 17:33:17 +00:00
Mike Reed
fdf94044ff Remove exotic legacy bitmap drawing entry points: Nine, Lattice
follow-ups:
- remove associated virtuals in canvas

Change-Id: I3efa7a88ed0905ebf080712993e7f43148df36dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276282
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-03-11 13:11:47 +00:00
Brian Osman
5f6b41e6d8 Runtime effects: Detect calls to undefined functions
Previously, the CPU backend would catch this later (ByteCodeGenerator),
and the GPU backend would assert in expandFormatArgs (out-of-range
function index).

Change-Id: Ib84bf7c477ddcc9fd3091c5b106ebdd654e9a30b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276000
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-03-10 20:27:10 +00:00
Brian Osman
2e19af063b Revert "Move interpreter disassemble to out-of-line member of ByteCode"
This reverts commit 1b0124fec6.

Reason for revert: Check generated files bot is unhappy.

Original change's description:
> Move interpreter disassemble to out-of-line member of ByteCode
> 
> Now it returns a string (rather than just calling printf).
> 
> Adds GUI view of particle effect byte code (for fun), and fixes the
> unit tests that called ByteCodeFunction::disassemble, which wasn't
> doing anything.
> 
> Change-Id: Ide3fd933cf14832feae7ff9e0fdc1ae8f24a28d4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273878
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

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

Change-Id: I478a93769a3e1a72a339853d6d41865dba8bbe66
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275800
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-03-07 17:44:05 +00:00
Brian Osman
1b0124fec6 Move interpreter disassemble to out-of-line member of ByteCode
Now it returns a string (rather than just calling printf).

Adds GUI view of particle effect byte code (for fun), and fixes the
unit tests that called ByteCodeFunction::disassemble, which wasn't
doing anything.

Change-Id: Ide3fd933cf14832feae7ff9e0fdc1ae8f24a28d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273878
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-03-06 22:16:11 +00:00
Dominic Mazzoni
8f233fc795 Add marked-content ID to PDF images
Previously we only added marked-content IDs to text commands.
Extend this to support marking bitmaps drawn to a PDF document
too, so that images can be tagged with alt text.

Moves the code that outputs the marked content ID and closing
tag into a scoped helper class that outputs the closing sequence
on destruction.

Note: we'll probably want to do this to nearly all drawing
commands, since nearly everything could in theory be tagged.

This change is safe because it's still behind a flag in
Chromium and if the document doesn't have any structure
tree, it won't output anything.

Bug: chromium:607777
Change-Id: I4d7d655857fa7e76c6a6914a2a83097be917d835
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275517
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2020-03-06 19:48:50 +00:00
Greg Daniel
7c9021185c Remove SkImage getTexture call.
Change-Id: Ib9f3d8c58ee5736bfee03eaedff20f24b51d5ff9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275625
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-03-06 18:53:00 +00:00
Mike Klein
491df6ba72 remove SkTLS
- used for debug lock tracking in SkFont*
  - used for debug logging in SkPathOps
  - genuine use in GLTestContext_cmd_buf?
    switched that to thread_local
  - keep empty SkTLS_{pthread,win}.cpp until
    references to them can be cleaned up

Bug: skia:10006
Change-Id: I195a94c95d3f1a1918ee8c9bc4a15fa5b4344fbc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275282
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-03-06 14:41:01 +00:00
Mike Klein
7c0332cd35 re-enable fnma
- hook up fmls.4s as fnma_f32
 - add fneg.4s
 - use fneg.4s + fmls.4s to impl fms_f32
 - more tests to exercise these

Change-Id: I60173a5e4618ab968a9361e15334a1d63c001372
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275412
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-03-05 21:58:07 +00:00
Greg Daniel
456f9b5fe9 Reland "Move GrGpuResource GrSurface and GrTexture into src."
This reverts commit f6ed96d1c2.

Reason for revert: google3 change landed

Original change's description:
> Revert "Move GrGpuResource GrSurface and GrTexture into src."
> 
> This reverts commit e5a06ce678.
> 
> Reason for revert: Need to make change in google3 first
> 
> Original change's description:
> > Move GrGpuResource GrSurface and GrTexture into src.
> > 
> > Must land https://chromium-review.googlesource.com/c/chromium/src/+/2087980
> > before this can land.
> > 
> > Bug: skia:7966
> > Change-Id: I60bbb1765bfbb2c96b2bc0c9826b6b9d57eb2a03
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275077
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> 
> Change-Id: Id39e0a351e49a87209de88a6ad9fadb0219db72c
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:7966
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275216
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: I746ce739cb084cefc46f9dab24ef773e7c3cc621
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7966
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275436
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-03-05 19:16:21 +00:00
Robert Phillips
1b1bd4e509 Clarify expected compatibility matrix in CharacterizationFBO0nessTest
Change-Id: I120b5f79588f7300c1ac7e9e699cf2423030b328
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275338
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-03-05 19:11:18 +00:00
Mike Reed
50c64ab259 expose per-vertex-data variant of SkVertices
Bug: skia:9984
Change-Id: Iaff520c6085303830f14bac4fe56830ba7360f64
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275218
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-03-05 18:32:08 +00:00
Robert Phillips
2dbcbe8b12 Loosen up SkSurface_Gpu::onIsCompatible a bit wrt FBO0-ness
Change-Id: Ie04f55c9fb94e4e4acd90b96cd7fb0d3c6b72e14
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275041
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Peng Huang <penghuang@chromium.org>
2020-03-05 17:12:22 +00:00
Robert Phillips
d2f18734aa Surface more programs on DDLs
This CL adds createProgramInfo and onPrePrepareDraws methods to:
   NonAAStrokeRectOp
   AAStrokeRectOp
   NonAARectOp

Bug: skia:9455
Change-Id: Id7c0151d26c5daa390cd51b9c73c95f4f1fc0104
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275039
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-03-05 13:54:01 +00:00
Greg Daniel
f6ed96d1c2 Revert "Move GrGpuResource GrSurface and GrTexture into src."
This reverts commit e5a06ce678.

Reason for revert: Need to make change in google3 first

Original change's description:
> Move GrGpuResource GrSurface and GrTexture into src.
> 
> Must land https://chromium-review.googlesource.com/c/chromium/src/+/2087980
> before this can land.
> 
> Bug: skia:7966
> Change-Id: I60bbb1765bfbb2c96b2bc0c9826b6b9d57eb2a03
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275077
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: Id39e0a351e49a87209de88a6ad9fadb0219db72c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7966
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275216
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-03-05 01:46:51 +00:00
Mike Klein
238105b50c skip dump checks on machines w/o FMAs
They'll never see fma_f32 ops.

Change-Id: I39371606c673fb76bdcbbe08c1b25308675f8f2c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275151
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-03-04 23:21:02 +00:00
Greg Daniel
e5a06ce678 Move GrGpuResource GrSurface and GrTexture into src.
Must land https://chromium-review.googlesource.com/c/chromium/src/+/2087980
before this can land.

Bug: skia:7966
Change-Id: I60bbb1765bfbb2c96b2bc0c9826b6b9d57eb2a03
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275077
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-03-04 23:01:31 +00:00
Mike Klein
cb50b117e3 get rid of troublesome Op::round
We really only need to_unorm(),
and that's fine with trunc(mad(x, scale, 0.5)).

Change-Id: I1561c678501963a9ae53c22994fc906159fc7199
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275075
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-03-04 22:26:01 +00:00
Julia Lavrova
2813d454f3 getRectsForRange results must be adjusted to glyphs.
Bug: skia:9957
Change-Id: I7c8537e8217288bf5d9d38950377cdacae705816
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274746
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-03-04 18:29:02 +00:00
Ben Wagner
a913895468 Check for invalid unicode in fallback.
CFStringCreateWithBytes will return nullptr if the raw string passed is
not valid in the encoding specified. It turns out that in UTF32 the
values between 0xD800 and 0xDFFF and above 0x10FFFF are invalid.

Bug: chromium:1057692
Change-Id: Ic3984d113106cbf8ef393048a97ccc906fb89966
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274679
Auto-Submit: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-03-03 16:24:21 +00:00
Robert Phillips
b58098f34c Add onPrePrepareDraws & createProgramInfo methods to GrDrawVerticesOp (take 2)
This CL also incidentally adds:

1) a GrMeshDrawOp::Target 'outputView' virtual and switches GrOpFlushState over to overriding it.

2) a createProgramInfo helper to GrSimpleMeshDrawOpHelper

Bug: skia:9455
Change-Id: I88ce51c585b1458ee79a9aaa7024190e9f19198c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274506
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-03-03 13:48:41 +00:00
Brian Salomon
71fe945da3 Prevent unbounded listener growth on SkPixelRefs.
Use SkIDChangeListener and update GrBitmapTextureMaker to add listener
to key to deregister if texture is purged before genID changes.

Add a common listener list implementation and replace existing lists.

Change-Id: Ib0c78241eaf59b59b892d8b004b2bb095140bc6d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274549
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-03-02 22:32:09 +00:00
Robert Phillips
b43cfa4d3f Revert "Add onPrePrepareDraws & createProgramInfo methods to GrDrawVerticesOp"
This reverts commit d3606518fa.

Reason for revert: DDL3 bots are red

Original change's description:
> Add onPrePrepareDraws & createProgramInfo methods to GrDrawVerticesOp
> 
> This CL also incidentally adds:
> 
> 1) a GrMeshDrawOp::Target 'outputView' virtual and switches GrOpFlushState over to overriding it.
> 
> 2) a createProgramInfo helper to GrSimpleMeshDrawOpHelper
> 
> Bug: skia:9455
> Change-Id: Iecd712d3ac76038651bd2e0512134e310930d527
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274551
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=egdaniel@google.com,robertphillips@google.com

Change-Id: I6e44ba3bc47df27479af9344af946e27f0a2e937
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9455
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274505
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-03-02 20:50:54 +00:00
Robert Phillips
d3606518fa Add onPrePrepareDraws & createProgramInfo methods to GrDrawVerticesOp
This CL also incidentally adds:

1) a GrMeshDrawOp::Target 'outputView' virtual and switches GrOpFlushState over to overriding it.

2) a createProgramInfo helper to GrSimpleMeshDrawOpHelper

Bug: skia:9455
Change-Id: Iecd712d3ac76038651bd2e0512134e310930d527
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274551
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-03-02 20:26:10 +00:00