diff options
author | Yuqian Li <liyuqian@google.com> | 2018-04-11 16:34:06 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-04-12 16:24:40 +0000 |
commit | 9438790b66fd2193a47971f66c44f7cec80a795a (patch) | |
tree | 9380b48a43639cc3f295a9ea8109b4811d1e2d14 /src | |
parent | 2dc50cc92af008155d98f3729828eae71f82930d (diff) |
Reland "Add private fIsBadForDAA bit to SkPath"
This reverts commit ed5e069dbb0b2ef49e22b9d17af3875e3682cd61.
Reason for revert: add the guard flag
Original change's description:
> Revert "Add private fIsBadForDAA bit to SkPath"
>
> This reverts commit 54aefc74103a5c1810a7cc074746915c78ab3132.
>
> Reason for revert: Forget the guard flag. Pixel tests would fail.
>
> Original change's description:
> > Add private fIsBadForDAA bit to SkPath
> >
> > Bug: chromium:821353
> > Change-Id: Ic6585e76df692bb1853d0990d75f0e8d1dee22f4
> > Reviewed-on: https://skia-review.googlesource.com/120201
> > Commit-Queue: Yuqian Li <liyuqian@google.com>
> > Reviewed-by: Mike Reed <reed@google.com>
>
> TBR=caryclark@google.com,liyuqian@google.com,reed@google.com
>
> Change-Id: I2fe7cfcc3a80a51415f72d656da95a894a3240a4
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: chromium:821353
> Reviewed-on: https://skia-review.googlesource.com/120505
> Reviewed-by: Yuqian Li <liyuqian@google.com>
> Commit-Queue: Yuqian Li <liyuqian@google.com>
TBR=caryclark@google.com,liyuqian@google.com,reed@google.com
Change-Id: Iebf7caf9ca74f305dec25b1b6512e93cb41cc8ec
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:821353
Reviewed-on: https://skia-review.googlesource.com/120620
Commit-Queue: Yuqian Li <liyuqian@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkDraw.cpp | 2 | ||||
-rw-r--r-- | src/core/SkPath.cpp | 2 | ||||
-rw-r--r-- | src/core/SkPathPriv.h | 4 | ||||
-rw-r--r-- | src/core/SkScalerContext.cpp | 4 | ||||
-rw-r--r-- | src/core/SkScan_AntiPath.cpp | 3 |
5 files changed, 14 insertions, 1 deletions
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp index a06dacff19..5c5247c4cc 100644 --- a/src/core/SkDraw.cpp +++ b/src/core/SkDraw.cpp @@ -22,6 +22,7 @@ #include "SkMatrixUtils.h" #include "SkPaint.h" #include "SkPathEffect.h" +#include "SkPathPriv.h" #include "SkRasterClip.h" #include "SkRectPriv.h" #include "SkRRect.h" @@ -1067,6 +1068,7 @@ void SkDraw::drawPath(const SkPath& origSrcPath, const SkPaint& origPaint, tmpPath = iData->fAlloc->make<SkPath>(); } tmpPath->setIsVolatile(true); + SkPathPriv::SetIsBadForDAA(*tmpPath, SkPathPriv::IsBadForDAA(origSrcPath)); if (prePathMatrix) { if (origPaint.getPathEffect() || origPaint.getStyle() != SkPaint::kFill_Style) { diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp index 942b95da4d..62a3cd6c55 100644 --- a/src/core/SkPath.cpp +++ b/src/core/SkPath.cpp @@ -140,6 +140,7 @@ SkPath::SkPath() : fPathRef(SkPathRef::CreateEmpty()) { this->resetFields(); fIsVolatile = false; + fIsBadForDAA = false; } void SkPath::resetFields() { @@ -179,6 +180,7 @@ void SkPath::copyFields(const SkPath& that) { fLastMoveToIndex = that.fLastMoveToIndex; fFillType = that.fFillType; fIsVolatile = that.fIsVolatile; + fIsBadForDAA = that.fIsBadForDAA; // Non-atomic assignment of atomic values. fConvexity .store(that.fConvexity .load()); diff --git a/src/core/SkPathPriv.h b/src/core/SkPathPriv.h index 49977b10fd..506c5e181a 100644 --- a/src/core/SkPathPriv.h +++ b/src/core/SkPathPriv.h @@ -211,6 +211,10 @@ public: } return result; } + + // For crbug.com/821353 and skbug.com/6886 + static bool IsBadForDAA(const SkPath& path) { return path.fIsBadForDAA; } + static void SetIsBadForDAA(SkPath& path, bool isBadForDAA) { path.fIsBadForDAA = isBadForDAA; } }; #endif diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp index 5923e4a98a..7524c16626 100644 --- a/src/core/SkScalerContext.cpp +++ b/src/core/SkScalerContext.cpp @@ -21,6 +21,7 @@ #include "SkMatrix22.h" #include "SkPaintPriv.h" #include "SkPathEffect.h" +#include "SkPathPriv.h" #include "SkRasterClip.h" #include "SkReadBuffer.h" #include "SkRectPriv.h" @@ -445,6 +446,9 @@ void SkScalerContext::getImage(const SkGlyph& origGlyph) { } else { SkASSERT(SkMask::kARGB32_Format != origGlyph.fMaskFormat); SkASSERT(SkMask::kARGB32_Format != mask.fFormat); +#ifndef SK_SUPPORT_LEGACY_PATH_DAA_BIT + SkPathPriv::SetIsBadForDAA(devPath, true); // crbug.com/821353 +#endif generateMask(mask, devPath, fPreBlend); } } diff --git a/src/core/SkScan_AntiPath.cpp b/src/core/SkScan_AntiPath.cpp index ab86b4e7d9..45bc2e2ea6 100644 --- a/src/core/SkScan_AntiPath.cpp +++ b/src/core/SkScan_AntiPath.cpp @@ -8,6 +8,7 @@ #include "SkScanPriv.h" #include "SkPath.h" +#include "SkPathPriv.h" #include "SkMatrix.h" #include "SkBlitter.h" #include "SkRegion.h" @@ -601,7 +602,7 @@ static bool ShouldUseDAA(const SkPath& path) { if (gSkForceDeltaAA) { return true; } - if (!gSkUseDeltaAA) { + if (!gSkUseDeltaAA || SkPathPriv::IsBadForDAA(path)) { return false; } |