Commit Graph

48570 Commits

Author SHA1 Message Date
Greg Daniel
6c6caf420a Add GrBackendMutableState object to handle shared texture state.
This is will be the main struct used to synchronize changes of certain
texture/image between clients and Skia. With this change we
implement support for the Vulkan shared state as POC.

Bug: skia:10254
Change-Id: I10543357635c347838b193874e4da4496a0dcf06
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292311
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-05-29 16:53:08 +00:00
Michael Ludwig
c453a507e4 Rename fIH variable to fInvH
Change-Id: I742d684a6375f48f4612c9db7d12693b1813d778
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292850
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Weston Tracey <westont@google.com>
2020-05-29 16:44:29 +00:00
Chris Dalton
a3908ef970 Merge PathText samples into one, with different modes
Change-Id: I640cd522c1c83f7534c86ebfd6a6f3904fb90206
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292734
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-05-29 16:35:25 +00:00
Nigel Tao
5dbc3f87e7 Fix markdown typo in the style guide
Change-Id: I58a67d145ee088142c2791f7b447beaaf93aef56
No-Try: true
Docs-Preview: https://skia.org/?cl=292496
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292496
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2020-05-29 16:24:57 +00:00
Stephen White
fdba6c8b76 Modify SurfaceTest to only test readbacks from supported surfaces.
Dawn: support readbacks in caps only from Texture-based surfaces.
Change-Id: I3681b9418f592d9c511931cb422f0f8fb113ff73
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291973
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2020-05-29 16:21:45 +00:00
Brian Osman
5d7759e1f4 Minor cleanup in the sample_matrix GMs
While trying to debug matrix sampling, I wanted to make these
easier to work with.

