remove (unused?) arcto patheffect
Bug: skia: Change-Id: I80943cc495eb1edce839387f4b9512a66a4e5c11 Reviewed-on: https://skia-review.googlesource.com/25981 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Mike Reed <reed@google.com>
This commit is contained in:
parent
71f867c229
commit
40e7e65534
@ -8,7 +8,6 @@
|
||||
#include "Sk1DPathEffect.h"
|
||||
#include "Sk2DPathEffect.h"
|
||||
#include "SkAlphaThresholdFilter.h"
|
||||
#include "SkArcToPathEffect.h"
|
||||
#include "SkBlurImageFilter.h"
|
||||
#include "SkBlurMaskFilter.h"
|
||||
#include "SkCanvas.h"
|
||||
@ -414,12 +413,14 @@ static sk_sp<SkPathEffect> make_path_effect(bool canBeNull = true) {
|
||||
fuzz->nextRange(&s, 0, 2);
|
||||
if (canBeNull && s == 0) { return pathEffect; }
|
||||
|
||||
fuzz->nextRange(&s, 0, 8);
|
||||
fuzz->nextRange(&s, 0, 7);
|
||||
|
||||
switch (s) {
|
||||
case 0: {
|
||||
SkScalar a = make_number(true);
|
||||
pathEffect = SkArcToPathEffect::Make(a);
|
||||
SkPath path = make_path();
|
||||
SkMatrix m;
|
||||
init_matrix(&m);
|
||||
pathEffect = SkPath2DPathEffect::Make(m, path);
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
@ -463,14 +464,7 @@ static sk_sp<SkPathEffect> make_path_effect(bool canBeNull = true) {
|
||||
pathEffect = SkLine2DPathEffect::Make(a, m);
|
||||
break;
|
||||
}
|
||||
case 7: {
|
||||
SkPath path = make_path();
|
||||
SkMatrix m;
|
||||
init_matrix(&m);
|
||||
pathEffect = SkPath2DPathEffect::Make(m, path);
|
||||
break;
|
||||
}
|
||||
case 8:
|
||||
case 7:
|
||||
default: {
|
||||
sk_sp<SkPathEffect> a = make_path_effect(false);
|
||||
sk_sp<SkPathEffect> b = make_path_effect(false);
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include "Sk1DPathEffect.h"
|
||||
#include "Sk2DPathEffect.h"
|
||||
#include "SkAlphaThresholdFilter.h"
|
||||
#include "SkArcToPathEffect.h"
|
||||
#include "SkArithmeticImageFilter.h"
|
||||
#include "SkBlurImageFilter.h"
|
||||
#include "SkBlurMaskFilter.h"
|
||||
@ -496,7 +495,7 @@ static sk_sp<SkPathEffect> make_fuzz_patheffect(Fuzz* fuzz, int depth) {
|
||||
return nullptr;
|
||||
}
|
||||
uint8_t pathEffectType;
|
||||
fuzz->nextRange(&pathEffectType, 0, 9);
|
||||
fuzz->nextRange(&pathEffectType, 0, 8);
|
||||
switch (pathEffectType) {
|
||||
case 0: {
|
||||
return nullptr;
|
||||
@ -534,16 +533,11 @@ static sk_sp<SkPathEffect> make_fuzz_patheffect(Fuzz* fuzz, int depth) {
|
||||
return SkPath2DPathEffect::Make(matrix, path);
|
||||
}
|
||||
case 6: {
|
||||
SkScalar radius;
|
||||
fuzz->next(&radius);
|
||||
return SkArcToPathEffect::Make(radius);
|
||||
}
|
||||
case 7: {
|
||||
SkScalar radius;
|
||||
fuzz->next(&radius);
|
||||
return SkCornerPathEffect::Make(radius);
|
||||
}
|
||||
case 8: {
|
||||
case 7: {
|
||||
SkScalar phase;
|
||||
fuzz->next(&phase);
|
||||
SkScalar intervals[20];
|
||||
@ -552,7 +546,7 @@ static sk_sp<SkPathEffect> make_fuzz_patheffect(Fuzz* fuzz, int depth) {
|
||||
fuzz->nextN(intervals, count);
|
||||
return SkDashPathEffect::Make(intervals, count, phase);
|
||||
}
|
||||
case 9: {
|
||||
case 8: {
|
||||
SkScalar segLength, dev;
|
||||
uint32_t seed;
|
||||
fuzz->next(&segLength, &dev, &seed);
|
||||
|
@ -18,7 +18,6 @@ skia_effects_sources = [
|
||||
"$_src/effects/Sk1DPathEffect.cpp",
|
||||
"$_src/effects/Sk2DPathEffect.cpp",
|
||||
"$_src/effects/SkAlphaThresholdFilter.cpp",
|
||||
"$_src/effects/SkArcToPathEffect.cpp",
|
||||
"$_src/effects/SkArithmeticImageFilter.cpp",
|
||||
"$_src/effects/SkBlurMask.cpp",
|
||||
"$_src/effects/SkBlurMask.h",
|
||||
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
#ifndef SkArcToPathEffect_DEFINED
|
||||
#define SkArcToPathEffect_DEFINED
|
||||
|
||||
#include "SkPathEffect.h"
|
||||
|
||||
class SK_API SkArcToPathEffect : public SkPathEffect {
|
||||
public:
|
||||
/** radius must be > 0 to have an effect. It specifies the distance from each corner
|
||||
that should be "rounded".
|
||||
*/
|
||||
static sk_sp<SkPathEffect> Make(SkScalar radius) {
|
||||
if (radius <= 0) {
|
||||
return NULL;
|
||||
}
|
||||
return sk_sp<SkPathEffect>(new SkArcToPathEffect(radius));
|
||||
}
|
||||
|
||||
bool filterPath(SkPath* dst, const SkPath& src, SkStrokeRec*, const SkRect*) const override;
|
||||
|
||||
SK_TO_STRING_OVERRIDE()
|
||||
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkArcToPathEffect)
|
||||
|
||||
protected:
|
||||
explicit SkArcToPathEffect(SkScalar radius);
|
||||
void flatten(SkWriteBuffer&) const override;
|
||||
|
||||
private:
|
||||
SkScalar fRadius;
|
||||
|
||||
typedef SkPathEffect INHERITED;
|
||||
};
|
||||
|
||||
#endif
|
@ -8,7 +8,6 @@
|
||||
#include "Sk1DPathEffect.h"
|
||||
#include "Sk2DPathEffect.h"
|
||||
#include "SkAlphaThresholdFilter.h"
|
||||
#include "SkArcToPathEffect.h"
|
||||
#include "SkBlurImageFilter.h"
|
||||
#include "SkBlurMaskFilter.h"
|
||||
#include "SkCanvas.h"
|
||||
@ -418,9 +417,9 @@ static sk_sp<SkPathEffect> make_path_effect(bool canBeNull = true) {
|
||||
sk_sp<SkPathEffect> pathEffect;
|
||||
if (canBeNull && (R(3) == 1)) { return pathEffect; }
|
||||
|
||||
switch (R(9)) {
|
||||
switch (R(8)) {
|
||||
case 0:
|
||||
pathEffect = SkArcToPathEffect::Make(make_scalar(true));
|
||||
pathEffect = SkPath2DPathEffect::Make(make_matrix(), make_path());
|
||||
break;
|
||||
case 1:
|
||||
pathEffect = SkPathEffect::MakeCompose(make_path_effect(false),
|
||||
@ -449,9 +448,6 @@ static sk_sp<SkPathEffect> make_path_effect(bool canBeNull = true) {
|
||||
pathEffect = SkLine2DPathEffect::Make(make_scalar(), make_matrix());
|
||||
break;
|
||||
case 7:
|
||||
pathEffect = SkPath2DPathEffect::Make(make_matrix(), make_path());
|
||||
break;
|
||||
case 8:
|
||||
default:
|
||||
pathEffect = SkPathEffect::MakeSum(make_path_effect(false),
|
||||
make_path_effect(false));
|
||||
|
@ -208,13 +208,12 @@ DEF_SAMPLE( return new PathView; )
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "SkArcToPathEffect.h"
|
||||
#include "SkCornerPathEffect.h"
|
||||
#include "SkRandom.h"
|
||||
|
||||
class ArcToView : public SampleView {
|
||||
bool fDoFrame, fDoArcTo, fDoCorner, fDoConic;
|
||||
SkPaint fPtsPaint, fArcToPaint, fSkeletonPaint, fCornerPaint;
|
||||
bool fDoFrame, fDoCorner, fDoConic;
|
||||
SkPaint fPtsPaint, fSkeletonPaint, fCornerPaint;
|
||||
public:
|
||||
enum {
|
||||
N = 4
|
||||
@ -222,7 +221,7 @@ public:
|
||||
SkPoint fPts[N];
|
||||
|
||||
ArcToView()
|
||||
: fDoFrame(false), fDoArcTo(false), fDoCorner(false), fDoConic(false)
|
||||
: fDoFrame(false), fDoCorner(false), fDoConic(false)
|
||||
{
|
||||
SkRandom rand;
|
||||
for (int i = 0; i < N; ++i) {
|
||||
@ -236,12 +235,6 @@ public:
|
||||
fPtsPaint.setStrokeWidth(15);
|
||||
fPtsPaint.setStrokeCap(SkPaint::kRound_Cap);
|
||||
|
||||
fArcToPaint.setAntiAlias(true);
|
||||
fArcToPaint.setStyle(SkPaint::kStroke_Style);
|
||||
fArcToPaint.setStrokeWidth(9);
|
||||
fArcToPaint.setColor(0x800000FF);
|
||||
fArcToPaint.setPathEffect(SkArcToPathEffect::Make(rad));
|
||||
|
||||
fCornerPaint.setAntiAlias(true);
|
||||
fCornerPaint.setStyle(SkPaint::kStroke_Style);
|
||||
fCornerPaint.setStrokeWidth(13);
|
||||
@ -269,9 +262,8 @@ protected:
|
||||
if (SampleCode::CharQ(*evt, &uni)) {
|
||||
switch (uni) {
|
||||
case '1': this->toggle(fDoFrame); return true;
|
||||
case '2': this->toggle(fDoArcTo); return true;
|
||||
case '3': this->toggle(fDoCorner); return true;
|
||||
case '4': this->toggle(fDoConic); return true;
|
||||
case '2': this->toggle(fDoCorner); return true;
|
||||
case '3': this->toggle(fDoConic); return true;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
@ -297,9 +289,6 @@ protected:
|
||||
if (fDoCorner) {
|
||||
canvas->drawPath(path, fCornerPaint);
|
||||
}
|
||||
if (fDoArcTo) {
|
||||
canvas->drawPath(path, fArcToPaint);
|
||||
}
|
||||
|
||||
canvas->drawPath(path, fSkeletonPaint);
|
||||
}
|
||||
|
@ -1,78 +0,0 @@
|
||||
/*
|
||||
* Copyright 2014 Google Inc.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "SkArcToPathEffect.h"
|
||||
#include "SkPath.h"
|
||||
#include "SkPoint.h"
|
||||
#include "SkReadBuffer.h"
|
||||
#include "SkWriteBuffer.h"
|
||||
|
||||
SkArcToPathEffect::SkArcToPathEffect(SkScalar radius) : fRadius(radius) {}
|
||||
|
||||
bool SkArcToPathEffect::filterPath(SkPath* dst, const SkPath& src,
|
||||
SkStrokeRec*, const SkRect*) const {
|
||||
SkPath::Iter iter(src, false);
|
||||
SkPath::Verb verb;
|
||||
SkPoint pts[4];
|
||||
|
||||
SkPoint lastCorner = { 0, 0 }; // avoid warning
|
||||
SkPath::Verb prevVerb = SkPath::kMove_Verb;
|
||||
|
||||
for (;;) {
|
||||
switch (verb = iter.next(pts, false)) {
|
||||
case SkPath::kMove_Verb:
|
||||
if (SkPath::kLine_Verb == prevVerb) {
|
||||
dst->lineTo(lastCorner);
|
||||
}
|
||||
dst->moveTo(pts[0]);
|
||||
break;
|
||||
case SkPath::kLine_Verb:
|
||||
if (prevVerb == SkPath::kLine_Verb) {
|
||||
dst->arcTo(pts[0], pts[1], fRadius);
|
||||
}
|
||||
lastCorner = pts[1];
|
||||
break;
|
||||
case SkPath::kQuad_Verb:
|
||||
dst->quadTo(pts[1], pts[2]);
|
||||
lastCorner = pts[2];
|
||||
break;
|
||||
case SkPath::kConic_Verb:
|
||||
dst->conicTo(pts[1], pts[2], iter.conicWeight());
|
||||
lastCorner = pts[2];
|
||||
break;
|
||||
case SkPath::kCubic_Verb:
|
||||
dst->cubicTo(pts[1], pts[2], pts[3]);
|
||||
lastCorner = pts[3];
|
||||
break;
|
||||
case SkPath::kClose_Verb:
|
||||
dst->lineTo(lastCorner);
|
||||
break;
|
||||
case SkPath::kDone_Verb:
|
||||
dst->lineTo(lastCorner);
|
||||
goto DONE;
|
||||
}
|
||||
prevVerb = verb;
|
||||
}
|
||||
DONE:
|
||||
return true;
|
||||
}
|
||||
|
||||
sk_sp<SkFlattenable> SkArcToPathEffect::CreateProc(SkReadBuffer& buffer) {
|
||||
return SkArcToPathEffect::Make(buffer.readScalar());
|
||||
}
|
||||
|
||||
void SkArcToPathEffect::flatten(SkWriteBuffer& buffer) const {
|
||||
buffer.writeScalar(fRadius);
|
||||
}
|
||||
|
||||
#ifndef SK_IGNORE_TO_STRING
|
||||
void SkArcToPathEffect::toString(SkString* str) const {
|
||||
str->appendf("SkArcToPathEffect: (");
|
||||
str->appendf("radius: %f", fRadius);
|
||||
str->appendf(")");
|
||||
}
|
||||
#endif
|
@ -8,7 +8,6 @@
|
||||
#include "Sk1DPathEffect.h"
|
||||
#include "Sk2DPathEffect.h"
|
||||
#include "SkAlphaThresholdFilter.h"
|
||||
#include "SkArcToPathEffect.h"
|
||||
#include "SkBitmapSourceDeserializer.h"
|
||||
#include "SkBlurImageFilter.h"
|
||||
#include "SkBlurMaskFilter.h"
|
||||
@ -91,7 +90,6 @@ void SkFlattenable::PrivateInitializer::InitEffects() {
|
||||
SkNormalSource::InitializeFlattenables();
|
||||
|
||||
// PathEffect
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkArcToPathEffect)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkCornerPathEffect)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDashImpl)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiscretePathEffect)
|
||||
|
Loading…
Reference in New Issue
Block a user