diff options
author | rmistry <rmistry@google.com> | 2016-12-21 04:25:18 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-12-21 04:25:18 -0800 |
commit | 478422596eb2521ad6f912d36299df7a36959873 (patch) | |
tree | 2c1b7e878e45e7903af81f5f049077984aed5c4d /src/gpu/text | |
parent | 40a82bd0f48d04680fbe7af063a4f2e3eae122e6 (diff) |
Revert of Generate Signed Distance Field directly from vector path (patchset #23 id:440001 of https://codereview.chromium.org/1643143002/ )
Reason for revert:
Caused test failures again but this time in Win8 and Win10 bots:
* https://chromium-swarm.appspot.com/task?id=33384540bf6f3710&refresh=10
* https://chromium-swarm.appspot.com/task?id=3338a3ea9f6fe510&refresh=10
Original issue's description:
> Generate Signed Distance Field directly from vector path
>
> Add SkGenerateDistanceFieldFromPath API to generate signed distance field directly from SkPath.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1643143002
>
> Committed: https://skia.googlesource.com/skia/+/4de97a64e8829323a7070b623411d9f9ddb0cd0f
> Committed: https://skia.googlesource.com/skia/+/e8f0a7b986f1e5583c9bc162efcdd92fd6430549
> Committed: https://skia.googlesource.com/skia/+/67c7c81a82b6351e9fbbf235084d7120162d9268
> Review-Url: https://codereview.chromium.org/1643143002
> Committed: https://skia.googlesource.com/skia/+/64b70b096ac20833d9737758a4bd5f2a51078bc4
> Review-Url: https://codereview.chromium.org/1643143002
> Committed: https://skia.googlesource.com/skia/+/6d2f73c364d0d823f14d1ddebc88e0bcbc8f0634
TBR=bsalomon@google.com,jvanverth@google.com,mtklein@google.com,wasim.abbas@arm.com,caryclark@google.com,reed@google.com,egdaniel@google.com,joel.liang@arm.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review-Url: https://codereview.chromium.org/2597473003
Diffstat (limited to 'src/gpu/text')
-rw-r--r-- | src/gpu/text/GrAtlasGlyphCache.cpp | 59 |
1 files changed, 18 insertions, 41 deletions
diff --git a/src/gpu/text/GrAtlasGlyphCache.cpp b/src/gpu/text/GrAtlasGlyphCache.cpp index b466ca88d2..803dbb48e1 100644 --- a/src/gpu/text/GrAtlasGlyphCache.cpp +++ b/src/gpu/text/GrAtlasGlyphCache.cpp @@ -14,7 +14,6 @@ #include "SkString.h" #include "SkDistanceFieldGen.h" -#include "GrDistanceFieldGenFromVector.h" bool GrAtlasGlyphCache::initAtlas(GrMaskFormat format) { int index = MaskFormatToAtlasIndex(format); @@ -321,51 +320,29 @@ static bool get_packed_glyph_df_image(SkGlyphCache* cache, const SkGlyph& glyph, int width, int height, void* dst) { SkASSERT(glyph.fWidth + 2*SK_DistanceFieldPad == width); SkASSERT(glyph.fHeight + 2*SK_DistanceFieldPad == height); - -#ifndef SK_USE_LEGACY_DISTANCE_FIELDS - const SkPath* path = cache->findPath(glyph); - if (nullptr == path) { + const void* image = cache->findImage(glyph); + if (nullptr == image) { return false; } - // now generate the distance field SkASSERT(dst); - SkMatrix drawMatrix; - drawMatrix.setTranslate((SkScalar)-glyph.fLeft, (SkScalar)-glyph.fTop); - - // Generate signed distance field directly from SkPath - bool succeed = GrGenerateDistanceFieldFromPath((unsigned char*)dst, - *path, drawMatrix, - width, height, width * sizeof(unsigned char)); - - if (!succeed) { -#endif - const void* image = cache->findImage(glyph); - if (nullptr == image) { - return false; - } - - // now generate the distance field - SkASSERT(dst); - SkMask::Format maskFormat = static_cast<SkMask::Format>(glyph.fMaskFormat); - if (SkMask::kA8_Format == maskFormat) { - // make the distance field from the image - SkGenerateDistanceFieldFromA8Image((unsigned char*)dst, - (unsigned char*)image, - glyph.fWidth, glyph.fHeight, - glyph.rowBytes()); - } else if (SkMask::kBW_Format == maskFormat) { - // make the distance field from the image - SkGenerateDistanceFieldFromBWImage((unsigned char*)dst, - (unsigned char*)image, - glyph.fWidth, glyph.fHeight, - glyph.rowBytes()); - } else { - return false; - } -#ifndef SK_USE_LEGACY_DISTANCE_FIELDS + SkMask::Format maskFormat = static_cast<SkMask::Format>(glyph.fMaskFormat); + if (SkMask::kA8_Format == maskFormat) { + // make the distance field from the image + SkGenerateDistanceFieldFromA8Image((unsigned char*)dst, + (unsigned char*)image, + glyph.fWidth, glyph.fHeight, + glyph.rowBytes()); + } else if (SkMask::kBW_Format == maskFormat) { + // make the distance field from the image + SkGenerateDistanceFieldFromBWImage((unsigned char*)dst, + (unsigned char*)image, + glyph.fWidth, glyph.fHeight, + glyph.rowBytes()); + } else { + return false; } -#endif + return true; } |