Commit Graph

50899 Commits

Author SHA1 Message Date
Chris Dalton
31bf3d9bb5 Relax SkStrokeRec::hasEqualEffect
Ignores the miter limit if the join type is not kMiter.

Bug: skia:10419
Change-Id: Ib05895cf90c7bb0e25e9e8c3e26c13fef32f2e97
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317163
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-09-15 20:05:40 +00:00
Michael Ludwig
a195d101f9 New GrClipStack supporting only intersect/difference
Overview doc: https://docs.google.com/document/d/1ddIk74A1rL5Kj5kGcnInOYKVAXs3J2IsSgU5BLit0Ng/edit?usp=sharing

This is the new clip stack that will replace GrClipStackClip. The doc
link in the CL description has a much more detailed overview of what the
strategy of the new clip stack is, but at a very high level:

1. Add a temporary #define that lets SkGpuDevice switch between the old
stack and the new stack. For the new GrClipStack, it extends SkBaseDevice
directly and has to implement all of the device clipping virtuals.
   - If you look from patchset 5 and earlier, the define defaults to on
     so I can test it on the bots, etc. but the plan will be for it to
     default to off when this lands so it's only running on unit tests.
     Then in a follow up, I'll turn it on for our bots but keep it off in
     chrome and android. If everything looks good, chrome can then be
     turned on. There is a more extensive migration plan for android
     because of the expanding clip ops, but that is covered at the end of
     the overview doc.

2. GrClipStack manages save/restore logic of the stack and extends GrClip,
so the cpp file also includes code to apply a GrAppliedClip. At the moment
the apply strategy is as close to that in GrReducedClip and
GrClipStackClip as I could make it. Down the road, I think we can explore
other analytic coverage options and a clip atlas that replaces the unified
SW mask.
   - Once GrClipStack is enabled everywhere, it means GrReducedClip and
     GrClipStackClip can be deleted, so I'm not too worried about sharing
     code between the two. A lot is already shared through the use of
     GrSWMaskHelper and GrStencilMaskHelper.
   - SkClipStack and SkClipStackDevice are still used by the PDF and SVG
     backends, so they aren't necessarily deletable.

3. The GrClipStack only handles intersect and difference ops. It
represents all geometric clip operations as an element. The stack itself
is controlled by the "save record", which tracks aggregate bounds, valid
elements, and the non-geometric clip shader.
   - When a new save record is pushed on the stack, older elements are
     inactive. This means they cannot be modified, since they may need to
     be activated again when the current save is popped off the stack.
     However, they can still affect the clip during application.
   - When a new element is pushed on the stack, older elements may be
     invalidated. This means they don't need to be considered any more
     because they are redundant with the new clip shape (e.g. nested round
     rect clips only have to keep the innermost valid).


Bug: skia:10205
Change-Id: I68ccfd414033aa9014b102efaee3ad50a806f793
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308283
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-09-15 19:27:11 +00:00
Mike Klein
3c685bf89f test clipRect sorting
This feels pretty awkward, but it's the most straightforward way I see
to do this without Yet Another Canvas Subclass.

Passes at head, fails without
https://skia-review.googlesource.com/c/skia/+/317110.

