Commit Graph

1024 Commits

Author SHA1 Message Date
Mike Klein
4f4c064d5b roll gn to latest
Nice periodically, and this version also has a Mac arm64 binary.

Refine a few visibility rules from ":*" (any target in this file)
to "./*" (any target in any .gn file anywhere under this directory).

Use frameworks over libs where now required.

Change-Id: Ic19e1533e2810d18ae4684645d8555b422320b7f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354536
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-01-15 15:34:00 +00:00
Weston Tracey
6d4577bc52 [fuzzing] Add first pass SkParagraph fuzzing.
Rough first pass at SkParagraph fuzzing. Lots of things not yet fuzzed.
--FontCollection cribbed from SkParagraphTest
--Current flow:
---Fuzz ParagraphStyle
---Add text and style some random small number of times.
---Text is either ASCII, unicode, or 'Zalgo'.

Although there are many todos, want to go ahead and submit this
~unchanged so the existing test cases that have found bugs are
not invalidated by a changing binary.

Change-Id: I38adca5fa79cfb20068fdf2fb431f90de55a2afc
Bug: skia:10894
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336438
Commit-Queue: Weston Tracey <westont@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-12-30 19:24:17 +00:00
Joe Gregorio
7ae1b4cae7 Add particles and svg support to fiddle.
Change-Id: If7b0a8ca7f9555e863117f86612ce1e96bd0d2ec
Bug: skia:10906
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347616
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-12-29 16:03:27 +00:00
Brian Osman
a07076b6a8 Fix GN issue with incorrect task outputs
This was preventing the build from reaching steady state when building
SkSL tests.

Change-Id: If891f6858a8a0935fd100092e71115fd44665402
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347052
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-12-23 20:29:38 +00:00
Brian Osman
e9ad19b378 Fix skslc compilation on Windows
Change-Id: Id3762e77df0b1fe69bee1e57d9ccef907279fcb3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347048
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-12-23 20:06:48 +00:00
Brian Osman
977feec5d7 Add .rte -> .skvm unit test framework
Includes a handful of test cases to exercise the system

Change-Id: I98e73a8bca063f475d2ddb51778e395697392ddb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/346637
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-12-22 17:59:42 +00:00
Brian Osman
47726a1cff Add SkVM output to skslc
Change-Id: Ida9d81a8d4e530cb3055f01418a2ad2893ae86db
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345422
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-12-22 15:44:22 +00:00
Brian Osman
9194675a3e SkSL: In the front-end, rename PipelineStage to RuntimeEffect
This maps to usage better, and makes some code simpler to understand.
Note that there is still a PipelineStage *back-end*, which is specific
to the runtime-effect FP. A kRuntimeEffect_Kind program can be used to
generate a PipelineStage (for the GPU backend), or an skvm program (for
the CPU backend).

Change-Id: Id3f535db93a239726c595225aafe9467f0d19817
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344969
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-12-21 21:23:17 +00:00
Florin Malita
dec78021f5 Reland "[svg] Absolute positioning support for text"
This reverts commit e2f6245352.

Reason for revert: relanding with fixes

Original change's description:
> Revert "[svg] Absolute positioning support for text"
>
> This reverts commit febb1b87a5.
>
> Reason for revert: breaking the android roll
>
> Original change's description:
> > [svg] Absolute positioning support for text
> >
> > Implement per-character position attribute lookup based on [1]:
> >
> >   - convert "x" and "y" attributes to arrays
> >   - introduce ScopedPosResolver to handle positioning attribute lookup
> >     and fallback
> >   - push a new resolver every time we enter a text positioning element
> >     scope (<text>, <tspan>, etc).
> >   - flush/reposition a new text chunk every time we encounter explicit
> >     absolute positions
> >
> > The position attribute fallback logic is complex enough to warrant a
> > unit test.
> >
> > [1] https://www.w3.org/TR/SVG11/text.html#TSpanElementXAttribute
> >
> > Bug: skia:10840
> > Change-Id: I66c478fea4a179fdb8b1a6a9ff00c4dd9509f8d2
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345161
> > Commit-Queue: Florin Malita <fmalita@chromium.org>
> > Commit-Queue: Florin Malita <fmalita@google.com>
> > Reviewed-by: Tyler Denniston <tdenniston@google.com>
>
> TBR=fmalita@chromium.org,fmalita@google.com,tdenniston@google.com
>
> Change-Id: I80e3396d555369fe835ee73102135061f63e8bf0
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10840
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345417
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Commit-Queue: Derek Sollenberger <djsollen@google.com>

