aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/SubsetPath.cpp
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2018-04-02 20:37:42 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-02 20:37:52 +0000
commit22c1f373b7438e13592d162aa0baec7e6e3d0a78 (patch)
treeedcb2c63391e95ff5c210ef43a41290b9ce0b6b1 /tests/SubsetPath.cpp
parent224edf0a3c41fc0f813c3a974c4839197edcc3c0 (diff)
Revert "implement SkTDArray with std::vector"
This reverts commit 80e1d56e198c5fd9fe6db0c945bd558053a8dc6a. Reason for revert: SkRTree.cpp:57 asserting, probably this? Original change's description: > implement SkTDArray with std::vector > > It's always worth seeing if we can get away with replacing custom data > structures with ones from the standard library. Our array-like types > are all good candidates to replace with std::vector, and it's especially > easy to start with SkTDArray. Unlike the others, it has no preallocated > S-variant, which is tricky to make work with std::vector. > > SkTDArray also has known integer overflow bugs, leading to out of range > writes. It'd be _very_ nice to ditch it for a better standard vector. > > I removed a bunch of unused or little-used methods, and updated a couple > call sites that used methods in unusual or dangerous ways. > > I've had to tweak GrAAConvexTessellator and SkBaseShadowTessellator just > a touch to work within the constraints of an std::vector impl. It's not > intended to be legal to write to the reserved-but-not-counted elements > of an SkTDArray, but you can get away with it in our old implementation. > This version now uses setCount() to actually reserve and count them, and > should have the same performance and use the same amount of memory. > > The PathMeasure_explosion GM I added recently to reproduce this bug now > draws without triggering undefined behavior or ASAN errors, provided you > have ~40GB of RAM. > > Bug: skia:7674 > > Change-Id: I4eacae18a976cd4a6d218102f8ca5d973d4d7d0e > Reviewed-on: https://skia-review.googlesource.com/115982 > Reviewed-by: Brian Osman <brianosman@google.com> > Commit-Queue: Mike Klein <mtklein@chromium.org> TBR=mtklein@chromium.org,bungeman@google.com,brianosman@google.com Change-Id: Icffd9f22fe89746a970ff598e1a05c774960bc0e No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7674 Reviewed-on: https://skia-review.googlesource.com/117901 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'tests/SubsetPath.cpp')
-rw-r--r--tests/SubsetPath.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/SubsetPath.cpp b/tests/SubsetPath.cpp
index c1f2a62e26..6a7660e527 100644
--- a/tests/SubsetPath.cpp
+++ b/tests/SubsetPath.cpp
@@ -193,7 +193,7 @@ SkPath SubsetVerbs::getSubsetPath() const {
bool addLineTo = false;
while ((verb = iter.next(pts)) != SkPath::kDone_Verb) {
bool enabled = SkPath::kLine_Verb <= verb && verb <= SkPath::kCubic_Verb
- ? (bool)fSelected[verbIndex++] : false;
+ ? fSelected[verbIndex++] : false;
if (enabled) {
if (addMoveTo) {
result.moveTo(pts[0]);