Compilation of Metal shaders on 10.13 is unstable and keeps crashing
the bots.
Change-Id: If4e707b80a6ca20f989b504b5bab33c8b2dcaac6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320297
Reviewed-by: Ravi Mistry <rmistry@google.com>
Reviewed-by: Weston Tracey <westont@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: Ia5cf75d40234e53fcbf49b4c6af96fd66844267e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320273
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@google.com>
The node's kind can be easily inferred by presence of a statement or
pointer inside of it. When there are only two kinds, having a separate
field doesn't add value. (If we end up wanting more block types in the
future, we could re-add fKind as a private field.)
Change-Id: I8e9db122b4a82728d987c4913a7bdff85b4b1a2d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320298
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>
This is the second CL for isolating the Chrome
remote glyph cache API from the implementation.
See CL/320074 for the first CL, which handles
SkStrikeClient.
Pull out the rest of the tracing functionality.
Change-Id: I4d6aa4bf648a0d2d55cecedbe445a05c27e3a986
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320256
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Older versions of MacOS are unstable when compiling shaders, and we
don't have the testing support for older versions of iOS.
Bug: skia:10777
Change-Id: I95d9fe0f1007af6bec5c7525dacda565e32989f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320260
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
ninja 1.9.0+ exposes a bug in python shutil.copy2 where a copied file's
date is the src's date but rounded. This can cause ninja to think the
copied file is slightly older than the src and trigger unnecessary work
when building.
https://github.com/ninja-build/ninja/issues/1554
Change-Id: I53247453f38a1c98c5d832bdda0f68effbe786c2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320261
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
When using offscreen draws, we save the "previous" frame in fLastImage
in viewer. However this image holds a ref to the GrContext. When we
were destroying the vulkan context we thought we were destroying the
GrContext before the VkDevice but fLastImage was keeping it alive.
This changes makes sure to reset fLastImage when we are done with it.
Change-Id: Ib70e069a261f939217436a9f052d7565581cd230
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320263
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
The right side of assignments will collapse redundant swizzles, but the
left side does not. Code like this can actually cause the ByteCode-
Generator to assert if it is run (it asserts in `swizzle_is_simple`
during code generation).
Change-Id: I891912fe0b5de2670dfa95f6702a86d5c42bb2ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320296
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>
This was adapted from a test in SkSLInterpreterOutParams and presents a
challenging double swizzle.
Change-Id: Icb7b3bbb18d4b3cfa0c26acb524c08812ba88096
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319920
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>
We have options how to represent 8 Q14 values in a ymm,
mainly either in the 8 low 16-bit lanes or in the 8 even 16-bit lanes.
I've tried both and the even-lane approach is nicer:
1) many operations are the same for 32-bit or 16-bit
2) splat and splat_q14 constants can share the same pool
3) to_q14 and from_q14 are essentially noops
Interestingly, over in the interpreter we use dense 16-bit storage for
Q14 to operate most efficiently there, so we've kind of already proved
the thesis that each backend should have this flexibility.
Change-Id: I4d5a40159d46b6b24413087d0837128e6477752d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319335
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
All the interface classes in SkRemoteGlyphCache have too
many Skia types exposed during compilation. This is
causing c++17 compilations to fail. This is the first
of a few CLs to isolate Skia better.
In addition, remove the tracing functionality. I will
add it back when I need it again.
Change-Id: I5d4efe7aadb5e8be2a863784dbbe5398afb09666
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320074
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Ideally the surface onto which a glyph is drawn will not affect the
glyph metrics. In order to do this the kGenA8FromLCD flag must be
respected by the scalar context so that requests for subpixel rendering
always produces subpixel rendering metrics but the subpixel mask mixed
down to non-subpixel rendering should the canvas not support it.
Not supporting this can cause odd behavior when measuring one way but
then drawing the other way.
Change-Id: Id08ffa14483b4650459a2f0351da2ffdea81e3c5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319696
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
SkGlyphRect is a rectangle encoding specialized for
union and intersect. It will be used for calculating
the bounding boxes of glyph runs, and clipping glyphs
for GPU.
Change-Id: Icab826b51dc2254ee4006ada84f7fc09e112a933
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319697
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This allows dead-stripping to properly optimize away unreferenced clones
of intrinsic functions, and allows the inliner to detect intrinsic
functions that are only called once (which can generally always be
inlined without penalty).
Change-Id: I0cf034d880ae5d52f4cc0f93de6e2c7aad34e975
Bug: skia:10776
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320258
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>
This is a reland of 435b482638
inlineStatement now takes a `const Expression* resultExpr` instead of
`const Expression& resultExpr` because resultExpr will be null for a
void function.
Original change's description:
> Support out parameters that use a swizzle.
>
> This CL also removes the `VariableExpression` class that was briefly
> added in a prior CL. This class was intended to support cloning an
> expression while changing the refKind of a VariableReference inside of
> the expression, but it added state and complexity. In this CL, rather
> than track this via extra state, the inliner just recurses into the
> expression as needed to find its VariableReference. Since most relevant
> expressions are just a VariableReference anyway, this is inexpensive.
>
> Change-Id: Id4d926b7d7520b5e6ce455446c05a6d59ef62a84
> Bug: skia:10756
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319917
> 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>
Bug: skia:10756
Change-Id: I35f76c21eccf0ba2ab47e4313e131f7aa26980fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320223
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Bug: chromium:1132739
Change-Id: I67b7ac535232925e98e44c0bb90964fded9f4d05
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320068
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
In the operation of taking the bounds of (horizontal text) and then
drawing the text within those bounds it is necessary to draw the text at
the origin of the bounds and not at the left edge of the bounds.
Change-Id: I712e1713ca5e0be929b11f526f224141a5310cc2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319776
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This is just part of the occasional refactoring to slowly move all of
vulkan resource tracking to sk_sp instead of manual ref/unrefs
Change-Id: I2ed4d5bb4c6acfc89dc6d797019977e1c4bd5d1a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320065
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This reverts commit 435b482638.
Reason for revert: ASAN/UBSAN unhappy.
Original change's description:
> Support out parameters that use a swizzle.
>
> This CL also removes the `VariableExpression` class that was briefly
> added in a prior CL. This class was intended to support cloning an
> expression while changing the refKind of a VariableReference inside of
> the expression, but it added state and complexity. In this CL, rather
> than track this via extra state, the inliner just recurses into the
> expression as needed to find its VariableReference. Since most relevant
> expressions are just a VariableReference anyway, this is inexpensive.
>
> Change-Id: Id4d926b7d7520b5e6ce455446c05a6d59ef62a84
> Bug: skia:10756
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319917
> 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=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com
Change-Id: Ibdda47607f9e6e7f3a7459915067cf5e20919993
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10756
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320220
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Even when expanding clip ops were disabled, the max value allowed the
fuzzer to produce those disabled values. This should fix the fuzzer to
only produce valid intersect or difference clip ops.
Bug: chromium:1132687
Change-Id: I7368ff36a00e6b0e87ecbae5ba647d249299b9ca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320064
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Now that ternaries are no longer supported for assignment (as per GLSL
spec), there's no longer any cases where an assignment can target more
than one variable reference at a time. Replace the output vector of
VariableReferences `assignedVars` with a single VariableReference,
`assignedVar`.
Also, allow callers to pass null for the ErrorReporter. This is useful
if inability to assign to an expression does not actually indicate an
error condition.
Change-Id: I146a9d1a488131ac5048c665e4dc880d895a275a
Bug: skia:10767
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319859
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This is too slow at the moment to run on the CQ (~50 minutes), but
metzman@ is planning on caching a bulk of the work needed before
we can compile the fuzzers.
Bug: skia:10713
Change-Id: I664b8afbdb9fa57a4bce3aa479ffce3c70b684ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317283
Reviewed-by: Eric Boren <borenet@google.com>
Subpixel and slight hinting also make a big difference.
Change-Id: I1b942caf20dbdcf8bebc3504695c673fbe7e4392
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319791
Reviewed-by: Ben Wagner <bungeman@google.com>
This CL also removes the `VariableExpression` class that was briefly
added in a prior CL. This class was intended to support cloning an
expression while changing the refKind of a VariableReference inside of
the expression, but it added state and complexity. In this CL, rather
than track this via extra state, the inliner just recurses into the
expression as needed to find its VariableReference. Since most relevant
expressions are just a VariableReference anyway, this is inexpensive.
Change-Id: Id4d926b7d7520b5e6ce455446c05a6d59ef62a84
Bug: skia:10756
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319917
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>
Also add a skiplist to bypass a skp that is (hopefully temporarily)
timing out.
Change-Id: I912bd901a985ae86adfed13db102a1e7fee5686a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320060
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Swizzles in combination with out params are currently broken in SkSL.
They are fixed in the followup CL at http://review.skia.org/319917
Change-Id: I22d9436a15631e6ee2acf9fc312a8634cf3b5407
Bug: skia:10756
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319918
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>
Not really sure why it's still in BlitterUniforms when it doesn't change
from blit to blit... it's really more like the paint SkFilterQuality.
The only real caveat is that we need to take care to push the same
uniforms in cache_key() and build_program(), in particular making sure
we reuse the paint color uniforms if there's a clip shader.
Change-Id: I4c82b43b72b2a64341568f49f2f6dabad17fbc3e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319767
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This reverts commit a05d27b170.
Reason for revert: Google3 roll,
third_party/skia/HEAD/src/sksl/SkSLTestRehydrator.cpp:311:15: error: no type named 'Dehydrator' in namespace 'SkSL'
SkSL::Dehydrator dehydrator;
Original change's description:
> moved SkSL BoolLiteral data into IRNode
>
> Change-Id: I177b6daf4d6cb024ba20264ab01d0aa68e768a6d
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319782
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com
Change-Id: I76bcdc7ef914448b439df81cd382066980e1251e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320017
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
When mapping bounds in the forward direction, return the target rect of
the picture (fCropRect). This matches the behavior of SkImageSource
which can be considered to be semantically similar.
Bug: skia:10744
Change-Id: Ief213a847041ea6b276b2e7493e49db01715eda9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319616
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
device_coord() and paint_color() get the device coordinate
as skvm::Coord and paint color as skvm::Color respectively.
Change-Id: Ia35c635d073b5aa7f4369340cff108027728cb74
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319765
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
It's doing two or three separate things, and I think it's clearer to do
the color conversions and premul up front, leaving just uniformColor().
Change-Id: I65a2f5eac86129924bf30f00a879ae01a1e737a5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319764
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This tweak makes these conversion functions' names
match the names of the types, e.g. to_F32() makes F32.
Change-Id: I4d71c9bd17d835d09375e3343ee4316082b02889
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319763
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
GLSL does not support assigning to ternaries, and will fail to compile
and/or generate non-functional shaders if we pass in a shader that tries
to assign into a ternary expression.
If SkSL is able to completely eliminate the ternary (e.g. if it boils
down to a simple `true ? x : y` or `false ? x : y`), SkSL can strip out
the ternary entirely and generate valid GLSL. This case is harmless and
so it is still allowed.
Change-Id: I960f119fb9934f998697634e6c4e519cd77d3780
Bug: skia:10767
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319679
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Change-Id: I452e52a87d89cefb5c21a0d9d57e9771f3038d73
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319783
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>