TBR=djsollen@google.com,fmalita@chromium.org,fmalita@google.com,tdenniston@google.com

# Not skipping CQ checks because this is a reland.

Bug: skia:10840
Change-Id: I4c6f6a9f19c0f7598bdcf34e915f43c139b995a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345420
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2020-12-18 02:09:18 +00:00
Mike Klein
0047afffb0 remove very oldest SkVM testing
None of these earliest testing tools are useful anymore
now that we can do useful work with SkVM and SkVMBlitter.

Change-Id: I8b25ef6ddd101c4ff8617c6742343dedb4764922
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345456
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-12-17 21:17:46 +00:00
Derek Sollenberger
e2f6245352 Revert "[svg] Absolute positioning support for text"
This reverts commit febb1b87a5.

Reason for revert: breaking the android roll

Original change's description:
> [svg] Absolute positioning support for text
>
> Implement per-character position attribute lookup based on [1]:
>
>   - convert "x" and "y" attributes to arrays
>   - introduce ScopedPosResolver to handle positioning attribute lookup
>     and fallback
>   - push a new resolver every time we enter a text positioning element
>     scope (<text>, <tspan>, etc).
>   - flush/reposition a new text chunk every time we encounter explicit
>     absolute positions
>
> The position attribute fallback logic is complex enough to warrant a
> unit test.
>
> [1] https://www.w3.org/TR/SVG11/text.html#TSpanElementXAttribute
>
> Bug: skia:10840
> Change-Id: I66c478fea4a179fdb8b1a6a9ff00c4dd9509f8d2
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345161
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Florin Malita <fmalita@google.com>
> Reviewed-by: Tyler Denniston <tdenniston@google.com>

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

Change-Id: I80e3396d555369fe835ee73102135061f63e8bf0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10840
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345417
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2020-12-17 19:21:37 +00:00
Florin Malita
febb1b87a5 [svg] Absolute positioning support for text
Implement per-character position attribute lookup based on [1]:

  - convert "x" and "y" attributes to arrays
  - introduce ScopedPosResolver to handle positioning attribute lookup
    and fallback
  - push a new resolver every time we enter a text positioning element
    scope (<text>, <tspan>, etc).
  - flush/reposition a new text chunk every time we encounter explicit
    absolute positions

The position attribute fallback logic is complex enough to warrant a
unit test.

[1] https://www.w3.org/TR/SVG11/text.html#TSpanElementXAttribute

Bug: skia:10840
Change-Id: I66c478fea4a179fdb8b1a6a9ff00c4dd9509f8d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345161
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2020-12-17 17:31:25 +00:00
Martin Kustermann
b65d29919d Fix C API example, ensure the C API example is built in CI
Change-Id: I25529ec79bd53dcd475a959503d15b1be7d39970
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344616
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-12-15 16:38:42 +00:00
Jorge Betancourt
f607dbbbe8 implement SkAudioPLayer for Android
move SkAudioPlayer for Android to proper module
refine playback features for the Android AudioPlayer

Change-Id: I1906c3b3ef91fa4173f66c2c068dc40a3cf824ca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319037
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2020-12-15 00:12:48 +00:00
John Stiles
c3012184b5 Fix GN dirty checking for SPIR-V test files.
Previously, GN would never reach steady-state when compiling test files
because SPIR-V listed the incorrect extension for its test files
(.spirv). We can now reach steady-state when building more than once.

Change-Id: If9f6bf7a4722c1ca87b682186f0b7ba451311955
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341976
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-12-08 20:46:53 +00:00
Michael Ludwig
3021795041 Improve CanvasState cross-library tests
Several things are accomplished as part of this:
1. The canvas_state_lib build target is brought back so that we can
   actually test the canvas state sharing across library boundaries.
2. The canvas state helper functions are updated to work with DLLs
   (confirmed tests pass on Windows in cross library mode)
3. The tests now always run, and the cross-state define only changes
   what version of the helper functions are used
4. Updated the dlopen code in the test to use the SkOSLibrary ports
   instead of calling dlopen/dlclose directly.
5. Fix bugs in SkCanvasStateUtils that were uncovered as part of
   always running these tests.
