diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-02-22 16:36:57 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-02-22 16:36:57 +0000 |
commit | 13b77e83076d3735a86926f6f48741e1360c525c (patch) | |
tree | 75a841ccc480a28e04989104ae0c9f3ee68142c6 | |
parent | 41809934d77a486ac30e36baadc519cbb11c4c05 (diff) |
remove obsolete build flags:
SK_IGNORE_TRANS_CLAMP_FIX
SK_IGNORE_1XN_BITMAP_OPT
SK_IGNORE_CLIP_BUG_FIX
SK_IGNORE_FAST_SCALEMATRIX_INVERT
SK_IGNORE_QUAD_STROKE_FIX
SK_IGNORE_MULTIPLY_XFERMODE_OPT
SK_IGNORE_LARGE_DASH_OPT
Review URL: https://codereview.appspot.com/7381050
git-svn-id: http://skia.googlecode.com/svn/trunk@7829 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | src/core/SkBitmapProcState.cpp | 11 | ||||
-rw-r--r-- | src/core/SkDraw.cpp | 19 | ||||
-rw-r--r-- | src/core/SkEdgeClipper.cpp | 9 | ||||
-rw-r--r-- | src/core/SkMatrix.cpp | 2 | ||||
-rw-r--r-- | src/core/SkStroke.cpp | 6 | ||||
-rw-r--r-- | src/effects/SkBlendImageFilter.cpp | 25 | ||||
-rw-r--r-- | src/effects/SkDashPathEffect.cpp | 5 |
7 files changed, 3 insertions, 74 deletions
diff --git a/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp index 8bafee1b1d..e44237880f 100644 --- a/src/core/SkBitmapProcState.cpp +++ b/src/core/SkBitmapProcState.cpp @@ -124,14 +124,6 @@ bool SkBitmapProcState::chooseProcs(const SkMatrix& inv, const SkPaint& paint) { bool fixupMatrix = clamp_clamp ? just_trans_clamp(*m, *fBitmap) : just_trans_general(*m); if (fixupMatrix) { -#ifdef SK_IGNORE_TRANS_CLAMP_FIX - if (m != &fUnitInvMatrix) { // can't mutate the original - fUnitInvMatrix = inv; - m = &fUnitInvMatrix; - } - fUnitInvMatrix.set(SkMatrix::kMScaleX, SK_Scalar1); - fUnitInvMatrix.set(SkMatrix::kMScaleY, SK_Scalar1); -#else // If we can be treated just like translate, construct that inverse // such that we landed in the proper place. Given that m may have // some slight scale, we have to invert it to compute this new @@ -145,7 +137,6 @@ bool SkBitmapProcState::chooseProcs(const SkMatrix& inv, const SkPaint& paint) { // now the following code will sniff m, and decide to take the // fast case (since m is purely translate). } -#endif } } @@ -573,7 +564,6 @@ SkBitmapProcState::ShaderProc32 SkBitmapProcState::chooseShaderProc32() { return NULL; } -#ifndef SK_IGNORE_1XN_BITMAP_OPT static const unsigned kMask = SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask; if (1 == fBitmap->width() && 0 == (fInvType & ~kMask)) { @@ -582,7 +572,6 @@ SkBitmapProcState::ShaderProc32 SkBitmapProcState::chooseShaderProc32() { } return S32_D32_constX_shaderproc; } -#endif if (fAlphaScale < 256) { return NULL; diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp index 0c8c7d36c6..7c3d7c57d2 100644 --- a/src/core/SkDraw.cpp +++ b/src/core/SkDraw.cpp @@ -1140,28 +1140,9 @@ void SkDraw::drawPath(const SkPath& origSrcPath, const SkPaint& origPaint, go ahead and treat it as if it were, so that subsequent code can go fast. */ static bool just_translate(const SkMatrix& matrix, const SkBitmap& bitmap) { -#ifdef SK_IGNORE_TRANS_CLAMP_FIX - SkMatrix::TypeMask mask = matrix.getType(); - - if (mask & (SkMatrix::kAffine_Mask | SkMatrix::kPerspective_Mask)) { - return false; - } - if (mask & SkMatrix::kScale_Mask) { - SkScalar sx = matrix[SkMatrix::kMScaleX]; - SkScalar sy = matrix[SkMatrix::kMScaleY]; - int w = bitmap.width(); - int h = bitmap.height(); - int sw = SkScalarRound(SkScalarMul(sx, SkIntToScalar(w))); - int sh = SkScalarRound(SkScalarMul(sy, SkIntToScalar(h))); - return sw == w && sh == h; - } - // if we got here, we're either kTranslate_Mask or identity - return true; -#else unsigned bits = 0; // TODO: find a way to allow the caller to tell us to // respect filtering. return SkTreatAsSprite(matrix, bitmap.width(), bitmap.height(), bits); -#endif } void SkDraw::drawBitmapAsMask(const SkBitmap& bitmap, diff --git a/src/core/SkEdgeClipper.cpp b/src/core/SkEdgeClipper.cpp index 1f0e38262a..b166bc67f0 100644 --- a/src/core/SkEdgeClipper.cpp +++ b/src/core/SkEdgeClipper.cpp @@ -245,12 +245,9 @@ static bool chopMonoCubicAt(SkScalar c0, SkScalar c1, SkScalar c2, SkScalar c3, SkScalar minT = 0; SkScalar maxT = SK_Scalar1; SkScalar mid; - int i; -#ifdef SK_IGNORE_CLIP_BUG_FIX - for (i = 0; i < 16; i++) { -#else - for (i = 0; i < 24; i++) { -#endif + + // This is a lot of iterations. Is there a faster way? + for (int i = 0; i < 24; i++) { mid = SkScalarAve(minT, maxT); SkScalar delta = eval_cubic_coeff(A, B, C, D, mid); if (delta < 0) { diff --git a/src/core/SkMatrix.cpp b/src/core/SkMatrix.cpp index 31a8e374a5..d420dd3b92 100644 --- a/src/core/SkMatrix.cpp +++ b/src/core/SkMatrix.cpp @@ -888,7 +888,6 @@ bool SkMatrix::invertNonIdentity(SkMatrix* inv) const { TypeMask mask = this->getType(); -#ifndef SK_IGNORE_FAST_SCALEMATRIX_INVERT if (0 == (mask & ~(kScale_Mask | kTranslate_Mask))) { bool invertible = true; if (inv) { @@ -925,7 +924,6 @@ bool SkMatrix::invertNonIdentity(SkMatrix* inv) const { } return invertible; } -#endif int isPersp = mask & kPerspective_Mask; int shift; diff --git a/src/core/SkStroke.cpp b/src/core/SkStroke.cpp index cc98d7428a..1afedc5c24 100644 --- a/src/core/SkStroke.cpp +++ b/src/core/SkStroke.cpp @@ -257,17 +257,11 @@ void SkPathStroker::quad_to(const SkPoint pts[3], } else { SkVector normalB; -#ifdef SK_IGNORE_QUAD_STROKE_FIX - SkVector unitB; - SkAssertResult(set_normal_unitnormal(pts[0], pts[2], fRadius, - &normalB, &unitB)); -#else normalB = pts[2] - pts[0]; normalB.rotateCCW(); SkScalar dot = SkPoint::DotProduct(unitNormalAB, *unitNormalBC); SkAssertResult(normalB.setLength(SkScalarDiv(fRadius, SkScalarSqrt((SK_Scalar1 + dot)/2)))); -#endif fOuter.quadTo( pts[1].fX + normalB.fX, pts[1].fY + normalB.fY, pts[2].fX + normalBC->fX, pts[2].fY + normalBC->fY); diff --git a/src/effects/SkBlendImageFilter.cpp b/src/effects/SkBlendImageFilter.cpp index 6da37641f4..c8c4c1bbf2 100644 --- a/src/effects/SkBlendImageFilter.cpp +++ b/src/effects/SkBlendImageFilter.cpp @@ -36,20 +36,6 @@ SkXfermode::Mode modeToXfermode(SkBlendImageFilter::Mode mode) { return SkXfermode::kSrcOver_Mode; } -#ifdef SK_IGNORE_MULTIPLY_XFERMODE_OPT -SkPMColor multiply_proc(SkPMColor src, SkPMColor dst) { - int omsa = 255 - SkGetPackedA32(src); - int sr = SkGetPackedR32(src), sg = SkGetPackedG32(src), sb = SkGetPackedB32(src); - int omda = 255 - SkGetPackedA32(dst); - int dr = SkGetPackedR32(dst), dg = SkGetPackedG32(dst), db = SkGetPackedB32(dst); - int a = 255 - SkMulDiv255Round(omsa, omda); - int r = SkMulDiv255Round(omsa, dr) + SkMulDiv255Round(omda, sr) + SkMulDiv255Round(sr, dr); - int g = SkMulDiv255Round(omsa, dg) + SkMulDiv255Round(omda, sg) + SkMulDiv255Round(sg, dg); - int b = SkMulDiv255Round(omsa, db) + SkMulDiv255Round(omda, sb) + SkMulDiv255Round(sb, db); - return SkPackARGB32(a, r, g, b); -} -#endif - }; /////////////////////////////////////////////////////////////////////////////// @@ -98,18 +84,7 @@ bool SkBlendImageFilter::onFilterImage(Proxy* proxy, SkPaint paint; paint.setXfermodeMode(SkXfermode::kSrc_Mode); canvas.drawBitmap(background, 0, 0, &paint); -#ifdef SK_IGNORE_MULTIPLY_XFERMODE_OPT - // FEBlend's multiply mode is (1 - Sa) * Da + (1 - Da) * Sc + Sc * Dc - // Skia's is just Sc * Dc. So we use a custom proc to implement FEBlend's - // version. - if (fMode == SkBlendImageFilter::kMultiply_Mode) { - paint.setXfermode(new SkProcXfermode(multiply_proc))->unref(); - } else { - paint.setXfermodeMode(modeToXfermode(fMode)); - } -#else paint.setXfermodeMode(modeToXfermode(fMode)); -#endif canvas.drawBitmap(foreground, 0, 0, &paint); return true; } diff --git a/src/effects/SkDashPathEffect.cpp b/src/effects/SkDashPathEffect.cpp index 10322705e4..a3a011c08c 100644 --- a/src/effects/SkDashPathEffect.cpp +++ b/src/effects/SkDashPathEffect.cpp @@ -230,11 +230,6 @@ private: bool SkDashPathEffect::filterPath(SkPath* dst, const SkPath& src, SkStrokeRec* rec, const SkRect* cullRect) const { - -#ifdef SK_IGNORE_LARGE_DASH_OPT - cullRect = NULL; -#endif - // we do nothing if the src wants to be filled, or if our dashlength is 0 if (rec->isFillStyle() || fInitialDashLength < 0) { return false; |