Commit Graph

57282 Commits

Author SHA1 Message Date
John Stiles
2533953aa3 Add Round() to DSL.
I wrote some code which needed Round(); it isn't in ES2 so it wasn't in
the DSL intrinsic set yet.

Change-Id: I304f61b502a68d255d15899181e34fcae2ef16a0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447017
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-09-09 19:24:27 +00:00
John Stiles
df84ccdb38 Disable SkSLIntrinsicPackUnorm2x16 test.
This test fails on my work laptop (Radeon 5300M) so simply disabling it
on the tree isn't sufficient in this case. We don't seem to have a test
opt-out mechanism that automatically applies to local runs of dm.

Change-Id: I83582f0cdc3c9e6a61e6dc8e07851b9705143423
Bug: skia:12434
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447057
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-09-09 19:13:46 +00:00
John Stiles
997c3eda28 Use generic types to specify square forms of outerProduct.
This reduces our memory footprint slightly (smaller dehydrated data,
fewer IRNodes in the rehydrated GPU module).

This required a small tweak to our built-in types. $squareMat and
$squareHMat are now aligned with our $vec/$genType generics. (The "1x1
matrix" case is explicitly marked as invalid, allowing `float2x2` to
match up with `float2` and `half2x2` to match up with `half2`.)

Change-Id: I219a7be42102afbf60bb6857b53ac2b4f469113d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447187
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-09-09 19:09:02 +00:00
John Stiles
feb1e1274c Add implementation of outerProduct() intrinsic to Metal.
Metal doesn't natively offer this intrinsic at all, but we now write an
equivalent template function whenever the intrinsic is encountered.
Proper testing will be added in a followup CL (when outerProduct is made
available in public SkSL).

Change-Id: Ie8d6bf8d735d0ab45b7559be68036b08c5802365
Bug: skia:12202
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447296
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>
2021-09-09 19:08:36 +00:00
Jim Van Verth
fc309eafda Metal: add programmatic command buffer capture
* Update capture method to use latest interface
* Add simple hooks to enable command buffer capture for dm, nanobench, etc.

Change-Id: Ia69f1d10f1f80084342f4f38d12aca92f4dc710c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447193
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2021-09-09 19:04:28 +00:00
Greg Daniel
3270a78150 Add Adreno5xx workaround for dual source blending followed by disabling blending bug.
Bug: chromium:1241134
Change-Id: If99fbd62aaa9e2b5d064fdec6a010d3ab0f9dd66
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446817
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-09-09 19:03:54 +00:00
John Stiles
8d0dd0d1c1 Add support for pack/unpackUnorm2x16 to public SkSL.
This includes compile-time optimization and tests.