6. Switches the define away from SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
   to SK_TEST_CANVAS_STATE_CROSS_LIBRARY, since these tests are not
   strictly speaking testing the unclipped layer feature.

Change-Id: Id4ae41e4bc3fb8227367deac899878ecf9d7b98e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341003
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-12-04 22:03:25 +00:00
Brian Osman
23f00d7800 Reland "Add ByteCode output to skslc"
Reland fixes link errors in nogpu builds

This reverts commit 5fa45548b4.

Change-Id: I45e0509d0476dde3a7088c1ed66ab0118894b31e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340037
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-12-02 15:19:46 +00:00
Herb Derby
c9a24c9815 default to using new/delete for GrOp
Currently, new/delete is not on for Google3. After this
CL new/delete will be used on all platforms.

Change-Id: Idfc6217b809c9eb986e618ffa575004893b3aa0f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339859
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-12-02 15:15:26 +00:00
Brian Osman
5fa45548b4 Revert "Add ByteCode output to skslc"
This reverts commit 68da339a11.

Reason for revert: Breaking Android roll

Original change's description:
> Add ByteCode output to skslc
>
> Change-Id: I447f56a3ef464ef9a3cfc644f6ef4e4ab4e08a62
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339498
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: John Stiles <johnstiles@google.com>

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

Change-Id: Ie02d03dacc3b5ea33538d11dbb1241b8fe31fd86
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340036
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-12-02 14:14:08 +00:00
Brian Osman
68da339a11 Add ByteCode output to skslc
Change-Id: I447f56a3ef464ef9a3cfc644f6ef4e4ab4e08a62
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339498
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-12-01 20:53:55 +00:00
Brian Osman
8d09d4ace9 Run SPIR-V validation on SkSL unit test output
Fiddled with the logic a bit so that when we're in unit test mode, the
output still includes all of the SPIR-V (as well as the validation error
message), so that tracking them down is easier.

Bug: skia:10694
Change-Id: I15e7777af3d268a5952765dbe5d63612cad0ac07
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338320
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-11-24 22:07:56 +00:00
John Stiles
dda1d31623 Enable SPIR-V disassembly output from skslc.
We now have SPIR-V golden outputs for `blend` and `shared` tests.
This exposes a handful of SPIR-V limitations for us to address.

Change-Id: Ie5278889b8a61432403d06231b17765885bee0ac
Bug: skia:10694
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337182
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-11-20 22:54:26 +00:00
Leon Scroggins
1340dbde91 Reland "SkAndroidCodec: Support decoding all frames"
This is a reland of fc4fdc5b25

Original change's description:
> SkAndroidCodec: Support decoding all frames
>
> Bug: b/160984428
> Bug: b/163595585
>
> Add support to SkAndroidCodec for decoding all frames with an
> fSampleSize, so that an entire animation can be decoded to a smaller
> size.
>
> dm/:
> - Test scaled + animated decodes
>
> SkAndroidCodec:
> - Make AndroidOptions inherit from SkCodec::Options. This allows
>   SkAndroidCodec to use fFrameIndex. (It also combines the two versions
>   of fSubset, which is now const for both.)
> - Respect fFrameIndex, and call SkCodec::handleFrameIndex to decode
>   the required frame.
> - Disallow decoding with kRespect + fFrameIndex > 0 if there is a
>   non-default orientation. As currently written (except without
>   disabling this combination), SkPixmapPriv::Orient would draw the new
>   portion of the frame on top of uninitialized pixels, instead of the
>   prior frame. This could be fixed by
>   - If SkAndroidCodec needs to decode the required frame, it could do so
>     without applying the orientation, then decode fFrameIndex, and then
>     apply the orientation.
>   - If the client provided the required frame, SkAndroidCodec would need
>     to un-apply the orientation to get the proper starting state, then
>     decode and apply.
>   I think it is simpler to force the client to handle the orientation
>   externally.
>
> SkCodec:
> - Allow SkAndroidCodec to call its private method handleFrameIndex. This
>   method handles decoding a required frame, if necessary. When called by
>   SkAndroidCodec, it now uses the SkAndroidCodec to check for/decode the
>   required frame, so that it will scale properly.
> - Call rewindIfNeeded inside handleFrameIndex. handleFrameIndex calls a
>   virtual method which may set some state (e.g. in SkJpegCodec). Without
>   this change, that state would be reset by rewindIfNeeded.
> - Simplify handling a kRestoreBGColor frame. Whether provided or not,
>   take the same path to calling zero_rect.
> - Updates to zero_rect:
>   - Intersect after scaling, which will also check for empty.
>   - Round out instead of in - this ensures we don't under-erase
>   - Use kFill_ScaleToFit, which better matches the intent.
>
> Change-Id: Ibe1951980a0dca8f5b7b1f20192432d395681683
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333225
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>

