aboutsummaryrefslogtreecommitdiff
path: root/src/core/SkStroke.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/SkStroke.cpp')
-rw-r--r--src/core/SkStroke.cpp28
1 files changed, 1 insertions, 27 deletions
diff --git a/src/core/SkStroke.cpp b/src/core/SkStroke.cpp
index 0d3885f0ea..fd7dccc6c7 100644
--- a/src/core/SkStroke.cpp
+++ b/src/core/SkStroke.cpp
@@ -563,38 +563,12 @@ void SkStroke::setJoin(SkPaint::Join join) {
#define APPLY_PROC(proc, pts, count)
#endif
-// If src==dst, then we use a tmp path to record the stroke, and then swap
-// its contents with src when we're done.
-class AutoTmpPath {
-public:
- AutoTmpPath(const SkPath& src, SkPath** dst) : fSrc(src) {
- if (&src == *dst) {
- *dst = &fTmpDst;
- } else {
- (*dst)->reset();
- fSwapWithSrc = false;
- }
- }
-
- ~AutoTmpPath() {
- if (fSwapWithSrc) {
- fTmpDst.swap(*const_cast<SkPath*>(&fSrc));
- }
- }
-
-private:
- SkPath fTmpDst;
- const SkPath& fSrc;
- bool fSwapWithSrc;
-};
-
void SkStroke::strokePath(const SkPath& src, SkPath* dst) const {
SkASSERT(&src != NULL && dst != NULL);
SkScalar radius = SkScalarHalf(fWidth);
- AutoTmpPath tmp(src, &dst);
-
+ dst->reset();
if (radius <= 0) {
return;
}