Change-Id: I67931b5eb8396621aec1858f2d7c4aaadb1b9132
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317161
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-09-15 18:48:40 +00:00
Nathaniel Nifong
50dd7e15af Fix cube map demo
Change-Id: Id8d3fce0840627de0414e26d1b2a60d89cfd2fe1
Docs-Preview: https://skia.org/?cl=316942
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316942
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-09-15 17:50:10 +00:00
Brian Osman
560ae27890 In SkCanvas::clipRect, sort incoming rects
This makes our behavior more consistent with drawRect (where we always
sort rects). It also makes it more consistent between CPU and GPU. (CPU
used a technique to implement rect clipping that allowed for unsorted
rects, but GPU's clip stack would reject them as empty).

Fixes https://github.com/flutter/flutter/issues/38753

Change-Id: Ib91ebaf13d08dfe34105b9ee59021ac491d67bc7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317110
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-09-15 17:35:40 +00:00
Mike Klein
98c512c89d add Q14x2 type to SkVM
This is a 32-bit pair of Q14 (signed 1.14 fixed point) values.

Q14 * Q14 is (x*y + 0x2000)>>14 but we'll do it as
((x*y + 0x4000)>>15)<<1 to allow use of vpmulhrsw.

Somewhat awkwardly this approximate math does not preserve x*1.0 == x,
e.g.  0x0001 * 0x4000 = 0x0002, not 0x0001.  I'm unsure if we'll care.
x*0.0 == 0.0 does always hold, and 1.0*1.0 == 1.0.

Most other operations are normal 16-bit operations.

TODO:
    - implmement in interpreter
    - unit test
    - constant propgation and strength reduction
    - implement in JIT
    - effect/blitter hooks enough to demo
    - thorough effect/blitter support

Change-Id: Ic714fc16b6530259b36300bd042bbfd5a57a663b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317149
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-09-15 17:34:30 +00:00
Mike Klein
6f3ed7f72c unbreak Build-Debian10-Clang-x86-Debug
fuzzers can't build there, but I don't really care.

Cq-Include-Trybots: luci.skia.skia.primary:Build-Debian10-Clang-x86-Debug
Change-Id: Icb729e8802ccd3cdd1e1384d006d46bd7dc2cd08
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317150
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-09-15 16:39:10 +00:00
Brian Salomon
c2a9a9716e New version of SkImage::MakeFromYUVAPixmaps()
Takes SkYUVAPixmaps. Still implemented in terms of SkYUVAIndex[4]
internally.

Replace all internal use cases except wacky_yuv_formats.

Takes GrRecordingContext rather than GrContext.

SkVideoDecoder updated to take GrRecordingContext.

Bug: skia:10632

Change-Id: I6e9b9b6a4f11333bce6f87c1ebff0acb297f6540
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316837
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-09-15 16:13:50 +00:00
John Stiles
886b9d477c Create blank SkSL test files for Ninja's benefit.
GN lists both the .cpp and the .h as generated outputs, so if they don't
exist, Ninja assumes we need to rebuild the tests every time we compile.

Change-Id: I37b8b3d9e7aef1b0cb8d5c70530c2542a6c0087a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317108
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-09-15 16:00:30 +00:00
Brian Osman
d911c91d88 Normalize line endings in SkSL error tests
On Windows, the process output contains CRLF sequences. Calling
splitlines() recognizes those (Python universal line endings), so we get
a list of the output lines. Joining those with '\n' produces a string
that just has LF. (We add another one, so we still end the file with a
newline). Because we've opened the file in binary mode, the resulting
files now look the same, regardless of OS.

Change-Id: I1f032aa6e0f82057f593c25ce0676983733b9e56
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317105
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-09-15 15:35:30 +00:00
John Stiles
f2cdf59d58 Migrate SkSL inliner tests to golden files.
Our lack of proper caps-bits controls in skslc affects the outcome of
one test: "InlinerWrapsEarlyReturnsWithDoWhileBlock" does not actually
emit the do-while block because the standalone caps bits don't enable
do-while support. This will be fixed in a followup CL that adds caps-bit
support to our tests.

A few tests were renamed for consistency, a few were simplified slightly
and one test was removed because it was simply redundant (there was a
second test that covered the exact same ground as
`ForWithReturnInsideCannotBeInlined`).

Change-Id: I2e3b97cb3aea331b6d806bdb865aa78c35c7a6b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316997
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-09-15 15:22:12 +00:00
Adlai Holler
860ac5b03e Move canvaskit bindings away from getGrContext
Change-Id: I822f769956d013068ace9aca465173f4377937da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317104
Commit-Queue: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-09-15 15:14:12 +00:00
Mike Klein
84dd8f9912 implement some useful 16-bit instructions
Add a slew of 16-bit instructions for experiments.

I want to try a fixed-point path through SkVMBlitter, continuing to
represent geometry with F32, but color channels in 16 bits, with several
possible representations:

    - unorm8 lowp like SkRasterPipeline (0 -> 0.0,  0x00ff ->  1.0)
    - 15-bit SkFixed15 fixed-point      (0 -> 0.0,  0x8000 ->  1.0)
    - 14-bit signed fixed-point         (0 -> 0.0, ±0x4000 -> ±1.0)

I'm leaning towards the 14-bit version for being able to hold a good
range of temporary values in [-2,2), or perhaps even a 13-bit analog for
even a little more safety range.  Mostly something new to try.

Most of these instructions are pretty obvious, with notes on a few:

    vpavgw is an unsigned (x+y+1)>>1, and is useful for converting
    unorm8 up to Q14.  There are a couple ways to do this pretty well,
    and using vpavgw is the best, and uses the fewest instructions:

         A) (x << 6) + ( x    >> 2) + (x == 255)   // Ok approx.
         B) (x << 6) + ((x+1) >> 2)                // Better approx.
         C) vpavgw(x << 7, x >> 1)                 // Perfect math!

    The best good reverse math I've found is (x >> 6) - (x > 16319).

    vpmulhrsw is the key to the whole thing as usual, letting us do
    16x16->16-bit multiplies.  An SkFixed15 multiply is vpmulhrsw
    followed by vpabsw (also added here), and a Q14 multiply is
    vpmulhrsw followed by a simple <<1.

    I've added both signed and unsigned min and max.  Not entirely
    sure they'll all be used, but I do have my eye on vpminuw as a
    single-instruction clamp to [0,0x4000] ~~> [0.0,1.0], treating
    any negative Q14 as very large unsigned.