Bug: b/160984428
Bug: b/163595585
Change-Id: I7c1e79e0f92c75b4840eef65c8fc2b8497189e81
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334842
Auto-Submit: Leon Scroggins <scroggo@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2020-11-16 16:55:48 +00:00
Leon Scroggins III
267a8589d3 Revert "SkAndroidCodec: Support decoding all frames"
This reverts commit fc4fdc5b25.

Reason for revert: Google3 and ASAN failures

Change-Id: I890cd76109c0375391637f879550837d01e650f9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334840
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2020-11-13 16:20:39 +00:00
Leon Scroggins
fc4fdc5b25 SkAndroidCodec: Support decoding all frames
Bug: b/160984428
Bug: b/163595585

Add support to SkAndroidCodec for decoding all frames with an
fSampleSize, so that an entire animation can be decoded to a smaller
size.

dm/:
- Test scaled + animated decodes

SkAndroidCodec:
- Make AndroidOptions inherit from SkCodec::Options. This allows
  SkAndroidCodec to use fFrameIndex. (It also combines the two versions
  of fSubset, which is now const for both.)
- Respect fFrameIndex, and call SkCodec::handleFrameIndex to decode
  the required frame.
- Disallow decoding with kRespect + fFrameIndex > 0 if there is a
  non-default orientation. As currently written (except without
  disabling this combination), SkPixmapPriv::Orient would draw the new
  portion of the frame on top of uninitialized pixels, instead of the
  prior frame. This could be fixed by
  - If SkAndroidCodec needs to decode the required frame, it could do so
    without applying the orientation, then decode fFrameIndex, and then
    apply the orientation.
  - If the client provided the required frame, SkAndroidCodec would need
    to un-apply the orientation to get the proper starting state, then
    decode and apply.
  I think it is simpler to force the client to handle the orientation
  externally.

SkCodec:
- Allow SkAndroidCodec to call its private method handleFrameIndex. This
  method handles decoding a required frame, if necessary. When called by
  SkAndroidCodec, it now uses the SkAndroidCodec to check for/decode the
  required frame, so that it will scale properly.
- Call rewindIfNeeded inside handleFrameIndex. handleFrameIndex calls a
  virtual method which may set some state (e.g. in SkJpegCodec). Without
  this change, that state would be reset by rewindIfNeeded.
- Simplify handling a kRestoreBGColor frame. Whether provided or not,
  take the same path to calling zero_rect.
- Updates to zero_rect:
  - Intersect after scaling, which will also check for empty.
  - Round out instead of in - this ensures we don't under-erase
  - Use kFill_ScaleToFit, which better matches the intent.

Change-Id: Ibe1951980a0dca8f5b7b1f20192432d395681683
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333225
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2020-11-12 21:31:41 +00:00
Martin Vejdarski
ed435953df Fix issues with latest GN
Change-Id: I9490479242a025fa1f5ff84a556ae43d8de4c19a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332897
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-11-07 13:55:45 +00:00
Brian Osman
b06301ee12 Reland "Rearrange SkSL pre-include modules to hide things"
This reverts commit 4cb5c5e172, and fixes
the Chromium issue by declaring sign(x) in sksl_public.sksl.

Original description:

This makes numerous internal and GLSL types or intrinsics hidden from
public (runtime effect) SkSL. In particular:

- Only core numeric types are visible to all program types. GLSL types
  involving images, textures, and sampling are restricted to internal use.
- sk_Caps is no longer visible to runtime effects.
- The set of intrinsics available to runtime effects is now a separate,
  curated list in sksl_public.sksl. It exactly matches the GLSL ES 1.00
  spec order.
- The blend intrinsics are no longer visible, which also fixes a bug.
  These are nice, but we're not going to offer them yet - they involve
  enums, which creates complications.

Bug: skia:10680
Bug: skia:10709
Bug: skia:10913

Cq-Include-Trybots: luci.chromium.try:linux-chromeos-rel,linux-rel
Change-Id: I42deeeccd725a9fe18314d091ce253404e3572e2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332750
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-11-06 19:28:34 +00:00
Brian Osman
4cb5c5e172 Revert "Rearrange SkSL pre-include modules to hide things"
This reverts commit bea0dc67f4.

