It's possible to construct a case value expression that's a compile time
constant, but fails to produce a value from getConstantInt. MSAN noticed
us using the uninitialized integer. It's now initialized, but also never
used in the failure case: We make getConstantInt return status, and give
better error messages in the two places it's used.
Bug: oss-fuzz:24889
Change-Id: I88e4e5b7bd1caeea1cf53f9b1d6f345dd8a5326f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310296
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
This staging flag is no longer used by Chrome.
Bug: skia:104662
Change-Id: Ib788b3bb4a975e496d72729fa47fb52952ab6a12
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310336
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Having the logic to emit, parse, and re-emit this boilerplate spread
across the generator and FP was unnecessary. Having it emitted directly
is simpler, and will allow some flexibility when we change the signature
of runtime effect SkSL.
Change-Id: I7ebd5e62bfe1e41035c4fb9efadb427be915b9f8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310158
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This makes it easier to keep in sync with the implementation in
SkVM.cpp, and it's easier to handle here once than in each build system.
Change-Id: I429f90cfc16f35a0d7e0b0fde176bc013aa7db18
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310263
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
This pattern is used frequently throughout the codebase but seems fairly
unique to Skia. It can be misleading if you haven't seen it before.
(In particular, the `onXxxxx` naming scheme is sometimes used to
indicate message-passing or event-handling, but that's not how it is
used in Skia.)
Change-Id: I73c5f7874bc51f8fde07baa8ef6a0e47c102302a
No-Try: true
Docs-Preview: https://skia.org/?cl=310159
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310159
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Relocate under modules/audioplayer and package as a standalone
component.
Change-Id: If9dc72bb0abe170049a514c9931186703a3c138a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310058
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Inlined return statements emit two statements--an assignment, then a
break. If scope braces are otherwise missing, the break statement will
end up in the wrong place. i.e.:
Mistranslated:
if (foo) return bar; --> if (foo) out = bar; break;
Translated properly:
if (foo) return bar; --> if (foo) { out = bar; break; }
Change-Id: Id992abf64ad09e6752f64c71cb556f05c868a453
Bug: skia:10607
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310177
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Change-Id: Iddfd7c483a5fc734284a4e28a64c3cd249e22e5c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310116
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-override.html
Adds override (introduced in C++11) to overridden virtual functions and
removes virtual from those functions as it is not required.
virtual on non base class implementations was used to help indicate to
the user that a function was virtual. C++ compilers did not use the
presence of this to signify an overridden function.
Change-Id: If66d8919358f72a4035190caf8d7569268037a9a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310160
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
When this assert happens in a Chromium bug report it just states
"assert(false)". While the line number is present the line numbers
aren't always stable or easy to track down over time, so having the
condition that actually asserted present gives better certainty about
where in the code and which condition failed to hold in relation to the
crash report.
Change-Id: I7b0deb05c1736ba90c7642c90d8be44d2d17e9f4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310156
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This is easier to read than casting nullptr to the desired type.
Change-Id: I19eb85f96dc4e66316e36c1839b8df25f39fa608
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310178
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This makes the add() interface more closely aligned with
takeOwnershipOfXxxxx().
Change-Id: Iafd116fa86bd8ccfe07b730ebcd74d5304967878
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310069
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
The calling code guards against < .5 radii if not stroke-only.
Change-Id: Ic6075e2bef3989a02f1f87085dba9cecdd93d825
Bug: chromium:1114968
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310057
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Use Queue::WriteBuffer() for uniform uploads instead of the staging
manager. Utilize the fUniformsDirty mechanism in GrUniformDataMangaer
to cache and reuse the most recent BindGroup uploaded.
Doing this required moving bind group creation and setting to
GrDawnProgramDataManager::uploadUniformBuffers(), and passing the
RenderPassEncoder down to setUniformData(). setTextures() was
similarly modified (for symmetry).
Change-Id: I841a0cf710b10d5025ea895d3a109f05d2966639
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309663
Commit-Queue: Stephen White <senorblanco@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Stephen White <senorblanco@google.com>
The new unit test SkASSERT()s a hash collision at head
(but passes in release builds) and does not SkASSERT()
with this patch to SkColorSpace.cpp.
Bug: chromium:1113865
Change-Id: Ibc05af4145a92bbd15c7d5e06ece9d269bd7a242
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310110
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
We do not have a good mechanism to break out of a nested for/while loop
or switch statement. Our inlining approach generates incorrect code in
those cases, and there's no apparent fix, since we don't have a
mechanism for subverting control flow like 'goto'. When we detect this
case, disable inlining for that function.
Change-Id: Ic4180b367a3895806b0cc36872155185138826e1
Bug: skia:10606
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310063
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Suspect this pathway isn't used, and we dont want to support it
in a future refactor requiring a GrDirectContext in getROPixels.
Bug: skia:104662
Change-Id: I9492fa7a6b85306d187c2eeab2463f305bd17dd0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309720
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Prior to this CL, if we failed to create the DDL Recorder's target
proxy while creating the target surface we could create an invalid
DDL.
The specific repro case involved too big of an target proxy but
many other scenarios could result in the same behavior.
Bug: 1105903
Change-Id: I519a072600c168aa590fbe920f4029d08fe29e6f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309777
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Change-Id: I8856ab94c0f99edbdf75df36edf88d1cb196fc8d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310061
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Change-Id: I1b387146aee612d9ffcb5aa15536f08a04cadf67
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310060
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>
Change-Id: I7ba287b5d8e34571b5ca3e502413b2aafa27acc7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310059
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>
Since the Skia SK_ABORT logging has been improved, it is noted that the
majority of release asserts are originating in SkBitmap::allocPixels. In
many of these cases there appears to be plenty of free memory reported
at the time of the assert. Log a bit more information in the assert
message to get an idea about why this is happening.
In a future CL it may be worth structuring this so that the out of
memory condition is distinguished from other possible failure modes so
that it can be marked as an out of memory condition in crash reporting.
It may be possible that the system still has memory available but it
unwilling to allocate it.
Change-Id: Ib2ed92e869000a3713556e17675c53245629a233
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309884
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
`onXxxxx` methods in Skia are generally intended to be non-public.
Change-Id: I26b6bdcee653f41a22c91f79d01b20a274210747
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309981
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Bug: skia:10369
Add SkEncodeImageWithNDK, mirroring the CG and WIC versions, for
encoding with the NDK APIs added to R.
Rename SK_ENABLE_NDK_DECODING to SK_ENABLE_NDK_IMAGES and use it for
both encoding and decoding.
Move code for converting to/from NDK types into a common location.
Update encode_platform.cpp to use NDK encoding APIs when available and
to use both types of webp (lossy and lossless). Add tests specifically
for the new implementation.
Update NdkDecodeTest to use ToolUtils::equal_pixels for comparing
pixels.
Change-Id: Ic62f89af27372ccce90b8e028e01c388a135a68c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308800
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Bug: oss-fuzz:24764
Change-Id: I86b935850158780d5f65be025ffd16f704984806
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309695
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
These variables are about to go out of scope anyway, and will be
re-declared with the proper value on the next iteration of the loop.
Change-Id: I2d3cfa1c888057b98125c83854f6af817225d0b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309958
Commit-Queue: Leon Scroggins <scroggo@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
`onXxxxx` methods in Skia generally appear to be non-public, which I did
not realize until after originally implementing this task.
Followup CLs will update the non-gencode `onDumpInfo` methods to be
private as well.
Change-Id: I807eee132b080f72f6b040e1ca7f687be25dff11
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309883
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This is meant to parallel the changes in http://review.skia.org/309793,
but for GrOps. The base-class info is automatically appended without
subclasses manually calling `append(INHERITED::dumpInfo())`.
Change-Id: Ic815305feeeca07385687af5703f0dd88a008f9f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309879
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
`GrRenderTask::dump` is now enabled by GR_TEST_UTILS, not SK_DEBUG.
`GrOpsTask::dump` is now enabled by GR_TEST_UTILS, not SK_DEBUG.
`GrOp::dumpInfo` no longer exists when GR_TEST_UTILS is off.
Various GrRenderTask subclasses' `name` methods are now enabled by
GR_TEST_UTILS, not SK_DEBUG. (`name` is only referenced by `dump`.)
Note that GR_TEST_UTILS can be enabled with SK_DEBUG turned off, which
makes a lot of these ripple-effect changes unavoidable.
Change-Id: Ie0fafed6f05c7d4083e769cd2f058db9ecc01d5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309882
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
I broke this during the refactor, at http://review.skia.org/304857
Change-Id: I9f16acd05fbb3767eed59810a1b1a8a110ce29d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309878
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
d667ad2f01..cc958e0e87
2020-08-12 jmadill@chromium.org Remove D3D9 configs from perf tests.
2020-08-12 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SPIRV-Tools from 8e1380996d6a to 13a65b1aee42 (4 revisions)
2020-08-12 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-ValidationLayers from fcfe5a3b19d5 to e930c45863c6 (7 revisions)
2020-08-12 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from 59b4828f293e to 13f04d59c727 (3 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 fmalita@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: None
Tbr: fmalita@google.com
Change-Id: Id076e22ef39f75172d95efd99f7e0907b15e648d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309867
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
This CL also marks `GrProcessor::dumpInfo` as final. This prevents a
subclass from mistakenly overriding `dumpInfo` instead of `onDumpInfo`.
`onDumpInfo` is responsible for providing the same data as `dumpInfo`,
except that the FP name is automatically prepended.
Change-Id: I2b44c30a01bc65e9d88321cc21651a94e20074c6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309793
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
and
"Guard gencode dumpInfo() calls with GR_TEST_UTILS, instead of SK_DEBUG"
and
"Remove dumpInfo() entirely when GR_TEST_UTILS is off."
This is a reland of 26900788ef
and b5e8a2533a
and d7b09c4c3a
and unit tests are now fixed.
Original change's description:
> Guard dumpInfo() calls with GR_TEST_UTILS, instead of SK_DEBUG.
>
> (One exception: the `dumpInfo` in GrVkCommandPool is wrapped with
> SK_TRACE_MANAGED_RESOURCES to match its peers in GrVkManagedResource.)
>
> Change-Id: I6cf55fa2bb5687f79a2cc0c2a9c02a629bfd4f8e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309556
> Commit-Queue: John Stiles <johnstiles@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
Change-Id: I16e6606082a814b4fa5ef58d1096fc915f5ac704
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309721
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>