Change-Id: I0db7f3f943ef6c9a600821444cc5b003fe5f675d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317119
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-09-15 15:09:52 +00:00
Kevin Lubick
272e8bcd24 [fuzz] Add libfuzzer binaries to BUILD.gn
For the longest time, the libfuzzer binaries used by oss-fuzz
were just hacked onto the BUILD.gn file. This removes that patch
and makes them buildable from Skia proper.

After this, there should not be any modifications oss-fuzz needs
to do to a Skia checkout before it builds and runs.

Of note, oss-fuzz will define skia_use_libfuzzer_defaults to be
false so it can control those flags with more finesse (e.g.
fuzz with ASAN, fuzz with hong fuzz instead of libfuzzer). I
added on skia_use_libfuzzer_defaults so that a normal developer
gets something that works by default.

Bug: skia:10713
Change-Id: I024f5805060cba8f8560e1c2569b9309fb49a564
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316536
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-09-15 14:52:02 +00:00
Kevin Lubick
22aa7d7915 [canvaskit] Remove unnecessary ColorTypes
If we have removed any in error, we are happy to add them
back in upon request.

Bug: skia:10717
Change-Id: Ic7be83d6205866e12a9488be83034f15450eb098
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316842
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-09-15 13:45:34 +00:00
Kevin Lubick
c9bece21e0 [canvaskit] Replace drawAnimatedImage with drawFrameAtImage.
This allows paint to be used (instead of the less-desirable
drawDrawable impl).

Bug: skia:10717
Change-Id: Id132e7b2bc189303e866f66d90f389bc29c02fb8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316840
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-09-15 13:45:34 +00:00
John Stiles
e36079ea09 Revert "Disable whole-program inliner."
This reverts commit eaed918a1d.

Reason for revert: fix for skia:10722 at http://review.skia.org/316977

Original change's description:
> Disable whole-program inliner.
>
> This can be re-enabled once the Metal bug with fp_sample_chaining is
> diagnosed and fixed.
>
> A pure rollback led to a merge conflict; just commenting out the line
> that invokes the inliner serves the same purpose.
>
> Change-Id: I4df556ea8cd44349cbca2ea0ec9995dfffeb8aec
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316937
> Commit-Queue: John Stiles <johnstiles@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

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

Change-Id: If490609a9f5f0b0e87baf57638a3da865e173b03
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316996
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-09-15 13:25:43 +00:00
John Stiles
c75abb8432 Assign unique names to inlined variable declarations.
Change-Id: I6097f50e7be1fa2f7772f6c454410ecbf3470eea
Bug: skia:10722
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316977
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-09-15 13:22:52 +00:00
John Stiles
8f026259d8 Demonstrate name reuse error in inliner.
The following conditions lead to the error:
- A pair of nested functions, both of which must be inlined.
- Both inlined functions create a variable with the same name.
- The outer function passes its variable to the inner function.
- The initialization of the inner variable uses the value from the outer
  variable.