No-Try: true
Change-Id: I7b000de199dc23bd3719a4ee835b2a8d3c93fefd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332747
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-11-06 16:30:35 +00:00
Brian Osman
bea0dc67f4 Rearrange SkSL pre-include modules to hide things
This makes numerous internal and GLSL types or intrinsics hidden from
public (runtime effect) SkSL. In particular:

- Only core numeric types are visible to all program types. GLSL types
  involving images, textures, and sampling are restricted to internal use.
- sk_Caps is no longer visible to runtime effects.
- The set of intrinsics available to runtime effects is now a separate,
  curated list in sksl_public.sksl. It exactly matches the GLSL ES 1.00
  spec order.
- The blend intrinsics are no longer visible, which also fixes a bug.
  These are nice, but we're not going to offer them yet - they involve
  enums, which creates complications.

Bug: skia:10680
Bug: skia:10709
Bug: skia:10913

Change-Id: I8fa1c94f6e4899f38530bb9cff33d147f6983ab3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332597
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-11-05 21:44:40 +00:00
John Stiles
23e68668d8 Reland "Replace pooling mechanism with GrMemoryPool."
This is a reland of 67e1cf4b1d

The iOS 8 code path now compiles normally

Original change's description:
> Replace pooling mechanism with GrMemoryPool.
>
> This change is a wash for tests that could fit inside the previous
> hard-coded pool (512 nodes) and appears to be a 5% improvement for
> sksl_large. Larger programs would hypothetically show an even more
> significant improvement.
>
> When SK_SUPPORT_GPU is disabled, we disable pooling entirely and fall
> back to the system allocator. This is necessary because SkSL can exist
> without Ganesh (such as in the wasm+CanvasKit build).
>
> Nanobench: http://screen/4xJEzdGducRxGeq
>
> Change-Id: I71dc702a84ab5c163673e35ec651003d7d45dacd
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330219
> Commit-Queue: John Stiles <johnstiles@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>

Change-Id: Iced330084f1ed8997e19bbee585422cb89e1c6b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330404
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-10-29 15:19:13 +00:00
John Stiles
b3cc5fdf53 Revert "Replace pooling mechanism with GrMemoryPool."
This reverts commit 67e1cf4b1d.

Reason for revert: iOS 8

Original change's description:
> Replace pooling mechanism with GrMemoryPool.
>
> This change is a wash for tests that could fit inside the previous
> hard-coded pool (512 nodes) and appears to be a 5% improvement for
> sksl_large. Larger programs would hypothetically show an even more
> significant improvement.
>
> When SK_SUPPORT_GPU is disabled, we disable pooling entirely and fall
> back to the system allocator. This is necessary because SkSL can exist
> without Ganesh (such as in the wasm+CanvasKit build).
>
> Nanobench: http://screen/4xJEzdGducRxGeq
>
> Change-Id: I71dc702a84ab5c163673e35ec651003d7d45dacd
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330219
> Commit-Queue: John Stiles <johnstiles@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>

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

Change-Id: I26dbd7f2d5348dd717c39fd0780ee5d140292e9a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330416
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-10-29 14:11:25 +00:00
John Stiles
67e1cf4b1d Replace pooling mechanism with GrMemoryPool.
This change is a wash for tests that could fit inside the previous
hard-coded pool (512 nodes) and appears to be a 5% improvement for
sksl_large. Larger programs would hypothetically show an even more
significant improvement.

When SK_SUPPORT_GPU is disabled, we disable pooling entirely and fall
back to the system allocator. This is necessary because SkSL can exist
without Ganesh (such as in the wasm+CanvasKit build).

Nanobench: http://screen/4xJEzdGducRxGeq

Change-Id: I71dc702a84ab5c163673e35ec651003d7d45dacd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330219
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-10-28 22:00:44 +00:00
Mike Klein
40f8107eab remove absl experiment
We've given up on Abseil, and these warnings are annoying:

    ... libtool: warning same member name (libabsl.escaping.o) ...

Bug: skia:10165
Change-Id: I144573206174cbe9b48fce8e86ed22eb4a4e29b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329937
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-10-27 13:45:10 +00:00
Tyler Denniston
189ecd485a Add toy variable-width stroker sample
- Currently supports single-segment paths (lines or quads). Doesn't
  handle joins.
