Relax SkStrokeRec::hasEqualEffect
Ignores the miter limit if the join type is not kMiter. Bug: skia:10419 Change-Id: Ib05895cf90c7bb0e25e9e8c3e26c13fef32f2e97 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317163 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
This commit is contained in:
parent
a195d101f9
commit
31bf3d9bb5
@ -127,7 +127,7 @@ public:
|
||||
return this->getStyle() == other.getStyle();
|
||||
}
|
||||
return fWidth == other.fWidth &&
|
||||
fMiterLimit == other.fMiterLimit &&
|
||||
(fJoin != SkPaint::kMiter_Join || fMiterLimit == other.fMiterLimit) &&
|
||||
fCap == other.fCap &&
|
||||
fJoin == other.fJoin &&
|
||||
fStrokeAndFill == other.fStrokeAndFill;
|
||||
|
@ -148,7 +148,7 @@ static void test_strokerec_equality(skiatest::Reporter* reporter) {
|
||||
REPORTER_ASSERT(reporter, s1.hasEqualEffect(s2));
|
||||
|
||||
s2.setStrokeParams(SkPaint::kButt_Cap, SkPaint::kRound_Join, 2.1f);
|
||||
REPORTER_ASSERT(reporter, !s1.hasEqualEffect(s2));
|
||||
REPORTER_ASSERT(reporter, s1.hasEqualEffect(s2)); // Miter limit not relevant to butt caps.
|
||||
s2.setStrokeParams(SkPaint::kButt_Cap, SkPaint::kBevel_Join, 2.9f);
|
||||
REPORTER_ASSERT(reporter, !s1.hasEqualEffect(s2));
|
||||
s2.setStrokeParams(SkPaint::kRound_Cap, SkPaint::kRound_Join, 2.9f);
|
||||
|
Loading…
Reference in New Issue
Block a user