aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrShape.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-04-25 21:20:20 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-25 21:20:30 +0000
commit580aee2fa4a57bf8208498fbc23acea04e16e092 (patch)
tree7646f6df05aac4d4d2908bcd9cbd13637a749075 /src/gpu/GrShape.h
parent46b08123b36bc4861e1e0d5738c02650fd103892 (diff)
Reland "Revert "Add arcs as a specialized geometry to GrShape.""
This reverts commit 8a98bc96748d1bdaf9c2d8cfa0b672e3a035973d. Reason for revert: <INSERT REASONING HERE> Original change's description: > Revert "Revert "Add arcs as a specialized geometry to GrShape."" > > This reverts commit af88ec37124846a0168a4ab061bf10cc6030c2d6. > > Bug: skia:7794 > Change-Id: I2d0e1d7b4e025481241d823b09f5de5d0f1a13eb > Reviewed-on: https://skia-review.googlesource.com/123627 > Reviewed-by: Robert Phillips <robertphillips@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> TBR=bsalomon@google.com,robertphillips@google.com Change-Id: Ib09a533600028b76a69b455c952f3dd12b39bdba No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7794 Reviewed-on: https://skia-review.googlesource.com/123780 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrShape.h')
-rw-r--r--src/gpu/GrShape.h58
1 files changed, 11 insertions, 47 deletions
diff --git a/src/gpu/GrShape.h b/src/gpu/GrShape.h
index 36402330ce..99579ba4c3 100644
--- a/src/gpu/GrShape.h
+++ b/src/gpu/GrShape.h
@@ -116,9 +116,6 @@ public:
this->attemptToSimplifyRRect();
}
- static GrShape MakeArc(const SkRect& oval, SkScalar startAngleDegrees,
- SkScalar sweepAngleDegrees, bool useCenter, const GrStyle& style);
-
GrShape(const GrShape&);
GrShape& operator=(const GrShape& that);
@@ -212,16 +209,6 @@ public:
out->setFillType(kDefaultPathFillType);
}
break;
- case Type::kArc:
- SkPathPriv::CreateDrawArcPath(out, fArcData.fOval, fArcData.fStartAngleDegrees,
- fArcData.fSweepAngleDegrees, fArcData.fUseCenter,
- fStyle.isSimpleFill());
- if (fArcData.fInverted) {
- out->setFillType(kDefaultPathInverseFillType);
- } else {
- out->setFillType(kDefaultPathFillType);
- }
- break;
case Type::kLine:
out->reset();
out->moveTo(fLineData.fPts[0]);
@@ -269,10 +256,6 @@ public:
return true;
case Type::kRRect:
return true;
- case Type::kArc:
- return SkPathPriv::DrawArcIsConvex(fArcData.fSweepAngleDegrees,
- SkToBool(fArcData.fUseCenter),
- fStyle.isSimpleFill());
case Type::kLine:
return true;
case Type::kPath:
@@ -299,9 +282,6 @@ public:
case Type::kRRect:
ret = fRRectData.fInverted;
break;
- case Type::kArc:
- ret = fArcData.fInverted;
- break;
case Type::kLine:
ret = fLineData.fInverted;
break;
@@ -340,8 +320,6 @@ public:
return true;
case Type::kRRect:
return true;
- case Type::kArc:
- return fArcData.fUseCenter;
case Type::kLine:
return false;
case Type::kPath:
@@ -365,11 +343,6 @@ public:
return SkPath::kLine_SegmentMask;
}
return SkPath::kLine_SegmentMask | SkPath::kConic_SegmentMask;
- case Type::kArc:
- if (fArcData.fUseCenter) {
- return SkPath::kConic_SegmentMask | SkPath::kLine_SegmentMask;
- }
- return SkPath::kConic_SegmentMask;
case Type::kLine:
return SkPath::kLine_SegmentMask;
case Type::kPath:
@@ -414,7 +387,6 @@ private:
kEmpty,
kInvertedEmpty,
kRRect,
- kArc,
kLine,
kPath,
};
@@ -466,7 +438,6 @@ private:
void attemptToSimplifyPath();
void attemptToSimplifyRRect();
void attemptToSimplifyLine();
- void attemptToSimplifyArc();
bool attemptToSimplifyStrokedLineToRRect();
@@ -523,33 +494,26 @@ private:
return kPathRRectStartIdx;
}
+ Type fType;
union {
struct {
- SkRRect fRRect;
- SkPath::Direction fDir;
- unsigned fStart;
- bool fInverted;
+ SkRRect fRRect;
+ SkPath::Direction fDir;
+ unsigned fStart;
+ bool fInverted;
} fRRectData;
struct {
- SkRect fOval;
- SkScalar fStartAngleDegrees;
- SkScalar fSweepAngleDegrees;
- int16_t fUseCenter;
- int16_t fInverted;
- } fArcData;
- struct {
- SkPath fPath;
+ SkPath fPath;
// Gen ID of the original path (fPath may be modified)
- int32_t fGenID;
+ int32_t fGenID;
} fPathData;
struct {
- SkPoint fPts[2];
- bool fInverted;
+ SkPoint fPts[2];
+ bool fInverted;
} fLineData;
};
- GrStyle fStyle;
- SkTLazy<SkPath> fInheritedPathForListeners;
+ GrStyle fStyle;
+ SkTLazy<SkPath> fInheritedPathForListeners;
SkAutoSTArray<8, uint32_t> fInheritedKey;
- Type fType;
};
#endif