- Cubics are easy to add but not supported yet.
- No effort was made on performance optimization.
- Will likely be relocated eventually into an experimental SkPathEffect.

Change-Id: I35073d1d9dbc03a5423fda3bb20da005964c97d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329256
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-10-26 14:43:03 +00:00
John Stiles
060503ec27 Use SkMutex in SkSL.
Change-Id: I1b14e4c8de0ca60a0ebbdbc225befc5074e8de22
Bug: skia:10862
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329177
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-10-22 19:47:00 +00:00
Florin Malita
b3418103e9 Reland "[svg] Relocate out of experimental"
Move the SVG rendering code to modules/svg, and componentize.
Also split into include/src/utils.

As external clients still reference the old header locations,
introduce temporary forwarding headers to facilitate the migration.

This reverts commit d6cf56fd34.

TBR=

Change-Id: Ibadd7c8dc0464ec0c27841530ade0c2098305d20
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327344
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
2020-10-16 02:32:41 +00:00
Robert Phillips
d6cf56fd34 Revert "[svg] Relocate out of experimental"
This reverts commit 6fc4106a9d.

Reason for revert: Blocking the Android roll

Original change's description:
> [svg] Relocate out of experimental
>
> Move the SVG rendering code to modules/svg, and componentize.
> Also split into include/src/utils.
>
> As external clients still reference the old header locations,
> introduce temporary forwarding headers to facilitate the migration.
>
> Change-Id: Ib289dbdcd80c16a01c47805e7242f2e08bebc165
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326948
> Reviewed-by: Tyler Denniston <tdenniston@google.com>
> Commit-Queue: Florin Malita <fmalita@google.com>

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

Change-Id: I386cf77a15a9e1d392029804abaf937dae53f435
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327342
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-10-15 18:54:18 +00:00
Florin Malita
6fc4106a9d [svg] Relocate out of experimental
Move the SVG rendering code to modules/svg, and componentize.
Also split into include/src/utils.

As external clients still reference the old header locations,
introduce temporary forwarding headers to facilitate the migration.

Change-Id: Ib289dbdcd80c16a01c47805e7242f2e08bebc165
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326948
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2020-10-15 14:36:06 +00:00
Florin Malita
3bfeab7d95 Reland [svg] Add svg_tool
A simple svg -> png converter, to demonstrate basic API usage.

TBR=

Change-Id: Id723946e2c1cbdaf324a24202279cb6a6d7082b6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325460
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2020-10-12 16:18:27 +00:00
Robert Phillips
91c752a014 Revert "[svg] Add svg_tool"
This reverts commit 2531de9926.

Reason for revert: Breaking some builds

Original change's description:
> [svg] Add svg_tool
>
> A simple svg -> png converter, to demonstrate basic API usage.
>
> TBR=
> Change-Id: I34417c437b91e97811f5db512a9e79aa5cc099b8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325336
> Reviewed-by: Florin Malita <fmalita@google.com>
> Commit-Queue: Florin Malita <fmalita@google.com>
> Commit-Queue: Florin Malita <fmalita@chromium.org>

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

Change-Id: I59117a1764a3a98bd910a3a76a44d9bba8bc2de4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325456
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-10-12 13:49:49 +00:00
Florin Malita
2531de9926 [svg] Add svg_tool
A simple svg -> png converter, to demonstrate basic API usage.

TBR=
Change-Id: I34417c437b91e97811f5db512a9e79aa5cc099b8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325336
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2020-10-12 02:24:36 +00:00
Brian Salomon
f9b0042423 Expose ManagedBackendTexture from BackendTextureImageFactory.
Add helper to create self-managed BackendTexture-backed SkSurface for
tests using MBET.

GrGpu::createTestingOnlyBackendRenderTarget supports protected.

Make SkSurfaceCharacterization tests use self-managed SkSurface
factories and a use case of MakeFromBackendTextureAsRenderTarget is
removed.

Use self-managed BackendTexture-backed SkSurface factory in DM sinks and
in fm.

Bug: skia:9832

Change-Id: I0c1dc49697f8b3c942864e18b9112a3552f431ba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323559
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-10-08 20:35:32 +00:00
Kevin Lubick
0039874105 [canvaskit] POC bindings for testing gms
In this CL, I forked compile.sh and created a new gm_bindings.cpp.
I also moved viewer.html into wasm_tools and created a gmtests.html
for testing out the bindings locally.