- The inner function does not mutate the variable, use it as an out-
  parameter, or otherwise cause it to receive a temporary copy.

When all these conditions are met, both variable declarations are
inlined as-is without performing any name salting, because it's
seemingly safe to do so. The name overlap issue is not considered in the
safety checks. Inlined variable declarations are not subject to name
salting but they should be; I suspect other adversarial examples could
be crafted as well where unhandled name overlap leads to errors.

Change-Id: Ia754bee8e45c8a5c7548436594bbf04abc7a8396
Bug: skia:10722
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316945
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-09-15 13:03:22 +00:00
skia-autoroll
aecd484d03 Roll Chromium from 2ab7a04e4589 to 2c970cbe2fff (351 revisions)
2ab7a04e45..2c970cbe2f

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/chromium-skia-autoroll
Please CC scroggo@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Perf-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-CommandBuffer;skia/skia.primary:Test-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-CommandBuffer
Tbr: scroggo@google.com
Change-Id: I8ac4598a7ddff27f047d39cd2df35a877aa8ff49
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317038
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-09-15 04:57:31 +00:00
skia-autoroll
19ed57bfb4 Roll SwiftShader from dc552fcef1fe to 0f14b7ab7a55 (4 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/dc552fcef1fe..0f14b7ab7a55

2020-09-14 amaiorano@google.com CMake: normalize FOLDER property for third_party targets
2020-09-14 bclayton@google.com SpirvShaderDebugger: Add PRINT_EACH_DEFINED_DBG_INSTRUCTION
2020-09-14 bclayton@google.com SpirvShaderDebugger: Implement DebugValue
2020-09-14 bclayton@google.com SpirvShaderDebugger: Reduce lock contention

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/swiftshader-skia-autoroll
Please CC scroggo@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Test-Debian10-Clang-GCE-GPU-SwiftShader-x86_64-Debug-All-SwiftShader
Bug: None
Tbr: scroggo@google.com
Change-Id: Iefa184af3d10b903845bdbc8191071882af4c75d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317036
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-09-15 04:38:31 +00:00
Mike Klein
2bc4077c9e notes on bazel
I have been hacking around on Bazel more today,
and while I think it was a day well spent, I've
got intentionally nothing to commit except notes.

Change-Id: I711eaf403e447aff5b19830d3ed8c5132c98c469
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316910
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-09-14 23:27:37 +00:00
John Stiles
b0245494c6 Convert several SkSL->GLSL unit tests to golden outputs.
The new test files are intended to be identical to the unit tests in
every meaningful way. (Comments and formatting are not preserved
exactly.) In cases where a unit-test method contained more than one
test, multiple test files were created; in these cases, new names were
invented to match the apparent intent of each invocation.

Followup CLs will continue to migrate additional tests.

Change-Id: I785c6761ba7ee2b25b5ddc0108321734be23b77c
Bug: skia:10694
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316678
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-09-14 22:11:20 +00:00
John Stiles
ea9e7ca1ce Support testing error cases in our SkSL unit test goldens.
Change-Id: I56e19153597e2c4393c5821314b82937828c0d50
Bug: skia:10694
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316569
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-09-14 21:23:07 +00:00
John Stiles
eaed918a1d Disable whole-program inliner.
This can be re-enabled once the Metal bug with fp_sample_chaining is
diagnosed and fixed.

A pure rollback led to a merge conflict; just commenting out the line
that invokes the inliner serves the same purpose.

Change-Id: I4df556ea8cd44349cbca2ea0ec9995dfffeb8aec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316937
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-09-14 20:58:47 +00:00
Greg Daniel
37fd658981 Add input attachment support to program building.
This is also the final wire to connect, so with this CL we will try
using input attachments for dst blends in available.

Bug: skia:10409
Change-Id: I8bd953ea5eb056a55d8bf36d91008a9d7298d84d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315650
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-09-14 19:59:47 +00:00
Greg Daniel
6253b5787d Remove command buffer reset bit from vk command pool.
We always reset the entire command pool so we don't need to create the
pool with support for resetting individual command buffers. This may
or may not give us perf and/or memory wins.

Change-Id: I172362b49444a80f4e91958120d165c130598a98
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316656
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-09-14 19:18:27 +00:00
Brian Osman
01a3eb44af SkSL: When simplifcation requires a rescan, do it right away
Fixes a use-after-free where switch statements were replaced by the
statically-determined case, but there were other (later) blocks in the
list that still had pointers into the no-longer-valid cases.

Bug: oss-fuzz:25554
Change-Id: I23b80d66d49a251b59ce02d74f31996858c04395
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316876
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-09-14 18:42:57 +00:00
Brian Osman
0acb5b50b3 Allow casting to lower precision types in runtime effects
Bug: skia:10679
Change-Id: If464c48b7c31d0d8440d1231d1983829d54ce598
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315281
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-09-14 18:08:17 +00:00
Kevin Lubick
b45d0caa55 [fuzz] Make libfuzzer defines backwards compatible for roll
This should fix the chrome roll.

Change-Id: I2de68f972996bf6124cf5cc27dfd538aa1161057
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316877
Auto-Submit: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2020-09-14 17:43:00 +00:00
skia-autoroll
96a505f840 Roll skcms from b1f9041ffe31 to 069b8f699b59 (1 revision)
https://skia.googlesource.com/skcms.git/+log/b1f9041ffe31..069b8f699b59

2020-09-11 mtklein@google.com mostly pointless rename

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skcms-skia-autoroll
Please CC scroggo@google.com,mtklein@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Tbr: scroggo@google.com,mtklein@google.com
Change-Id: Iac25b72067f7c5454e1d8ef58ca36c18cbdb85d3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316901
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-09-14 17:25:17 +00:00
Greg Daniel
569afe11a5 Force linux nvida vulkan to use dedicated image allocations.
This change is in response to the perf regessions we saw when we started
using less dedicated allocations.

Bug: chromium:1127358
Change-Id: Ie0cbf546b92d344712e32b5fc8e56837f49fed67
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316836
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-09-14 17:06:37 +00:00
Adlai Holler
302e8fb771 Downgrade SkImage to GrImageContext
We still occasionally downcast, so this is not airtight,
but it (1) allows us to know where we are downcasting and
(2) lets us move away from GrContext (and hopefully remove
it sooner than later.)

All three canaries are currently broken =( so here we go!

Bug: skia:104662
Change-Id: I84efe132574690b62ea512e194e4f9e318e9c050
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316218
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-09-14 17:01:07 +00:00
Ethan Nicholas
34b19c5750 SkSL optimization now happens in convertProgram rather than being a
separate step.

This ended up uncovering an optimization bug. SkSLNonConstantCase
started failing; it turns out that the optimizer was never being run on
this test, and so we hadn't noticed that it didn't actually work in the
presence of optimization.

Change-Id: Iff1d330be7534113b86f86b00c39f91282903ae3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316568
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-09-14 16:34:47 +00:00
Adlai Holler
d8dfd7a224 Elevate caps methods to GrRecordingContext
This partially unblocks Chrome from migrating from
SkCanvas-getGrContext to SkCanvas-recordingContext.

Change-Id: I1100387497ba8b482005bb1d147e9768590afe95
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316449
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
2020-09-14 15:58:57 +00:00
Greg Daniel
2177436cf8 Update GrVkRenderPasses to be created to support both input attachments and adv blend.
Bug: skia:10409
Change-Id: I90c83e03616b76adb887c087f7f22941bd776d8c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316356
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-09-14 15:43:13 +00:00
Mike Klein
c1cc1d85ab bazel baby steps
A few first steps toward a Bazel build.

To try it out, I think just

    $ bazel test ...

I added third_party to .bazelignore to prevent Bazel from looking there.
It can handle external dependencies itself, so no need to poke into what
we sync from DEPS.  Some of those have Bazel configs and we don't want
to be building them yet.

I've started by with libpng using new_git_repository(), mostly because
it's small, with a mildly complex build, and needs dependencies of its
own, zlib.  Mysteriously zlib is built-in to Bazel, so that was easy.

Next up is probably a dependency that does support Bazel, using
git_repository().  That should make sure we can handle the full mix.

Change-Id: I5775a1b254d341b9a90630aa1cc433a24167f2fd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316636
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
2020-09-14 15:18:32 +00:00
John Stiles
d836f84ab8 Generate SkSL golden output files from test inputs during the build.
Golden SkSL outputs are intended to eventually replace the majority of
our unit tests, since they can automatically update themselves when we
change implementation details of the compiler.

If you change the compiler output without updating the Golden files, the
CheckGeneratedFiles housekeeper will be triggered. Set
`skia_compile_processors` or `skia_compile_sksl_tests` to true in your
GN args to regenerate them.

Almost all of the tests from SkSLFPTests.cpp and SkSLGLSLTests.cpp can
be migrated into separate unit-test .fp/.sksl files in a followup CL.

hcm@ has signed off on removing the copyright boilerplate preamble from
our unit test files.

Change-Id: I9e24a944bbac8f8efd62c92481b022a0b1ecdd0b
Bug: skia:10694
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316336
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-09-14 14:54:12 +00:00
John Stiles
915a38c688 Enable the inlining pass during optimization.
In this CL, the IR generator still performs inlining as well; this will
be removed in a followup CL. However, the optimization pass is able to
find more inlining opportunities because it allows itself to exceed
the 50-IRNode limit when a function is only used once. In our test code
this is uncommon, but in SkSL generated from trees of fragment
processors, it is very common; any FP that is only sampled once tends
to qualify.

Change-Id: I8b2f653b2dd05d4de18bb15f3a4c1f034b8252ad
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315639
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-09-14 14:38:42 +00:00
Kevin Lubick
493f89e577 [fuzz] Standardize, document, and backport fuzzing defines.
We had several defines around the code base that were not
very descriptive. Additionally, we had a patch of extra
runtime restrictions living in oss-fuzz that were applied
when fuzzing over there for some fuzzers.

This has all be consolidated and controlled via the defines
documented in site/dev/testing/fuzz.md

As such, we can remove one of the patches that is in oss-fuzz,
taking us closer to being able to fuzz in the CI/CQ.

PS 1 renames existing fuzz defines to the new schema.
PS 2-3 backports skia.diff from oss-fuzz and changes those
definitions to have the _GREATLY modifier.
PS 5+ further condenses the defines so that there is one
define for gating the runtime checks.

Change-Id: Ia4ad96f30c1e9620a2123b510e97c6f501a2e257
Docs-Preview: https://skia.org/?cl=316443
Bug: skia:10713
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316443
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-09-14 13:36:10 +00:00
skia-autoroll
081bc32703 Roll Chromium from d14e6a0b90c2 to 2ab7a04e4589 (486 revisions)
d14e6a0b90..2ab7a04e45

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/chromium-skia-autoroll
Please CC scroggo@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Perf-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-CommandBuffer;skia/skia.primary:Test-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-CommandBuffer
Tbr: scroggo@google.com
Change-Id: Ic935dd69eecc89933cbb039a12aa259e0577430d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316747
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-09-14 04:55:40 +00:00
skia-autoroll
3b0d5d454a Roll ANGLE from 0c8f66c7169c to 183a454b9d54 (14 revisions)
0c8f66c716..183a454b9d

2020-09-12 jmadill@chromium.org Test Runner: Use standard isolate script args.
2020-09-12 m.maiya@samsung.com EGL: Refcount external AHB when backing an image
2020-09-12 jmadill@chromium.org TestRunner: Fix missing "=" on swarming args.
2020-09-11 m.maiya@samsung.com EGL: Fix a bug in ImageTest
2020-09-11 angle-autoroll@skia-public.iam.gserviceaccount.com Roll VK-GL-CTS from a48ed7c29144 to b045bf7d3b6a (9 revisions)
2020-09-11 jmadill@chromium.org Add a perf test that cycles through many VBOs.
2020-09-11 syoussefi@chromium.org Vulkan: Fix RAW hazard with storage images
2020-09-11 geofflang@google.com Flush less frequently in QueryGL.
2020-09-11 courtneygo@google.com Vulkan: Use current commandBuffer pointer
2020-09-11 courtneygo@google.com Enable precision qualifiers.
2020-09-11 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-ValidationLayers from fcb7ecbe49c5 to 3114c91b037b (3 revisions)
2020-09-11 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from b24900a1aa39 to 41974f57973e (1 revision)
2020-09-11 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-Tools from ccab4cc42372 to d19622688af4 (1 revision)
2020-09-11 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 30a5da059e5d to fe51fcb522cc (441 revisions)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/angle-skia-autoroll
Please CC scroggo@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Release-ANGLE;skia/skia.primary:Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC8i5BEK-GPU-IntelIris655-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Debug-All-ANGLE
Bug: chromium:1078754
Tbr: scroggo@google.com
Change-Id: I7da61b51d5cd50aaf13a2f39591881809365540e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316746
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-09-14 04:47:00 +00:00
skia-autoroll
7a588f80c2 Roll SwiftShader from 41974f57973e to dc552fcef1fe (1 revision)
https://swiftshader.googlesource.com/SwiftShader.git/+log/41974f57973e..dc552fcef1fe

2020-09-11 capn@google.com Drop the float literal suffix

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/swiftshader-skia-autoroll
Please CC scroggo@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Test-Debian10-Clang-GCE-GPU-SwiftShader-x86_64-Debug-All-SwiftShader
Bug: None
Tbr: scroggo@google.com
Change-Id: Ib95602b0aa9f3daccbadcba8924444c604398d7f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316745
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-09-14 04:44:00 +00:00
skia-autoroll
81a7629b20 Roll dawn from 948b3a05550b to dbd34449af20 (2 revisions)
https://dawn.googlesource.com/dawn.git/+log/948b3a05550b..dbd34449af20

2020-09-11 cwallez@chromium.org Roll third_party/spirv-cross/ bad9dab8d..bdbef7b1f (3 commits)
2020-09-11 cwallez@chromium.org Fix typo in README.md

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dawn-skia-autoroll
Please CC cwallez@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Debug-Dawn
Bug: None
Tbr: cwallez@google.com
Change-Id: I5988f29eededf441df37c43b92155d805ad8e348
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316744
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-09-14 04:31:40 +00:00
skia-recreate-skps
b711737c13 Update SKP version
Automatic commit by the RecreateSKPs bot.

TBR=rmistry@google.com
NO_MERGE_BUILDS

Change-Id: I81ef1bca2a4bb8a7ac5040677f3a0e22c37fb299
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316740
Reviewed-by: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
Commit-Queue: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
2020-09-13 08:44:45 +00:00
Mike Reed
186866c461 expose clear way to create default mips
Change-Id: Id533b71d56fc44d8f86db24c5c4e9131d57479a5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316716
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-09-12 15:19:15 +00:00
Chris Dalton
582c5a9a84 Fix assert on tessellated stroke join type
Change-Id: Ife539625656dd379a6ab5797bcfe5511dfda1e3d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316477
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-09-11 21:37:44 +00:00
Brian Osman
9eb848ae82 Give SwitchCase it's own Statement::Kind value
Disambiguates Switch from SwitchCase, and makes is() and as() work.

Change-Id: I9b9b71dabd730247b20ec9b6df02b87e4978d534
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316577
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2020-09-11 20:46:44 +00:00
Ben Wagner
e4383b8f1e Add SkFILEStream constructor which takes a size.
Allows the user to limit the stream to a subset of the entire file.
SkFILEStream uses the current FILE position as the base position for the
stream; this allows the user to further limit the length of the stream
to a range of bytes in the file.

Change-Id: I36131ff19e75b65d501eabdfd9368f8fbb2e177f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316357
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-09-11 19:50:24 +00:00
Ben Wagner
bb60c2149e Refactor SkFILEStream for clarity.
Rename fSize to fEnd (since it is actually the offset of the end
underlying file, not the size of the file), fOriginalOffset to
fStart, and fOffset to fCurrent. Also initialize in the order fEnd,
fStart, then fCurrent to maintain the invariant that fCurrent should
always be kept within the range of fStart and fEnd, inclusive.

Change-Id: I8801288320cf82b071e4621c0e770ce16016953a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316453
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-09-11 19:49:04 +00:00