From 9ff61ab33cd0ac5f76f607680171d6846a3d64e8 Mon Sep 17 00:00:00 2001 From: Jim Van Verth Date: Thu, 19 Dec 2019 21:12:54 +0000 Subject: [PATCH] Revert "Generate small path SDFs directly from path." This reverts commit 4407acb1440fe6cf39a8ed5849ee5ba2c8003150. Reason for revert: Causing issues with colorcomposefilter_wacky Original change's description: > Generate small path SDFs directly from path. > > Change-Id: Ifdda3038eadf3910cb18bdefa8115f5038b1440e > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261138 > Reviewed-by: Brian Salomon > Commit-Queue: Jim Van Verth TBR=jvanverth@google.com,bsalomon@google.com Change-Id: I331e855c3198febcd8ca9ef0c5e6fe1ddc5ad8cf No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261177 Reviewed-by: Jim Van Verth Commit-Queue: Jim Van Verth --- src/gpu/GrDistanceFieldGenFromVector.h | 4 ++++ src/gpu/ops/GrSmallPathRenderer.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/gpu/GrDistanceFieldGenFromVector.h b/src/gpu/GrDistanceFieldGenFromVector.h index 7e2d5d9846..036216643f 100644 --- a/src/gpu/GrDistanceFieldGenFromVector.h +++ b/src/gpu/GrDistanceFieldGenFromVector.h @@ -12,6 +12,10 @@ class SkMatrix; +#ifndef SK_USE_LEGACY_DISTANCE_FIELDS + #define SK_USE_LEGACY_DISTANCE_FIELDS +#endif + /** Given a vector path, generate the associated distance field. * @param distanceField The distance field to be generated. Should already be allocated diff --git a/src/gpu/ops/GrSmallPathRenderer.cpp b/src/gpu/ops/GrSmallPathRenderer.cpp index 25fde10ad4..c5e8f8eb38 100644 --- a/src/gpu/ops/GrSmallPathRenderer.cpp +++ b/src/gpu/ops/GrSmallPathRenderer.cpp @@ -570,11 +570,13 @@ private: SkPath path; shape.asPath(&path); +#ifndef SK_USE_LEGACY_DISTANCE_FIELDS // Generate signed distance field directly from SkPath bool succeed = GrGenerateDistanceFieldFromPath((unsigned char*)dfStorage.get(), path, drawMatrix, width, height, width * sizeof(unsigned char)); if (!succeed) { +#endif // setup bitmap backing SkAutoPixmapStorage dst; if (!dst.tryAlloc(SkImageInfo::MakeA8(devPathBounds.width(), @@ -602,7 +604,9 @@ private: SkGenerateDistanceFieldFromA8Image((unsigned char*)dfStorage.get(), (const unsigned char*)dst.addr(), dst.width(), dst.height(), dst.rowBytes()); +#ifndef SK_USE_LEGACY_DISTANCE_FIELDS } +#endif // add to atlas SkIPoint16 atlasLocation;