https://clang.llvm.org/extra/clang-tidy/checks/bugprone-suspicious-string-compare.html
Find suspicious usage of runtime string comparison functions.
This check is valid in C and C++.
Checks for calls with implicit comparator and proposed to
explicitly add it:
if (strcmp(...)) // Implicitly compare to zero
if (!strcmp(...)) // Won't warn
if (strcmp(...) != 0) // Won't warn
Checks that compare function results (i,e, strcmp) are compared to valid
constant. The resulting value is
< 0 when lower than,
> 0 when greater than,
== 0 when equals.
A common mistake is to compare the result to 1 or -1:
if (strcmp(...) == -1) // Incorrect usage of the returned value.
Additionally, the check warns if the results value is implicitly cast
to a suspicious non-integer type. It’s happening when the returned
value is used in a wrong context:
if (strcmp(...) < 0.) // Incorrect usage of the returned value.
Change-Id: I001b88d06cc4f3eb5846103885be675f9b78e126
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310761
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
These classes are much safer (there's no way to safely deserialize a
string with SkReader32 without knowledge of how it works internally).
Prior to this CL, SkVertices was the only complex type that had manual
serialization using the lower level types - now it works like everything
else. Additionally: the versioning can now be tied to picture versions
going forward (like everything else).
Bug: oss-fuzz:22909
Bug: oss-fuzz:22918
Bug: skia:9984
Bug: skia:10304
Change-Id: I3cf537eb765b5c8ce98b554c0f200e5d67c33d14
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293349
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
We already checked the SkSafeRange earlier (after its last use). Here we
need to be checking the SkSafeMath object. Oops.
The counts are directly copied from the constructor to the vertices'
fields - the user already knows what they are (and the tests are
verifying a tautology).
Bug: skia:9984
Change-Id: I33c62e02825718e497834b0dfa40d0d56e46a197
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280963
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Adds structure to the per-vertex (now custom) data.
Attributes currently just have a type, but the next
step is to augment that with semantic flags to handle
transformation logic in the vertex shader.
Added unit tests and GMs that exercise attributes of
varying float counts, as well as normalized bytes.
Bug: skia:9984
Change-Id: I02402d40b66a6e15b39f71125004efb98bc06295
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280338
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Rather than two separate (partially overlapping) ways of accessing the
private portions of SkVertices, use a single privileged helper class
(similar to GrContextPriv).
Change-Id: I76b14b63088658ed8726719cce126577e5a52078
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280601
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
No one was using this, and it added significant complexity to
GrDrawVerticesOp.
Bug: skia:9984
Change-Id: I23f38b3f5d853a8e531f13b6931cd57b5985a2c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276407
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:9984
Change-Id: Iaff520c6085303830f14bac4fe56830ba7360f64
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275218
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Current strategy: everything from the top
Things to look at first are the manual changes:
- added tools/rewrite_includes.py
- removed -Idirectives from BUILD.gn
- various compile.sh simplifications
- tweak tools/embed_resources.py
- update gn/find_headers.py to write paths from the top
- update gn/gn_to_bp.py SkUserConfig.h layout
so that #include "include/config/SkUserConfig.h" always
gets the header we want.
No-Presubmit: true
Change-Id: I73a4b181654e0e38d229bc456c0d0854bae3363e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209706
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
The single class in it is already in the ToolUtils namespace.
Change-Id: Iefa69690c4aa9b218784eb5edcfe7dba8721747b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202314
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
sk_tool_utils doesn't really fit the naming convention
the rest of code under tools/ tends to use.
Change-Id: I45326a174101c6eb4b6149e9c742f658f2fd23b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202313
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
sed 's/SK_MaxSizeT/SIZE_MAX/g'
sed 's/SK_MaxU32/UINT32_MAX/g'
sed 's/SK_MaxU16/UINT16_MAX/g'
SK_MinU32 and SK_MinU16 were unused
Change-Id: I6b6c824df47b05bde7e73b13a58e851a5f63fe0e
Reviewed-on: https://skia-review.googlesource.com/134607
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Not only could the old test cause int overflow, it was just wrong.
Bug: skia:8085
Change-Id: Id6b81f4aa1b115f0dbfd2266aee8fab5d5d30aee
Reviewed-on: https://skia-review.googlesource.com/124779
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
originally found by fuzzer.
Bug: skia:
Change-Id: I45007a619f13936153c0db8a60b3631a2c9db20c
Reviewed-on: https://skia-review.googlesource.com/101741
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Bug: skia:
Change-Id: Iffb123001a77049c6581f63bbc69c62f241a87f8
Reviewed-on: https://skia-review.googlesource.com/11405
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
This reverts commit eaaebb19a1.
Reason for revert: may call SkReader32::read(null, 0) -- reader needs to handle this
Original change's description:
> store vertices arrays inline with object
>
> Also unify some of naming (esp. around texCoords)
>
> BUG=skia:6366
>
> Change-Id: I5a6793f029cccf0cd0a2c1d180b259ce4eab526f
> Reviewed-on: https://skia-review.googlesource.com/9705
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
>
TBR=bsalomon@google.com,reed@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:6366
Change-Id: Ie421654bcd74d74f8be6676291e3d6e16e2a7a16
Reviewed-on: https://skia-review.googlesource.com/9727
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Also unify some of naming (esp. around texCoords)
BUG=skia:6366
Change-Id: I5a6793f029cccf0cd0a2c1d180b259ce4eab526f
Reviewed-on: https://skia-review.googlesource.com/9705
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
precursor to enabling serialization in pictures
BUG=skia:6366
Change-Id: Iba89aa98f389b3281e7705d041e3337e89071f03
Reviewed-on: https://skia-review.googlesource.com/9680
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>