diff options
author | Cary Clark <caryclark@skia.org> | 2018-04-05 13:09:58 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-04-05 23:52:23 +0000 |
commit | 99885411aef986f3de863e144a589adb6d7ecd0d (patch) | |
tree | 2c9b2fef53e2b4124b1ec89e4be8fa24c1f899c8 /include | |
parent | 5ddb30862509967eca24ba3831cc11ed5396eee7 (diff) |
remove SK_IGNORE_TO_STRING
SK_IGNORE_TO_STRING is not defined anywhere.
The same effect can be had by using a modern
linker.
Removing it simplifies bookmaker and makes
our includes easier to understand.
R=robertphillips@google.com
TBR=reed@google.com
Bug: skia:6898
Change-Id: Ib716f5ef1b42a7fbda0df43ece212d1b7c40289f
Reviewed-on: https://skia-review.googlesource.com/118963
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'include')
29 files changed, 39 insertions, 55 deletions
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h index f3855725b1..c4c9dc50a8 100644 --- a/include/core/SkBitmap.h +++ b/include/core/SkBitmap.h @@ -1246,14 +1246,12 @@ public: bool allocPixelRef(SkBitmap* bitmap) override; }; - /** macro expands to: void toString(SkString* str) const; - Creates string representation of SkBitmap. The representation is read by - internal debugging tools. The interface and implementation may be - suppressed by defining SK_IGNORE_TO_STRING. + /** Creates string representation of SkBitmap. The representation is read by + internal debugging tools. @param str storage for string representation */ - SK_TO_STRING_NONVIRT() + void toString(SkString* str) const; private: enum Flags { diff --git a/include/core/SkColorFilter.h b/include/core/SkColorFilter.h index 1bf18429cd..97c8220c6b 100644 --- a/include/core/SkColorFilter.h +++ b/include/core/SkColorFilter.h @@ -21,6 +21,7 @@ class SkBitmap; class SkColorSpace; class SkColorSpaceXformer; class SkRasterPipeline; +class SkString; /** * ColorFilters are optional objects in the drawing pipeline. When present in @@ -137,7 +138,7 @@ public: return this->filterColor(0) != 0; } - SK_TO_STRING_PUREVIRT() + virtual void toString(SkString* str) const = 0; SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() SK_DEFINE_FLATTENABLE_TYPE(SkColorFilter) diff --git a/include/core/SkDrawLooper.h b/include/core/SkDrawLooper.h index 9012802344..e318e113b5 100644 --- a/include/core/SkDrawLooper.h +++ b/include/core/SkDrawLooper.h @@ -99,7 +99,7 @@ public: */ virtual bool asABlurShadow(BlurShadowRec*) const; - SK_TO_STRING_PUREVIRT() + virtual void toString(SkString* str) const = 0; SK_DEFINE_FLATTENABLE_TYPE(SkDrawLooper) protected: diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h index 3998fef056..d7a3f33b75 100644 --- a/include/core/SkImageFilter.h +++ b/include/core/SkImageFilter.h @@ -97,9 +97,7 @@ public: : fRect(rect), fFlags(flags) {} uint32_t flags() const { return fFlags; } const SkRect& rect() const { return fRect; } -#ifndef SK_IGNORE_TO_STRING void toString(SkString* str) const; -#endif /** * Apply this cropRect to the imageBounds. If a given edge of the cropRect is not @@ -247,7 +245,7 @@ public: SkFilterQuality quality, sk_sp<SkImageFilter> input); - SK_TO_STRING_PUREVIRT() + virtual void toString(SkString* str) const = 0; SK_DEFINE_FLATTENABLE_TYPE(SkImageFilter) SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() diff --git a/include/core/SkMaskFilter.h b/include/core/SkMaskFilter.h index b506779d01..1ea774a027 100644 --- a/include/core/SkMaskFilter.h +++ b/include/core/SkMaskFilter.h @@ -52,7 +52,7 @@ public: sk_sp<SkMaskFilter> makeWithLocalMatrix(const SkMatrix&) const; - SK_TO_STRING_PUREVIRT() + virtual void toString(SkString* str) const = 0; SK_DEFINE_FLATTENABLE_TYPE(SkMaskFilter) private: diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h index 6dc7ed4f5f..4cc4a37b50 100644 --- a/include/core/SkPaint.h +++ b/include/core/SkPaint.h @@ -1610,14 +1610,12 @@ public: const SkRect& doComputeFastBounds(const SkRect& orig, SkRect* storage, Style style) const; - /** macro expands to: void toString(SkString* str) const; - Creates string representation of SkPaint. The representation is read by - internal debugging tools. The interface and implementation may be - suppressed by defining SK_IGNORE_TO_STRING. + /** Creates string representation of SkPaint. The representation is read by + internal debugging tools. @param str storage for string representation of SkPaint */ - SK_TO_STRING_NONVIRT() + void toString(SkString* str) const; private: typedef const SkGlyph& (*GlyphCacheProc)(SkGlyphCache*, const char**); diff --git a/include/core/SkPathEffect.h b/include/core/SkPathEffect.h index 8988139d1f..97b48ea503 100644 --- a/include/core/SkPathEffect.h +++ b/include/core/SkPathEffect.h @@ -145,7 +145,7 @@ public: virtual DashType asADash(DashInfo* info) const; - SK_TO_STRING_PUREVIRT() + virtual void toString(SkString* str) const = 0; SK_DEFINE_FLATTENABLE_TYPE(SkPathEffect) #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h index afab728666..b91d8b5592 100644 --- a/include/core/SkTypes.h +++ b/include/core/SkTypes.h @@ -94,20 +94,9 @@ SK_API extern void sk_abort_no_print(void); #define SkAssertResult(cond) if (cond) {} do {} while(false) #endif -#ifdef SK_IGNORE_TO_STRING - #define SK_TO_STRING_NONVIRT() - #define SK_TO_STRING_VIRT() - #define SK_TO_STRING_PUREVIRT() - #define SK_TO_STRING_OVERRIDE() -#else - class SkString; - // the 'toString' helper functions convert Sk* objects to human-readable - // form in developer mode - #define SK_TO_STRING_NONVIRT() void toString(SkString* str) const; - #define SK_TO_STRING_VIRT() virtual void toString(SkString* str) const; - #define SK_TO_STRING_PUREVIRT() virtual void toString(SkString* str) const = 0; - #define SK_TO_STRING_OVERRIDE() void toString(SkString* str) const override; -#endif +// some clients (e.g. third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.h) +// depend on SkString forward declaration below. Remove this once dependencies are fixed. +class SkString; /* * Usage: SK_MACRO_CONCAT(a, b) to construct the symbol ab diff --git a/include/effects/Sk1DPathEffect.h b/include/effects/Sk1DPathEffect.h index 2523264570..88a36ff7c6 100644 --- a/include/effects/Sk1DPathEffect.h +++ b/include/effects/Sk1DPathEffect.h @@ -61,7 +61,7 @@ public: virtual bool filterPath(SkPath*, const SkPath&, SkStrokeRec*, const SkRect*) const override; - SK_TO_STRING_OVERRIDE() + void toString(SkString* str) const override; SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPath1DPathEffect) protected: diff --git a/include/effects/Sk2DPathEffect.h b/include/effects/Sk2DPathEffect.h index 823a6ad9d8..5b7df35df2 100644 --- a/include/effects/Sk2DPathEffect.h +++ b/include/effects/Sk2DPathEffect.h @@ -39,7 +39,7 @@ protected: explicit Sk2DPathEffect(const SkMatrix& mat); void flatten(SkWriteBuffer&) const override; - SK_TO_STRING_OVERRIDE() + void toString(SkString* str) const override; private: SkMatrix fMatrix, fInverse; @@ -62,7 +62,7 @@ public: virtual bool filterPath(SkPath* dst, const SkPath& src, SkStrokeRec*, const SkRect*) const override; - SK_TO_STRING_OVERRIDE() + void toString(SkString* str) const override; SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLine2DPathEffect) protected: @@ -88,7 +88,7 @@ public: return sk_sp<SkPathEffect>(new SkPath2DPathEffect(matrix, path)); } - SK_TO_STRING_OVERRIDE() + void toString(SkString* str) const override; SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPath2DPathEffect) protected: diff --git a/include/effects/SkColorFilterImageFilter.h b/include/effects/SkColorFilterImageFilter.h index 7812a91524..491a2b05b0 100644 --- a/include/effects/SkColorFilterImageFilter.h +++ b/include/effects/SkColorFilterImageFilter.h @@ -18,7 +18,7 @@ public: sk_sp<SkImageFilter> input, const CropRect* cropRect = nullptr); - SK_TO_STRING_OVERRIDE() + void toString(SkString* str) const override; SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorFilterImageFilter) protected: diff --git a/include/effects/SkComposeImageFilter.h b/include/effects/SkComposeImageFilter.h index 02200117fb..dd44df5d9c 100644 --- a/include/effects/SkComposeImageFilter.h +++ b/include/effects/SkComposeImageFilter.h @@ -16,7 +16,7 @@ public: SkRect computeFastBounds(const SkRect& src) const override; - SK_TO_STRING_OVERRIDE() + void toString(SkString* str) const override; SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkComposeImageFilter) protected: diff --git a/include/effects/SkCornerPathEffect.h b/include/effects/SkCornerPathEffect.h index c252943fbe..f7a5e46222 100644 --- a/include/effects/SkCornerPathEffect.h +++ b/include/effects/SkCornerPathEffect.h @@ -27,7 +27,7 @@ public: virtual bool filterPath(SkPath* dst, const SkPath& src, SkStrokeRec*, const SkRect*) const override; - SK_TO_STRING_OVERRIDE() + void toString(SkString* str) const override; SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkCornerPathEffect) #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK diff --git a/include/effects/SkDiscretePathEffect.h b/include/effects/SkDiscretePathEffect.h index 6709676a8b..eb2a994982 100644 --- a/include/effects/SkDiscretePathEffect.h +++ b/include/effects/SkDiscretePathEffect.h @@ -34,7 +34,7 @@ public: virtual bool filterPath(SkPath* dst, const SkPath& src, SkStrokeRec*, const SkRect*) const override; - SK_TO_STRING_OVERRIDE() + void toString(SkString* str) const override; SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDiscretePathEffect) #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK diff --git a/include/effects/SkDisplacementMapEffect.h b/include/effects/SkDisplacementMapEffect.h index f74db8cfc4..af4d6fd10e 100644 --- a/include/effects/SkDisplacementMapEffect.h +++ b/include/effects/SkDisplacementMapEffect.h @@ -40,7 +40,7 @@ public: sk_sp<SkImageFilter> onMakeColorSpace(SkColorSpaceXformer*) const override; SkIRect onFilterNodeBounds(const SkIRect&, const SkMatrix&, MapDirection) const override; - SK_TO_STRING_OVERRIDE() + void toString(SkString* str) const override; protected: sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&, diff --git a/include/effects/SkDropShadowImageFilter.h b/include/effects/SkDropShadowImageFilter.h index b041c0efc6..f6b27db271 100644 --- a/include/effects/SkDropShadowImageFilter.h +++ b/include/effects/SkDropShadowImageFilter.h @@ -29,7 +29,7 @@ public: const CropRect* cropRect = nullptr); SkRect computeFastBounds(const SkRect&) const override; - SK_TO_STRING_OVERRIDE() + void toString(SkString* str) const override; SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDropShadowImageFilter) protected: diff --git a/include/effects/SkImageSource.h b/include/effects/SkImageSource.h index f2c1274f29..25b169c20d 100644 --- a/include/effects/SkImageSource.h +++ b/include/effects/SkImageSource.h @@ -21,7 +21,7 @@ public: SkRect computeFastBounds(const SkRect& src) const override; - SK_TO_STRING_OVERRIDE() + void toString(SkString* str) const override; SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkImageSource) protected: diff --git a/include/effects/SkLayerDrawLooper.h b/include/effects/SkLayerDrawLooper.h index f71b93a706..10a7274394 100644 --- a/include/effects/SkLayerDrawLooper.h +++ b/include/effects/SkLayerDrawLooper.h @@ -75,7 +75,7 @@ public: bool asABlurShadow(BlurShadowRec* rec) const override; - SK_TO_STRING_OVERRIDE() + void toString(SkString* str) const override; Factory getFactory() const override { return CreateProc; } static sk_sp<SkFlattenable> CreateProc(SkReadBuffer& buffer); diff --git a/include/effects/SkLumaColorFilter.h b/include/effects/SkLumaColorFilter.h index ff7fa661b9..bdf02d322e 100644 --- a/include/effects/SkLumaColorFilter.h +++ b/include/effects/SkLumaColorFilter.h @@ -33,7 +33,7 @@ public: GrContext*, const GrColorSpaceInfo&) const override; #endif - SK_TO_STRING_OVERRIDE() + void toString(SkString* str) const override; SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLumaColorFilter) protected: diff --git a/include/effects/SkMagnifierImageFilter.h b/include/effects/SkMagnifierImageFilter.h index fa9a996298..dda4190322 100644 --- a/include/effects/SkMagnifierImageFilter.h +++ b/include/effects/SkMagnifierImageFilter.h @@ -18,7 +18,7 @@ public: sk_sp<SkImageFilter> input, const CropRect* cropRect = nullptr); - SK_TO_STRING_OVERRIDE() + void toString(SkString* str) const override; SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMagnifierImageFilter) protected: diff --git a/include/effects/SkMatrixConvolutionImageFilter.h b/include/effects/SkMatrixConvolutionImageFilter.h index 8b3bcc9909..94ea716842 100644 --- a/include/effects/SkMatrixConvolutionImageFilter.h +++ b/include/effects/SkMatrixConvolutionImageFilter.h @@ -67,7 +67,7 @@ public: sk_sp<SkImageFilter> input, const CropRect* cropRect = nullptr); - SK_TO_STRING_OVERRIDE() + void toString(SkString* str) const override; SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMatrixConvolutionImageFilter) protected: diff --git a/include/effects/SkMergeImageFilter.h b/include/effects/SkMergeImageFilter.h index fdb5c1f6cc..b1a85d5c74 100644 --- a/include/effects/SkMergeImageFilter.h +++ b/include/effects/SkMergeImageFilter.h @@ -24,7 +24,7 @@ public: return Make(array, 2, cropRect); } - SK_TO_STRING_OVERRIDE() + void toString(SkString* str) const override; SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMergeImageFilter) protected: diff --git a/include/effects/SkMorphologyImageFilter.h b/include/effects/SkMorphologyImageFilter.h index 9785091888..b75fe26d8a 100644 --- a/include/effects/SkMorphologyImageFilter.h +++ b/include/effects/SkMorphologyImageFilter.h @@ -60,7 +60,7 @@ public: sk_sp<SkImageFilter> input, const CropRect* cropRect = nullptr); - SK_TO_STRING_OVERRIDE() + void toString(SkString* str) const override; SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDilateImageFilter) protected: @@ -82,7 +82,7 @@ public: sk_sp<SkImageFilter> input, const CropRect* cropRect = nullptr); - SK_TO_STRING_OVERRIDE() + void toString(SkString* str) const override; SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkErodeImageFilter) protected: diff --git a/include/effects/SkOffsetImageFilter.h b/include/effects/SkOffsetImageFilter.h index 5d1f70397b..9356c70fd2 100644 --- a/include/effects/SkOffsetImageFilter.h +++ b/include/effects/SkOffsetImageFilter.h @@ -19,7 +19,7 @@ public: SkRect computeFastBounds(const SkRect& src) const override; - SK_TO_STRING_OVERRIDE() + void toString(SkString* str) const override; SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkOffsetImageFilter) protected: diff --git a/include/effects/SkOverdrawColorFilter.h b/include/effects/SkOverdrawColorFilter.h index c40e115796..63f636a0cc 100644 --- a/include/effects/SkOverdrawColorFilter.h +++ b/include/effects/SkOverdrawColorFilter.h @@ -32,7 +32,7 @@ public: GrContext*, const GrColorSpaceInfo&) const override; #endif - SK_TO_STRING_OVERRIDE() + void toString(SkString* str) const override; static sk_sp<SkFlattenable> CreateProc(SkReadBuffer& buffer); Factory getFactory() const override { return CreateProc; } diff --git a/include/effects/SkPaintImageFilter.h b/include/effects/SkPaintImageFilter.h index 435b677a72..b27c2624b1 100644 --- a/include/effects/SkPaintImageFilter.h +++ b/include/effects/SkPaintImageFilter.h @@ -26,7 +26,7 @@ public: bool affectsTransparentBlack() const override; - SK_TO_STRING_OVERRIDE() + void toString(SkString* str) const override; SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPaintImageFilter) protected: diff --git a/include/effects/SkPictureImageFilter.h b/include/effects/SkPictureImageFilter.h index 25ccaf508b..1885cfe6ae 100644 --- a/include/effects/SkPictureImageFilter.h +++ b/include/effects/SkPictureImageFilter.h @@ -24,7 +24,7 @@ public: */ static sk_sp<SkImageFilter> Make(sk_sp<SkPicture> picture, const SkRect& cropRect); - SK_TO_STRING_OVERRIDE() + void toString(SkString* str) const override; SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPictureImageFilter) protected: diff --git a/include/effects/SkTileImageFilter.h b/include/effects/SkTileImageFilter.h index 2707741ec8..f37982bbb9 100644 --- a/include/effects/SkTileImageFilter.h +++ b/include/effects/SkTileImageFilter.h @@ -25,7 +25,7 @@ public: SkIRect onFilterNodeBounds(const SkIRect&, const SkMatrix&, MapDirection) const override; SkRect computeFastBounds(const SkRect& src) const override; - SK_TO_STRING_OVERRIDE() + void toString(SkString* str) const override; SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTileImageFilter) protected: diff --git a/include/effects/SkToSRGBColorFilter.h b/include/effects/SkToSRGBColorFilter.h index 8642c019c3..03bb37b172 100644 --- a/include/effects/SkToSRGBColorFilter.h +++ b/include/effects/SkToSRGBColorFilter.h @@ -26,7 +26,7 @@ public: GrContext*, const GrColorSpaceInfo&) const override; #endif - SK_TO_STRING_OVERRIDE() + void toString(SkString* str) const override; SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkToSRGBColorFilter) private: |