The unit test is disabled in a followup CL
(http://review.skia.org/447057) because it exposes a Radeon 5300M bug
in OpenGL.

Change-Id: I8b2f0411358aeb68c4edfeb0bd7a2814c4be1f40
Bug: skia:12202
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447056
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-09-09 18:59:15 +00:00
Brian Osman
74947225a5 Update comment explaining ignoreable subset rects
Change-Id: I1f3e5e0bdc216910be6b522f460b2c277134635c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447190
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-09-09 18:58:49 +00:00
Robert Phillips
171ff2fdd5 Patch TextureBindingsResetTest to match CommandBuffer expectations
Bug: skia:10412
Bug: skia:12437
Change-Id: I93077bbd2ed40252966305df1b93ceb813218828
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446181
Reviewed-by: Eric Boren <borenet@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-09-09 18:54:03 +00:00
John Stiles
19a7b9749c Convert constant variables to values earlier in intrinsic optimization.
It's dangerous to leave constant variable expressions lying around, as
the temptation to access them via getConstantSubexpression is just too
great, but this currently isn't supported. This bit us in `inverse`
(see http://review.skia.org/440260) and it seems like we had a similar
latent bug with `cross` as well.

Fortunately, this change seemed to simplify the code in general.

Change-Id: Idd3e84ca202a1f05f91c1d6d5e94a3bc6da0d8d7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447016
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-09-09 18:53:46 +00:00
Corentin Wallez
2c704669fb Update usage of deprecated Dawn typedefs
Bug: dawn:22
Change-Id: I7c0a4f77bc2c2df81ff4be091bf86569898a1ade
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447216
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@google.com>
Reviewed-by: Stephen White <senorblanco@google.com>
2021-09-09 18:32:56 +00:00
skia-autoroll
66ef11dceb Roll SK Tool from 876761b46493 to f9e7723e5a27
https://skia.googlesource.com/buildbot.git/+log/876761b46493..f9e7723e5a27

2021-09-09 rmistry@google.com Delete ds.MigrateData
2021-09-09 kjlubick@google.com [infra] Add now helper for changing time throughout tests.
2021-09-09 kjlubick@google.com [vfs] Use fs.FileInfo instead of os.FileInfo
2021-09-09 kjlubick@google.com [machine] Mock out times for tests and decouple firestore schema.
2021-09-09 kjlubick@google.com [tmm] Address some static analysis concerns
2021-09-09 kjlubick@google.com [tmm] Improve documentation and names.
2021-09-09 kjlubick@google.com [infra] Run RBE using the VM service account, not JSON keys.

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

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry

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/main/autoroll/README.md

Tbr: jcgregorio@google.com
Change-Id: I83a9268ae1d0f5d8eee0571b128c6f785259806b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447237
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-09-09 18:09:18 +00:00
Herb Derby
10d153ee21 improve quality of life
Change-Id: I75e93820bd1df57d076560f1b2991f1756ca5389
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446996
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2021-09-09 17:23:57 +00:00
Joe Gregorio
db2b44e01f Move all Android machines to arm64.
Change-Id: I738fb0c58d1a27397c94df384c8c87c045e36cb6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447177
Reviewed-by: Eric Boren <borenet@google.com>
2021-09-09 16:14:47 +00:00
Jim Van Verth
9605042e8e Metal: Fix discardable MSAA when used with stencil.
The RenderCommandEncoder created for LoadMSAAFromResolve needs to be
able to merge with the encoder that follows it -- otherwise, the load
will do nothing. Hence if the following encoder has stencil, we need to
add stencil to the LoadFromMSAAResolve encoder.

Bug: skia:12086
Change-Id: Idf1249e386e1a24c4f18477e7ff67910bc21aa3e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446716
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-09-09 12:42:49 +00:00
skia-autoroll
f4f2f7542d Roll SwiftShader from 83556eae921f to 35209220317c (1 revision)
https://swiftshader.googlesource.com/SwiftShader.git/+log/83556eae921f..35209220317c

2021-09-08 capn@google.com Remove vulkan_fuchsia_extras.h

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 erikrose@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in SwiftShader: https://bugs.chromium.org/p/swiftshader/issues/entry
To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry

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/main/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Test-Debian10-Clang-GCE-GPU-SwiftShader-x86_64-Debug-All-SwiftShader
Bug: None
Tbr: erikrose@google.com
Change-Id: I5a7be806c22e54eb6af4cad3ca0a3b0b760c2bbf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447039
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-09-09 05:28:50 +00:00
skia-autoroll
14282f89f0 Roll Dawn from c6140d5c95b8 to 053b58cd29dc (4 revisions)
https://dawn.googlesource.com/dawn.git/+log/c6140d5c95b8..053b58cd29dc

2021-09-09 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 5910ec1e8afc to 733addc20fbf (1 revision)
2021-09-09 jiawei.shao@intel.com Add FlatRenderPipelineDescriptor for CreateRenderPipelineAsync
2021-09-08 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from be514a1efb00 to 5910ec1e8afc (2 revisions)
2021-09-08 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 676ec7cf9964 to be514a1efb00 (1 revision)

Also rolling transitive DEPS:
  https://dawn.googlesource.com/tint from 676ec7cf9964 to 733addc20fbf

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 bajones@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry
To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry

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/main/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Debug-Dawn
Bug: None
Tbr: bajones@google.com
Change-Id: I80c98e27c5c2c893546ab772668bb05e1f0d1fc8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447038
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-09-09 04:59:47 +00:00
skia-autoroll
fc36020440 Roll ANGLE from 5a7b8c612591 to 8b2fd983e61a (6 revisions)
5a7b8c6125..8b2fd983e6

2021-09-08 syoussefi@chromium.org Translator: Fix validation failure in RemoveDynamicIndexing
2021-09-08 jmadill@chromium.org Trace Tests: Load trace list from JSON file.
2021-09-08 ianelliott@google.com Add note that OWNERS should only be updated upstream
2021-09-08 lexa.knyazev@gmail.com Vulkan: Enable VVL on macOS
2021-09-08 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from aed9a7633481 to 83556eae921f (1 revision)
2021-09-08 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from e1a053dddd92 to 3ce06be375f3 (419 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 erikrose@google.com,robertphillips@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in ANGLE: https://bugs.chromium.org/p/angleproject/issues/entry
To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry

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/main/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
Tbr: erikrose@google.com,robertphillips@google.com
Change-Id: I13e38e78629d0d3f8064fae224d1f623dd46a341
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447036
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-09-08 23:45:13 +00:00
John Stiles
b6981fb6a4 Add float-packing intrinsics from sksl_gpu to Metal.
It turned out that Metal had equivalent intrinsics/casts all along; we
just needed to emit them.

Tests will be improved in a followup CL which adds the ES3-compatible
packing intrinsics into sksl_public.

Change-Id: Iec8a20b9f9fe9b1badea2944eb0b1f0a17c74560
Bug: skia:12351
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446744
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>
2021-09-08 20:02:43 +00:00
John Stiles
51f9512928 Update GLSL intrinsic ordering to match latest docs.
The GLSL ES 3.0 Specification added a new section in the intrinsics
list, "8.4 : Floating-Point Pack and Unpack Functions." This shifts all
the following sections forward by one. I've updated various comments
which referred to the spec by section number. (The modern-day GLSL spec
is consistent with this new numbering, except for 8.9 "Fragment
Processing Functions," which leaps ahead all the way to 8.14 in today's
spec.)

Also, a handful of post-ES2 intrinsics in FunctionCall.cpp were lumped
together in a catch-all "not required by ES2" section. These have been
moved to the proper ES3 section.

Change-Id: If56c7307a06e6131a2a6d062f7560314362ba265
Bug: skia:12202
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446743
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-09-08 18:51:20 +00:00
John Stiles
14c3175d7a Add ES3 intrinsic modf to sksl_public.
The test has been improved and now covers a variety of values. Because
this intrinsic has side-effects (an out-param), we do not support
optimizing it or treating it as a constant-expression.

The modf documentation doesn't mention anything about constant-
expression support or lack thereof. Experimentally, modf is also not
treated as a constant-expression by Apple GLSL or glslang:

http://screen/4RWwYKr6vCjxCPQ
http://screen/45ttDTVAFGDRyxP

Change-Id: I15bb1de80e90fa97ddf8e9d3803352603b9608d0
Bug: skia:12202
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446396
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-09-08 18:45:16 +00:00
John Stiles
0736712710 Support swizzled out-params in SPIR-V intrinsic calls.
The code in writeFunctionCall which supported swizzled out-params has
been factored out into a pair of helper functions. The code for emitting
intrinsics now relies on these helpers when emitting out-params.

Change-Id: I4436185ae107d70b529e7e1ea0dd89f844c6a673
Bug: skia:11052
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446719
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-09-08 18:19:13 +00:00
John Stiles
8ff713b0b4 Revert "Add RelaxedPrecision decoration to function-call temp vars."
This reverts commit 0f4304e6e7.

Reason for revert: breaks Adreno 6xx

Original change's description:
> Add RelaxedPrecision decoration to function-call temp vars.
>
> This is really same basic issue as http://review.skia.org/446640. We
> were creating a temp variable but ignoring its type's precision.
>
> Change-Id: I9a5fedd7ada864d36757fc196f42ff95bac7d706
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446718
> Commit-Queue: John Stiles <johnstiles@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

Change-Id: I6ae4e264b60f7f38a1abb5f1d0324461a33c896d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446742
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2021-09-08 17:06:07 +00:00
Brian Osman
201b72a7f4 In runtime effects, treat all children as sampled
An unused child that used its coordinates would triggers asserts in the
GP - we expect that all FPs are sampled/invoked. This generates slightly
sub-optimal code (we compute and interpolate the local coordinates for
that child FP), but it's not likely to happen in real code.

Bug: skia:12429
Change-Id: Ic2ddc65d16a7e1f47af8c4192e5ff9ea329bf335
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446836
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-09-08 17:03:43 +00:00
skia-autoroll
a0d61eb561 Roll SK Tool from f846e64d8dfe to a2c45e4997e0
https://skia.googlesource.com/buildbot.git/+log/f846e64d8dfe..a2c45e4997e0

2021-09-08 jcgregorio@google.com [docsyserver] Fix instructions for running locally.
2021-09-08 kjlubick@google.com [infra] Fix copypasta in push_apps_from_wasm
2021-09-08 borenet@google.com [task scheduler] Enforce that all tasks have a CasSpec

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

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry

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/main/autoroll/README.md

Tbr: jcgregorio@google.com
Change-Id: I02273884aa16ad5529ad832c7adeafa013879557
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446777
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-09-08 16:13:18 +00:00
John Stiles
0f4304e6e7 Add RelaxedPrecision decoration to function-call temp vars.
This is really same basic issue as http://review.skia.org/446640. We
were creating a temp variable but ignoring its type's precision.

Change-Id: I9a5fedd7ada864d36757fc196f42ff95bac7d706
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446718
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-09-08 16:06:56 +00:00
Florin Malita
38ecac7895 [skottie] Suppress layer parser errors for tt: 0
Bodymovin uses tt: [1-4] to encode a layer track matte type, and skips
the property when a track matte is not present.

Flow OTOH uses explicit tt: 0 to signal the absence of a track matte.

Update the parser to not error out on tt: 0.

Change-Id: I2d456ac3479e356ba1fc5320589848f8872775e6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445957
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-09-08 16:04:01 +00:00
Robert Phillips
769b4884a9 Move some more Ops to skgpu::v1 namespace
Bug: skia:11837
Change-Id: I522636c6dbf977929b0d368e18beb9c3a01fdeb1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446184
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-09-08 15:41:04 +00:00
Robert Phillips
f6c564e3a3 Move DeviceFlags and CheckAlphaTypeAndGetFlags to skgpu::BaseDevice
skgpu::v2::Device will also need both of these so move them somewhere accessible

Bug: skia:11837
Change-Id: Iacaf0332da933515451056eeda62949b049378b7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446180
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-09-08 14:55:31 +00:00
John Stiles
6a51b20024 Avoid unnecessary load-store for out params in SPIR-V.
We don't need to initialize input values for `out` params. (We were
treating them the same as `inout`.)

Change-Id: Ib447d15de237a6a03740ad012180691dc60a50bd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446717
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-09-08 14:50:43 +00:00
Kevin Lubick
77b39ea624 [infra] Update skia-infra to include building shaders.skia.org
Change-Id: Iaab7732bf5a087ce0cd9894ceb208aee4f745d24
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446276
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
2021-09-08 14:33:05 +00:00
Jim Van Verth
b5e449b6d5 Metal: fix inline upload for discardable resolve
Bug: skia:12086
Change-Id: I84f05c874f7f097b9ff7e4ea1070f168964c7afe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446158
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-09-08 14:13:26 +00:00
John Stiles
30f8611655 Add RelaxedPrecision decoration to out-param temp vars.
Previously we were not honoring the variable precision at all (passing
null to nextId).

Change-Id: I0e217e6c0d3d701dc0540d4d4069a3597abdad11
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446640
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>
2021-09-08 13:35:51 +00:00
skia-autoroll
5ccad8aa4e Roll ANGLE from 48da7e7e7c1a to 5a7b8c612591 (1 revision)
48da7e7e7c..5a7b8c6125

2021-09-08 b.schade@samsung.com Vulkan: Removed size check when handling mismatched vertex attributes

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 erikrose@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in ANGLE: https://bugs.chromium.org/p/angleproject/issues/entry
To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry

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/main/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
Tbr: erikrose@google.com
Test: Test:
Change-Id: Ie023217dc60ebe769c212e3acd9e1fce84431093
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446536
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-09-08 05:25:57 +00:00
skia-autoroll
f92a185161 Roll SwiftShader from aed9a7633481 to 83556eae921f (1 revision)
https://swiftshader.googlesource.com/SwiftShader.git/+log/aed9a7633481..83556eae921f

2021-09-07 capn@google.com Use the shorter promoted Vulkan structure and enum names

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 erikrose@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in SwiftShader: https://bugs.chromium.org/p/swiftshader/issues/entry
To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry

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/main/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Test-Debian10-Clang-GCE-GPU-SwiftShader-x86_64-Debug-All-SwiftShader
Bug: None
Tbr: erikrose@google.com
Change-Id: Ia88390ef6c0d0e74a76e6f2125775d58f69d262c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446538
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-09-08 05:17:26 +00:00
skia-autoroll
1855461c42 Roll Dawn from ba1feb07bc5f to c6140d5c95b8 (4 revisions)
https://dawn.googlesource.com/dawn.git/+log/ba1feb07bc5f..c6140d5c95b8

2021-09-08 zhaoming.jiang@intel.com Initializing stencil reference for render pass in D3D12
2021-09-07 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from c77214d52d53 to 676ec7cf9964 (5 revisions)
2021-09-07 lokokung@google.com Adds ASTC texture compression formats and Vulkan support for them.
2021-09-07 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from ed18f2f8c325 to c77214d52d53 (1 revision)

Also rolling transitive DEPS:
  https://dawn.googlesource.com/tint from ed18f2f8c325 to 676ec7cf9964

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 bajones@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dawn: https://bugs.chromium.org/p/dawn/issues/entry
To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry

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/main/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Debug-Dawn
Bug: None
Tbr: bajones@google.com
Change-Id: I26a1298f60fa8735245e2f9da2e7f40ba04cdb35
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446537
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-09-08 05:02:34 +00:00
skia-autoroll
72fe2e5e5d Roll ANGLE from fefdf81e09ae to 48da7e7e7c1a (5 revisions)
fefdf81e09..48da7e7e7c

2021-09-08 geofflang@google.com Add a gn arg to enable collecting Vulkan system info on Linux
2021-09-08 syoussefi@chromium.org Translator: Fix precision of gl_PointSize on ES3+
2021-09-08 b.schade@samsung.com Vulkan: Make descriptor set bindings consistent across shader stages
2021-09-08 cclao@google.com Vulkan: Skip but keep incompatible updates.
2021-09-07 cclao@google.com Vulkan: Simplify TextureVk::initImage() call.

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 erikrose@google.com,robertphillips@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in ANGLE: https://bugs.chromium.org/p/angleproject/issues/entry
To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry

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/main/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
Tbr: erikrose@google.com,robertphillips@google.com
Test: Test: VulkanFramebufferTest.R4G4B4A4TextureSampleOnlyActuallyUses444Format
Change-Id: Iead1e5aa621aa613eee6407dc835b911a2472af7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446470
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-09-08 02:47:25 +00:00
skia-autoroll
b98cddd5c7 Roll ANGLE from 3271dea1673a to fefdf81e09ae (27 revisions)
3271dea167..fefdf81e09

2021-09-07 geofflang@google.com Remove Vulkan System info collection on Linux.
2021-09-07 jmadill@chromium.org Capture/Replay: Add expression trigger validation calls.
2021-09-07 syoussefi@chromium.org Vulkan: Drop requirement for inheritedQueries
2021-09-07 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 00f987fef929 to e1a053dddd92 (210 revisions)
2021-09-07 syoussefi@chromium.org Translator: Fix uninitialized TStructure::mAtGlobalScope
2021-09-06 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from bac3c5559b2b to aed9a7633481 (1 revision)
2021-09-06 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 6261dad8e8ea to 00f987fef929 (158 revisions)
2021-09-04 ynovikov@chromium.org Fix doc to refer to a standalone Mac bot
2021-09-04 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 8ef1e4544ed5 to 6261dad8e8ea (60 revisions)
2021-09-04 zequanwu@google.com Revert "Skip validation of stderr in TestSuiteTest.RunFlakyTests"
2021-09-04 jmadill@chromium.org WebGL: Make unsuccessful links fail subsequent draw calls.
2021-09-04 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from f60c2130504a to 8ef1e4544ed5 (272 revisions)
2021-09-03 gman@chromium.org Handle comparing arrays of scalars/vectors/matrices
2021-09-03 gert.wollny@collabora.com Capture/Replay: Handle Gen/Delete ProgramPipelines
2021-09-03 gert.wollny@collabora.com Capture/Replay: Handle glGetFragDataLocation
2021-09-03 gert.wollny@collabora.com Capture/Replay: handle glGetBooleani_v
2021-09-03 jmadill@chromium.org Capture/Replay: Use flat map for uniform locations.
2021-09-03 jmadill@chromium.org Capture/Replay: Use plain arrays for resource maps.
2021-09-03 jmadill@chromium.org Rename and expand shader variable init feature.
2021-09-03 jmadill@chromium.org Capture/Replay: Add replay state validation.
2021-09-03 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from c82c59307208 to bac3c5559b2b (1 revision)
2021-09-03 angle-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from 4862c4c6196b to b1e5bf7dd9c3 (1 revision)
2021-09-03 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from b5237d627f0d to f60c2130504a (425 revisions)
2021-09-03 angle-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from 84f860ef94ee to 4862c4c6196b (10 revisions)
2021-09-03 syoussefi@chromium.org Revert "Vulkan: Suppress layered FB validation error."
2021-09-02 timvp@google.com Fix Multithreaded eglDestroyContext()/eglTerminate()
2021-09-02 timvp@google.com Android: Remove premake/LICENSE.txt from Android.bp

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 erikrose@google.com,robertphillips@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in ANGLE: https://bugs.chromium.org/p/angleproject/issues/entry
To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry

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/main/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
Tbr: erikrose@google.com,robertphillips@google.com
Test: Test: EGLContextSharingTest.EglTerminateMultiThreaded
Test: Test: EGLContextSharingTestNoFixture.EglDestoryContextManyTimesSameContext
Test: Test: Load com.netmarble.sknightsmmo
Change-Id: I5b474d07734567f8be2ab37ad11ea0d2c2eb7a89
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446439
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-09-08 01:13:25 +00:00
Herb Derby
0f2d2f0efd implement ARM saturating multiply using ssse3
Change-Id: I530373e9b53e76a7cd1c0b3a5a1b05354975790c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446186
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2021-09-08 00:32:55 +00:00
Michael Ludwig
ecc555540b Only terminate egl display once
Unblocks angle roller into skia that was triggering an assert in
EGLImageTest. In that test, there were two egl contexts created that
shared the same egl display. The child context was destroyed first,
and ANGLEGLContext's destroyGLContext() implementation always called
eglTerminate on the display. According to the egl spec you're not
supposed to do anything with the terminated display other than call
makeCurrent() to release any active context.

In this case, the child context's termination would cause the display
to be deferred until the parent context was destroyed. This triggered
a bug in ANGLE's D3D backend, leading to the assert. However, with
that fixed, we then trigger critical error messages about calling
eglDestroySurface, etc. in the parent context's destroyGLContext()
function since the display was terminated out from beneath it.

This change adds a rudimentary ownership tracking mechanism to the
ANGLEGLContext so that when a child context is cleaned up it won't
call eglTerminate on its display. This happens to avoid the bug in
ANGLE's D3D backend as well as silencing the critical warnings if it
were fixed.

Bug: skia:12413
Change-Id: I31f64189315a1921adbee204d11138272d4b40af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446182
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-09-07 23:48:46 +00:00
Jorge Betancourt
151a6f34e1 expose Font to JetSki
Change-Id: Icea51ab00118b48898df70f4f1fa9ed985372589
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444760
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
2021-09-07 21:51:30 +00:00
Herb Derby
535f43d734 add simulation for arm rounding saturating multiply
Change-Id: I31dd90b2f09876d37c2c202d620cef4028af6266
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446183
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2021-09-07 21:15:04 +00:00
Michael Ludwig
e5881895b0 Remove overly verbose Usage enum from FilterResult
Bug: skia:9282
Change-Id: I04afd352ad8c0c167993f29f4293d857f5af7170
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445619
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2021-09-07 21:15:01 +00:00
Ethan Nicholas
a2c76c77c4 Fixed illegal interface block reporting
DSL was improperly allowing interface blocks in runtime shaders, which
caused PipelineStageGenerator to get upset.

Bug: oss-fuzz:38131
Change-Id: I593e68f2cab3db9151d606e65e2826ffa9c494e2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446324
Commit-Queue: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-09-07 20:18:00 +00:00
John Stiles
ff6c5bf5ed Generate more diagnostics from IRGenerator, when given bad code.
Two minor changes:
- Converting a Block with bad statements will now generate a partial
  block instead of nullptr.

The change mirrors how DSL behaves; functions containing invalid
statements will now be created and added to the program. Previously, we
would discard a function definition with any invalid statements inside;
this prevented duplicate-function-definition errors from appearing.

- Converting a return with a bad expression will now generate a
  poisoned return instead of nullptr.

This change improves diagnostics for functions with invalid return
statements. If we eliminate the return statements (by returning null),
we report bad return statements as "function can exit without returning
a value" (which is confusing).

Change-Id: I6d998d5c50585f8d96bb7e3cb7f59b63125d6a62
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446325
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-09-07 20:13:55 +00:00
Herb Derby
887230a36a basic experiments for understanding lowp
Change-Id: I5f0c36b44cd5bfd3f978d892a342a1d008baceb2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446176
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2021-09-07 20:08:50 +00:00
John Stiles
106e0cd412 Increase GetLoopUnrollInfo loop-count limit to 100,000.
To do this with a clean conscience, I needed to convert the unroll-
counting logic from a linear time algorithm to constant-time. Getting
all the edge cases correct requires a lot of care, and there are now
plenty of unit tests.

Change-Id: I620909d069ac425b7310e345bf80ec844fe035f8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445643
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-09-07 19:28:08 +00:00
Greg Daniel
41a6ace12e Have vulkan copy commands take attachments instead of images.
The motivation for this is that with the new backend info structs the
sample count will be stored on non backend specific classes
(e.g. GrAttachment) and will not be part of the GrVkSurfaceSpec struct.
Thus the info will not be available from just a GrVkImage (or at least
until GrVkImage and GrVkAttachment get merged down the road).

This also removes some uses of GrVkImage::imageInfo() getter since that
struct will also be going away.

Bug: skia:12402 skia:10727
Change-Id: Ie90870e1d834e6ea6ba029d0b480641fb8d2cfa0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446177
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-09-07 19:02:31 +00:00
Ethan Nicholas
327241208a Switched DSL error handling from const char* to string_view
This allows us to get rid of a lot of .c_str()'s.

Change-Id: I09102f90d69620614dc5a7a2ebc64bd3e9b1c437
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445816
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-09-07 18:48:04 +00:00
Derek Sollenberger
983ae8625b Only treat PNG_COLOR_TYPE_RGB as 565
Bug: 12145
Test: imagedecoder_png_fuzzer
Test: Codec_PngRoundTrip

If a PNG's sBIT specifies that the significant bits are 565, SkPngCodec
treats the image as defaulting to kRGB_565_SkColorType, rather than the
typical kN32_SkColorType. This feature is likely rarely used in the
wild, but it is used by Skia to encode kRGB_565_SkColorType to a PNG and
then recreate the original SkPixmap. These Skia-created PNGs always use
PNG_COLOR_TYPE_RGB, so only respect this sBIT with PNG_COLOR_TYPE_RGB.

Further, if the PNG is PNG_COLOR_TYPE_PALETTE, treating it as 565 means
that we read it incorrectly.

Change-Id: I81dcce771c8492cdcf5677d3c13167a1231acfe4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445963
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2021-09-07 18:45:34 +00:00