Change-Id: I24889277e7bf0dbdabf012028248c32641c98232
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292838
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-05-29 16:11:45 +00:00
Robert Phillips
5dbcca5634 Update DDL test harness to better match OOP-R
OOP-R, on the gpu thread, creates the DDL, pre-compiles its shaders, draws it, flushes and then deletes the DDL. This process triggered a bug (cf. https://skia-review.googlesource.com/c/skia/+/292818 and crbug.com/1056730).

Prior to this CL all the programs were compiled and only at the end was any work flushed - thus it was likely that the bound program would be reset to the correct value when rendering.

With this CL, the addition of the flush right before the DDL deletion, makes it more likely that the wrong program will be bound when rendering begins.

Change-Id: I60479bd429e132d8652bbffde6c8b71094be6225
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292257
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-05-29 15:58:05 +00:00
Nathaniel Nifong
59d299ba3f Record code coverage in canvaskit tests, increase coverage
Fix a bug with paragraph text direction that an incorrect unit test wasn't detecting.

Change-Id: I73418ea8a90da097078d93ddf8692a55488f672f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292366
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-05-29 15:53:35 +00:00
Herb Derby
a727122007 Move hasW to SubRun
Ecapsulate SubRunType better by moving hasW
to subRun.

* Split out implementation of firstSubRun()

Change-Id: Ibb037d495a921c99f318596992187b1b3c1e0725
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292842
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-05-29 15:20:22 +00:00
Robert Phillips
df546db4d8 Make GrGLProgram inform GrGLGpu when it changes the bound program
This error "worked" in normal rendering since Ganesh would always immediately use the same program after it was compiled. This is no longer true with pre-compilation of a DDL's programs.

Bug: 1056730

Change-Id: I9abbb8ecbd0612dfb828e6cc0888e9db09850048
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292818
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-05-29 15:14:57 +00:00
Michael Ludwig
7c12e28cf4 Reland "GrClips provided as pointers to GrRTC"
This reverts commit 074414fed5.

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

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

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

# Not skipping CQ checks because this is a reland.

Bug: skia:10205
Change-Id: I5715a4de3b7c8847b73020dc4937d3816d879803
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292876
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-05-29 15:09:54 +00:00
Brian Salomon
c0d88a12d1 Remove SkSurface::MakeFromBackendTextureAsRenderTarget from public API
Still some more work to do to remove internal usage.


Bug: skia:9832
Change-Id: Id0403d92debc26af2002630a4dfcf960c9343260
Docs-Preview: https://skia.org/?cl=292719
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292719
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-05-29 15:09:52 +00:00
Ben Wagner
19ef693adc Remove last unistr.h include.
No longer used, but managed to avoid previous capture by being included
in quotes instead of brackets. Do some iwyu while at it.

Change-Id: I838474132995ca130c93f94beaab606828504309
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292733
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-05-29 15:04:49 +00:00
Nathaniel Nifong
07821def6c Performance test of color conversion
Change-Id: I77261450d67746da0ba94f02a23615b7c9a634e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292563
Reviewed-by: Elliot Evans <elliotevans@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2020-05-29 15:04:48 +00:00
Brian Osman
921cdbb387 Fix dimensions of color_cube_rt slide
Change-Id: Ic6d26b1e3126298ac0de3e88468e3598b3de3d49
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292836
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-05-29 14:59:43 +00:00
Mike Klein
ac37b7afe0 remove old kDCIP3 alias
These numbers were Display P3.

Bug: skia:9792
Change-Id: I1aded49427aa0fa4bcd8a0f563b36d2180383900
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292822
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-05-29 14:59:43 +00:00
Weston Tracey
074414fed5 Revert "GrClips provided as pointers to GrRTC"
This reverts commit 226b689471.

Reason for revert: Breaks Android roller

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

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

Change-Id: I42c4828bcf016ee3d30d5c20b771be96e125817b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10205
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292856
Reviewed-by: Weston Tracey <westont@google.com>
Commit-Queue: Weston Tracey <westont@google.com>
2020-05-29 12:55:44 +00:00
skia-recreate-skps
ae7ec62515 Update Go Deps
Change-Id: I1a6b4726db7954da20ef93fa1dce271f64be072b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292787
Reviewed-by: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
Commit-Queue: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
2020-05-29 05:31:42 +00:00
skia-autoroll
aafe1fc0fa Roll ANGLE from 6a184fe947ed to 33004b09f180 (8 revisions)
6a184fe947..33004b09f1

2020-05-28 ynovikov@chromium.org Roll VVL and Headers to v1.2.141
2020-05-28 cclao@google.com Add egl::ShareGroup class to abstract the share context group
2020-05-28 flibitijibibo@gmail.com GGP: Check and enable VK_GGP_frame_token
2020-05-28 jonahr@google.com Port disable_timestamp_queries GPU workaround to ANGLE
2020-05-28 ianelliott@google.com Vulkan: Rotate gl_PointCoord for Android pre-rotation
2020-05-28 geofflang@google.com Fix non-existent required dependency
2020-05-28 angle-autoroll@skia-public.iam.gserviceaccount.com Roll glslang from 2b0eafb1de5b to e00d27c6d65b (2 revisions)
2020-05-28 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SPIRV-Tools from d3d89bb90cbd to 8dfdbeff84f3 (4 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 westont@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:1075876,chromium:811661
Tbr: westont@google.com
Test: Test: TH presubmit
Change-Id: If4e5382f26fc610de4588bf187052c9f79368d1d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292780
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-05-29 04:48:12 +00:00
skia-autoroll
d8ab8e71db Roll Chromium from f752954c14c1 to a775f5d273ab (485 revisions)
f752954c14..a775f5d273

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 westont@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: westont@google.com
Change-Id: I34f390cd3e1b494a83cb985ebb3d5fe1f23f526c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292778
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-05-29 04:43:12 +00:00
skia-autoroll
7adbda9be5 Roll SwiftShader from 9e718f962f87 to 471c120ac92a (1 revision)
https://swiftshader.googlesource.com/SwiftShader.git/+log/9e718f962f87..471c120ac92a

2020-05-28 capn@google.com Don't inline rr::Variable methods

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 westont@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: westont@google.com
Change-Id: I15e46359224d01b3b287b60b93eefe46ae0f4bbf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292779
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-05-29 04:40:12 +00:00
skia-autoroll
dabb0d7864 Roll dawn from a3636ed8883d to 295a4177aebc (4 revisions)
https://dawn.googlesource.com/dawn.git/+log/a3636ed8883d..295a4177aebc

2020-05-28 enga@chromium.org Add ScopedEnvironmentVar class for setting env variables in BackendVk
2020-05-28 enga@chromium.org OpenGL: Fix rendering to a layer of a depth/stencil texture
2020-05-28 enga@chromium.org Metal: Fix rendering to a layer of a depth/stencil texture
2020-05-28 enga@chromium.org Add tests for using a subresource as output attachment

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

Bug: None
Tbr: cwallez@google.com
Change-Id: I62a054759c3edf89216d11f15fb0815ae1f11988
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292781
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-05-29 04:35:12 +00:00
John Stiles
c67b36213f Fix Metal codegen for Globals struct.
The code which sets up the Globals struct is separate from the code
which populates the struct. Occasionally, these two blocks of code do
not emit the same items in the same order. (e.g., global variables
without associated values do not get added to fInitNonConstGlobalVars,
so they are missing entirely from the globalStruct setup.)

Previously, globalStruct was initialized via this syntax:

    Globals globalStruct{&a, b, c, d};

Which meant that any mismatch between the above two sections of code
would initialize the globals incorrectly.

Initialization now uses the following form, which should be forgiving
of any gaps or reordering, but will hopefully generate the same code
for a tightly-packed structure:

    Globals globalStruct;
    globalStruct.a = &a;
    globalStruct.b = b;
    globalStruct.c = c;
    globalStruct.d = d;

This fixes the DM 'vertices_data_lerp' in Metal.

Change-Id: I793e3893a1a0f7db20de1006f7a9cb2ecca22d6b
Bug: skia:10287
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292729
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-05-28 22:27:41 +00:00
John Stiles
1bdafbf016 Reland "Improve matrix construction abilities in Metal codegen."
This is a reland of daa573eb91

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

Bug: skia:10280
Change-Id: If5591392bb96e1cfb643d4e3c19a0ee4affec58d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292689
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-05-28 22:20:10 +00:00
Ben Wagner
b985b4b67f Remove use of ICU C++ API from SkParagraph.
This is mostly about consolidating and removing use of
icu::UnicodeString. It was used mostly as an intermediary for
conversion, and the new conversions should make one fewer copy of the
data.

Change-Id: I1d0e5f0dc21c47ed7c80f456b9129c4c9a36b09a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292718
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-05-28 22:07:40 +00:00
John Stiles
f7d7043408 Add support for SkASSERTF and SkDEBUGFAIL(F) in SKSL_STANDALONE.
This is a simple safeguard to prevent against code that compiles
properly in full Skia builds, but fails in a SkSL standalone build.

A few SkASSERT(false) calls have been replaced with
SkDEBUGFAIL("message") in order to exercise the new call.

This CL should unblock
https://skia-review.googlesource.com/c/skia/+/292689

Change-Id: I83b0b9d28bd74c5cb1869510b0fb34792c6b2385
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292693
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-05-28 20:46:03 +00:00
Chris Dalton
3e7d511de3 Add svg parsing to CanvasKit viewer.html
Also enables ccpr and makes flags parsing more robust.

Change-Id: Ia98467403de87423a63167681b2ee635b0fa593a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292690
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-05-28 20:39:43 +00:00
Kevin Lubick
cf11892ab2 [canvaskit] Do not automatically free things provided by Malloc.
If ever CanvasKit accepts an array as a parameter, if the array
provided was produced by Malloc, CanvasKit will use the pointer
of that array and not free it after.

Change-Id: I4806a48e5e030edd787944f652984ea3516b3022
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292561
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-05-28 19:45:52 +00:00
Brian Osman
2c28bf9fe0 Directly compute normalized coords in the color cube runtime effect
We can compute these directly, and avoid a whole extra matrix uniform
and multiply to get the same effect.

Change-Id: I25146932fd577f64567abee8df2c001a830ef78f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292574
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-05-28 19:18:43 +00:00
Greg Daniel
895a2ad46c Fix up some comments in regards to gpu flush and submitting.
Change-Id: I54273609e17a0151c2c91d2775ccae3c5aadbc5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292568
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-28 19:02:03 +00:00
Michael Ludwig
226b689471 GrClips provided as pointers to GrRTC
A null clip represents no high-level clipping is necessary (the implicit
clip to the render target's logical dimensions is fine).

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

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

Bug: skia:10205
Change-Id: Ie30cc71820b92d99356d393a4c98c8677082e761
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290539
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-05-28 18:55:13 +00:00
Ben Wagner
4ca7a812f8 Remove use of brkiter from SkParagraph.
Most of the lines here are the result of running iwyu to get the right
includes after removing all the offending includes. A few constants need
to be had from the C api instead of the C++ API to make this work. The
SkParagraphTest and SkParagraphImpl are still using C++ API with
icu::UnicodeString, which will be cleaned up later.

Change-Id: I0f7f630d55bc600eaa8700c8b48758ee6af2c3fb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292676
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-05-28 18:24:44 +00:00
Herb Derby
28e7263386 Remove test_makeOp
Change-Id: I98973d870aeab0a63aa0bb9da818f03f6816bed0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292579
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-05-28 18:15:11 +00:00
Ethan Nicholas
eee14b800d fix variable sample matrices in FP files
Change-Id: I7bcfdd821d004529231a6d082528538c796858d0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291956
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-05-28 17:56:14 +00:00
Michael Ludwig
87f5755b52 Fixes for GPU dither
1. Uses device coordinates instead of local coordinates
2. For both int and float variations, interleaves x and (x^y) instead of
   x and y. This matches CPU backend and definition of ordered dithering.

Handling xor in float was a little tricky, but I don't think it's that
many more operations than the step/mod over vec4s from before. It's an
extra operation but restricted to vec2s.

I also updated the way the dither range was provided to the shader.
The float is returned directly from the dither_range_for_color_type function,
and embedded in the shader, instead of mapping from an int to the
appropriate range value. While doing this, I also updated the range value
to be used for 1010102 color types (matching the SkVMBlitter's range),
and a new, appropriate value for 16-bit colors.  Float and half color
types now are not dithered at all (matching raster backend). Previously
these were all treated as a range of 1/255.

We can revisit the range choice before landing this CL if there was
history that made 1/255 a more visually pleasing choice for these high
bit depth color types.

Bug: skia:10290
Change-Id: Ia05c0b84be94efacb83cae295ed2177171c6b249
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292263
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-05-28 17:56:13 +00:00
Herb Derby
94e7b2caad Cleaup makeOp
Change-Id: Ia9d805e7b7292585b6387a0f1c76abc791b9458d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292569
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-05-28 17:39:18 +00:00
John Stiles
1fa15b1642 Revert "Improve matrix construction abilities in Metal codegen."
Doesn't build with `skia_compile_processors = true`

This reverts commit daa573eb91.

Reason for revert: <INSERT REASONING HERE>

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

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

Change-Id: I18610167e980eb1437842930deb9cc7509364f70
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10280
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292573
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-05-28 17:37:20 +00:00
Chris Dalton
f3242c44cf Add an skp loader to CanvasKit viewer
The new loader works by checking for a "slide" flag, and if it ends in
".skp", then we treat the slide name as a URL and try to pull it in with
an HTTP request and parse it as an SkPicture.

It is the user's responsibility to copy or link skps into their
canvaskit server directory.

Change-Id: Iaafa84300d36d2d5a0bb29c47761ec67076c0f50
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292204
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-05-28 17:29:28 +00:00
John Stiles
daa573eb91 Improve matrix construction abilities in Metal codegen.
GLSL (and thus SkSL) is flexible about the input parameters to a matrix
constructor. You can mix vectors and scalars freely, and it will
populate them into your matrix as if it was a flat list of scalars.

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

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

Change-Id: I76901bfe167502797aa4cb98d0e8986d9ebc51e5
Bug: skia:10280
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292477
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2020-05-28 17:03:21 +00:00
Chris Dalton
e6778f330d Add an msaa flag to CanvasKit viewer
Adds a simple system for the user to supply flags via the location hash.

  e.g., "http://.../viewer.html#msaa:8"

Implements the msaa flag by rendering to a multisampled offscreen
framebuffer, then blitting it to the main canvas framebuffer.

Change-Id: I7f2b8b769e491f2169fd6b967a72a8ea9c8ffb8b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292199
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-05-28 16:22:18 +00:00
Ben Wagner
af6de9f841 Condition SkLoadICU on SK_USING_THIRD_PARTY_ICU.
This is how SkShaper_harfbuzz currently avoids using SkLoadICU when it
may not exist.

Change-Id: I4ff9a6dc4297db97481cce1de53da9921d47a4ad
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292566
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Weston Tracey <westont@google.com>
2020-05-28 16:11:42 +00:00
Brian Osman
9c3eccd5d7 Runtime effect implementation of color cube filter
Bug: skia:10274
Change-Id: Ifb2ef8bf031e74d9d5c8183efe5aff4e6f3d2e7c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292562
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-05-28 15:45:48 +00:00
Jim Van Verth
afd4113bc3 Change D3DAttachmentViewManager to handle all CPU descriptors
Change-Id: I6af3673a9dedf0a5acfbd588bfbbb447b5c68013
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292576
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-05-28 15:34:59 +00:00
Nigel Tao
3ab9b1f8e9 Add convert-to-nia command-line program
Together with similar programs in other repositories, this helps find
disagreements between Chromium's, Skia's and Wuffs' image decoders.

Change-Id: I9a0d8aabb47b1d5bd29f9139755e76bf56ab4bbe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290618
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2020-05-28 15:08:08 +00:00
Ben Wagner
c087221875 Pre-allocate space for single run fRunsInVisualOrder.
Most lines have one run in them, so avoid extra allocations in this
case. As a side effect, mark TextLine as moveable but not mem-movable.

The TextLine class used to be used as a mem-movable class, but the
addition of an SkSTArray made it non-mem-movable. Correct this and make
TextLine moveable and document its non-copyable nature. This avoids
ASAN use after free issues.

Change-Id: Icf45a464004e9f270ec46e1c2ddcf29fd356c90a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292441
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-05-28 14:58:38 +00:00
Ben Wagner
bbc6f0a82d Initialize ICU before use in SkParagraph.
ICU needs to be initialized, at least in the Windows build where the
data isn't statically linked. This should be done internally, and not as
an external requirement.

Change-Id: I796b67c6f0a84c75d1557631ff38cf58d1b6a236
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292440
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2020-05-28 14:12:40 +00:00
Ben Wagner
ebebf6e2b5 Move SkParagraph bits into skparagraph directory.
This makes it more obvious that these files really are part of
SkParagraph and integrate with the Skia test framework and are not part
of core Skia. This is more like how Skottie is setup and helps prevent
misunderstandings about where additional files like this should go and
how the build should be structured.

Change-Id: Iaac060c97cffd2b0c29833c7b0403521d91bdb6a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292439
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-05-28 13:59:18 +00:00
Ethan Nicholas
70728ef8e7 Revert "Reland "Revert "SkSL function inlining"""
This reverts commit 04ff61faae.

Change-Id: Ieb69c76b161ec9e003982d36bb2e28d055ad47a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292266
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-05-28 13:27:58 +00:00
Mike Reed
5aefbb3725 Revert "prealloc space for a simple fRunsInVisualOrder"
This reverts commit be997df079.

Reason for revert: not sure SkSTArray is movable

Original change's description:
> prealloc space for a simple fRunsInVisualOrder
>
> Change-Id: I38e5ffbecdf5ca6870ccaccf43be149675a1d638
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291972
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=bungeman@google.com,herb@google.com,reed@google.com,jlavrova@google.com

Change-Id: Icddabe180d83ab0054ba5a5eebbe09e1fd5a15b4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292556
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-05-28 10:45:20 +00:00
skia-recreate-skps
6065820c58 Update Go Deps
Change-Id: I294fb27e1c5c3589b38eca6583c6e90c059c0289
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292466
Reviewed-by: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
Commit-Queue: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
2020-05-28 05:30:37 +00:00