Right now there is only one gm file compiled in. I plan in a followup
CL to have some way to generate the list of cpp files that need to
be compiled in from gms.gni. I was unable to get it to work with
simply linking the lib_gm.gni, probably due to the same issue with
Registry that csmartdalton@ ran into when adding viewer.html
and the associated bindings.

Suggested reviewing order:
 - gmtests.html to get a sense of how the test flow works.
 - gm_bindings.cpp to make sure I setup the contexts/GMs correctly.
 - compile_gm.sh to see how the gms are compiled in.
 - The remaining files in any order.

When I tested this locally, the bleed_downscale digest was
exactly the same (pixel for pixel, byte for byte) as a known
digest in Gold, so I'm fairly confident in how things work.

Change-Id: I2babef848ca60f7db74e4adf27b8952a66bdeee1
Bug: skia:10812
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322956
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2020-10-08 16:03:08 +00:00
Sylvain Defresne
8d921a16f8 build: Remove no-op calls to set_sources_assignment_filter
Chromiun no longer use set_sources_assignment_filter() anywhere in the
build, so these are no longer needed.

Bug: chromium:1018739
Change-Id: I0e460922947430ed357838ff4196516d19c382a5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323636
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-10-07 19:43:32 +00:00
Mike Klein
56a6120b0f retry³ absl
This merges the two CLs we've been considering,

    1) the first attempt,
       https://skia-review.googlesource.com/c/skia/+/286070;
    2) the roll to latest Abseil LTS branch,
       https://skia-review.googlesource.com/c/skia/+/323076.

(See also the second attempt,
https://skia-review.googlesource.com/c/skia/+/322976.)

We'll need this working in Google3 or punt like we have for Android.

Bug: skia:10165
Cq-Include-Trybots: luci.skia.skia.primary:Canary-G3
Change-Id: Ifb42c1bb2c5e70848208d17b841cdb67bd36e182
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323158
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-10-07 01:36:15 +00:00
Mike Klein
3c70f0bf12 Revert "retry retry absl"
This reverts commit 33b42e12ab.

Reason for revert: Google3 roll

Original change's description:
> retry retry absl
>
> Identical to https://skia-review.googlesource.com/c/skia/+/286070.
>
> 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,Build-Debian10-Clang-arm64-Debug-Android_ASAN
> Change-Id: I0ec9d5f6875768e665f444e1ada211d3da537678
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322976
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: John Stiles <johnstiles@google.com>

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

Change-Id: I4186e85ede18caebfac59b784700e69bf9401901
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
Cq-Include-Trybots: Build-Debian10-Clang-arm64-Debug-Android_ASAN
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323156
Reviewed-by: Mike Klein <mtklein@google.com>
2020-10-06 17:57:47 +00:00
Herb Derby
bbfc015802 turn on using new for op pools
Change-Id: I308dda52c259e1a23d14395d9a632fe2eafab19f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323016
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-10-06 17:40:51 +00:00
Mike Klein
33b42e12ab retry retry absl
Identical to https://skia-review.googlesource.com/c/skia/+/286070.

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,Build-Debian10-Clang-arm64-Debug-Android_ASAN
Change-Id: I0ec9d5f6875768e665f444e1ada211d3da537678
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322976
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-10-06 16:52:31 +00:00
Brian Salomon
72c7b98ae3 Start removal of tool usage of SkSurface::MakeFromBackendTextureAsRenderTarget.
Adds a new helper that creates a GrBackendRenderTarget using
GrGpu and then wraps it in a SkSurface. Uses the SkSurface
release proc to delete the BERT using GrGpu.

Upgrades GrGpu::createTestingOnlyBackendRenderTarget to create MSAA
buffers.

Updates many tests/tool to call sites to use the helper instead of
SkSurface::MakeFromBackendTextureAsRenderTarget.

Adds syncToCpu bool to SkSurface:: and GrContext::flushAndSubmit.

Bug: skia:9832

Change-Id: I73a8f0ce09dc6523729af0814464c6b6657fda06
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293683
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-10-06 16:32:11 +00:00
Brian Osman
a6ca9757d3 Let skslc use more of Skia's core
With these changes, SkTArray/SkSTArray can be used.

Change-Id: Ibf9a720086ac4342157a665786afac713d56c300
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321786
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-10-02 20:58:54 +00:00