diff options
author | Brian Salomon <bsalomon@google.com> | 2017-08-31 19:24:08 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-08-31 19:24:20 +0000 |
commit | 07f5b71f996ec387408ac7c85952b63bf893ec88 (patch) | |
tree | 3aad4aa6d62da316334539d5793d171820e919fc /src/gpu/GrShape.cpp | |
parent | c3cdef5fb07087f5aeeff73dc5a990030b4418ca (diff) |
Revert "Add a GrShape::Type value for an inverted empty path"
This reverts commit d5a3f7f9673a152928332a38e53a5fc55f590f40.
Reason for revert: GMs changed
Original change's description:
> Add a GrShape::Type value for an inverted empty path
>
> Change-Id: Ib34a608db07a2ff1d7bdfbd96867fa5ff0ac9782
> Reviewed-on: https://skia-review.googlesource.com/41540
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,robertphillips@google.com
Change-Id: I320dcda62bdb08163fe274325a38f59dd51b3927
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/41640
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrShape.cpp')
-rw-r--r-- | src/gpu/GrShape.cpp | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/src/gpu/GrShape.cpp b/src/gpu/GrShape.cpp index 221247808b..eb07ffc558 100644 --- a/src/gpu/GrShape.cpp +++ b/src/gpu/GrShape.cpp @@ -13,8 +13,6 @@ GrShape& GrShape::operator=(const GrShape& that) { switch (fType) { case Type::kEmpty: break; - case Type::kInvertedEmpty: - break; case Type::kRRect: fRRectData = that.fRRectData; break; @@ -38,8 +36,6 @@ SkRect GrShape::bounds() const { switch (fType) { case Type::kEmpty: return kInverted; - case Type::kInvertedEmpty: - return kInverted; case Type::kLine: { SkRect bounds; if (fLineData.fPts[0].fX < fLineData.fPts[1].fX) { @@ -68,10 +64,9 @@ SkRect GrShape::bounds() const { } SkRect GrShape::styledBounds() const { - if (this->isEmpty() && !fStyle.hasNonDashPathEffect()) { + if (Type::kEmpty == fType && !fStyle.hasNonDashPathEffect()) { return SkRect::MakeEmpty(); } - SkRect bounds; fStyle.adjustBounds(&bounds, this->bounds()); return bounds; @@ -127,8 +122,6 @@ int GrShape::unstyledKeySize() const { switch (fType) { case Type::kEmpty: return 1; - case Type::kInvertedEmpty: - return 1; case Type::kRRect: SkASSERT(!fInheritedKey.count()); SkASSERT(0 == SkRRect::kSizeInMemory % sizeof(uint32_t)); @@ -165,9 +158,6 @@ void GrShape::writeUnstyledKey(uint32_t* key) const { case Type::kEmpty: *key++ = 1; break; - case Type::kInvertedEmpty: - *key++ = 2; - break; case Type::kRRect: fRRectData.fRRect.writeToMemory(key); key += SkRRect::kSizeInMemory / sizeof(uint32_t); @@ -254,8 +244,6 @@ GrShape::GrShape(const GrShape& that) : fStyle(that.fStyle) { switch (fType) { case Type::kEmpty: break; - case Type::kInvertedEmpty: - break; case Type::kRRect: fRRectData = that.fRRectData; break; @@ -366,9 +354,7 @@ void GrShape::attemptToSimplifyPath() { bool inverted = this->path().isInverseFillType(); SkPoint pts[2]; if (this->path().isEmpty()) { - // Dashing ignores inverseness skbug.com/5421. - this->changeType(inverted && !this->style().isDashed() ? Type::kInvertedEmpty - : Type::kEmpty); + this->changeType(Type::kEmpty); } else if (this->path().isLine(pts)) { this->changeType(Type::kLine); fLineData.fPts[0] = pts[0]; @@ -456,8 +442,7 @@ void GrShape::attemptToSimplifyRRect() { SkASSERT(Type::kRRect == fType); SkASSERT(!fInheritedKey.count()); if (fRRectData.fRRect.isEmpty()) { - // Dashing ignores the inverseness currently. skbug.com/5421 - fType = fRRectData.fInverted && !fStyle.isDashed() ? Type::kInvertedEmpty : Type::kEmpty; + fType = Type::kEmpty; return; } if (!this->style().hasPathEffect()) { @@ -495,8 +480,8 @@ void GrShape::attemptToSimplifyLine() { rec.setStrokeStyle(fStyle.strokeRec().getWidth(), false); fStyle = GrStyle(rec, nullptr); } - if (fStyle.isSimpleFill()) { - this->changeType(fLineData.fInverted ? Type::kInvertedEmpty : Type::kEmpty); + if (fStyle.isSimpleFill() && !fLineData.fInverted) { + this->changeType(Type::kEmpty); return; } SkPoint* pts = fLineData.fPts; @@ -540,7 +525,7 @@ void GrShape::attemptToSimplifyLine() { fRRectData.fStart = kDefaultRRectStart; if (fRRectData.fRRect.isEmpty()) { // This can happen when r is very small relative to the rect edges. - this->changeType(inverted ? Type::kInvertedEmpty : Type::kEmpty); + this->changeType(Type::kEmpty); return; } fStyle = GrStyle::SimpleFill(); |