diff options
author | 2018-05-20 23:15:43 +0000 | |
---|---|---|
committer | 2018-05-20 23:15:48 +0000 | |
commit | 32a4910e57b1fdd3c8671de1ee85e05ca21d079f (patch) | |
tree | 9ae07529b8f56406fa5890827782b592895245a0 /include | |
parent | 5191880cbf3ee4d122b0d11b4945fbab0784fda7 (diff) |
Revert "remove toString"
This reverts commit 5191880cbf3ee4d122b0d11b4945fbab0784fda7.
Reason for revert: broke flutter
Original change's description:
> remove toString
>
> toString may have been used by obsolete debugger only
> find out if that is so
>
> R=​brianosman@google.com,bsalomon@google.com
>
> Docs-Preview: https://skia.org/?cl=119894
> Bug:830651
> Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd
> Reviewed-on: https://skia-review.googlesource.com/119894
> Commit-Queue: Cary Clark <caryclark@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org
Change-Id: I9f81de6c3615ee0608bcea9081b77239b4b8816c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 830651
Reviewed-on: https://skia-review.googlesource.com/129340
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
Diffstat (limited to 'include')
30 files changed, 65 insertions, 2 deletions
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h index 8c14a756ca..c4c9dc50a8 100644 --- a/include/core/SkBitmap.h +++ b/include/core/SkBitmap.h @@ -1246,6 +1246,13 @@ public: bool allocPixelRef(SkBitmap* bitmap) override; }; + /** Creates string representation of SkBitmap. The representation is read by + internal debugging tools. + + @param str storage for string representation + */ + void toString(SkString* str) const; + private: enum Flags { kImageIsVolatile_Flag = 0x02, diff --git a/include/core/SkColorFilter.h b/include/core/SkColorFilter.h index eac58471c4..e8b09bae9c 100644 --- a/include/core/SkColorFilter.h +++ b/include/core/SkColorFilter.h @@ -138,6 +138,8 @@ public: return this->filterColor(SK_ColorTRANSPARENT) != SK_ColorTRANSPARENT; } + 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 f4b3373dca..4280daa4a9 100644 --- a/include/core/SkDrawLooper.h +++ b/include/core/SkDrawLooper.h @@ -96,6 +96,7 @@ public: */ virtual bool asABlurShadow(BlurShadowRec*) const; + virtual void toString(SkString* str) const = 0; SK_DEFINE_FLATTENABLE_TYPE(SkDrawLooper) protected: diff --git a/include/core/SkImage.h b/include/core/SkImage.h index a7f3e4ab20..afcbb89a5b 100644 --- a/include/core/SkImage.h +++ b/include/core/SkImage.h @@ -727,6 +727,14 @@ public: */ sk_sp<SkData> refEncodedData() const; + /** Appends SkImage description to string, including unique ID, width, height, and + whether the image is opaque. + + @param string storage for description; existing content is preserved + @return string appended with SkImage description + */ + const char* toString(SkString* string) const; + /** Returns subset of SkImage. subset must be fully contained by SkImage dimensions(). The implementation may share pixels, or may copy them. diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h index e9594b535b..70f5513843 100644 --- a/include/core/SkImageFilter.h +++ b/include/core/SkImageFilter.h @@ -97,6 +97,7 @@ public: : fRect(rect), fFlags(flags) {} uint32_t flags() const { return fFlags; } const SkRect& rect() const { return fRect; } + void toString(SkString* str) const; /** * Apply this cropRect to the imageBounds. If a given edge of the cropRect is not @@ -248,8 +249,7 @@ public: SkFilterQuality quality, sk_sp<SkImageFilter> input); - // Deprecated; used only by chrome - virtual void toString(SkString* ) const {} + 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 45c5724843..bd2a20b825 100644 --- a/include/core/SkMaskFilter.h +++ b/include/core/SkMaskFilter.h @@ -59,6 +59,7 @@ public: */ sk_sp<SkMaskFilter> makeWithMatrix(const SkMatrix&) const; + virtual void toString(SkString* str) const = 0; SK_DEFINE_FLATTENABLE_TYPE(SkMaskFilter) private: diff --git a/include/core/SkMatrix.h b/include/core/SkMatrix.h index 8ba4e1bb28..9733590167 100644 --- a/include/core/SkMatrix.h +++ b/include/core/SkMatrix.h @@ -1575,6 +1575,14 @@ public: */ void dump() const; + /** Creates string representation of SkMatrix. Floating point values + are written with limited precision; it may not be possible to reconstruct + original SkMatrix from output. + + @param str storage for string representation of SkMatrix + */ + void toString(SkString* str) const; + /** Returns the minimum scaling factor of SkMatrix by decomposing the scaling and skewing elements. Returns -1 if scale factor overflows or SkMatrix contains perspective. diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h index 42a65cc1db..85c2e3b2f7 100644 --- a/include/core/SkPaint.h +++ b/include/core/SkPaint.h @@ -1598,6 +1598,13 @@ public: const SkRect& doComputeFastBounds(const SkRect& orig, SkRect* storage, Style style) const; + /** Creates string representation of SkPaint. The representation is read by + internal debugging tools. + + @param str storage for string representation of SkPaint + */ + 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 a85614a9d5..97b48ea503 100644 --- a/include/core/SkPathEffect.h +++ b/include/core/SkPathEffect.h @@ -145,6 +145,7 @@ public: virtual DashType asADash(DashInfo* info) const; + virtual void toString(SkString* str) const = 0; SK_DEFINE_FLATTENABLE_TYPE(SkPathEffect) #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK diff --git a/include/effects/Sk1DPathEffect.h b/include/effects/Sk1DPathEffect.h index b491da7818..88a36ff7c6 100644 --- a/include/effects/Sk1DPathEffect.h +++ b/include/effects/Sk1DPathEffect.h @@ -61,6 +61,7 @@ public: virtual bool filterPath(SkPath*, const SkPath&, SkStrokeRec*, const SkRect*) const 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 0a7922e388..5ebadab0d5 100644 --- a/include/effects/Sk2DPathEffect.h +++ b/include/effects/Sk2DPathEffect.h @@ -39,6 +39,8 @@ protected: explicit Sk2DPathEffect(const SkMatrix& mat); void flatten(SkWriteBuffer&) const override; + void toString(SkString* str) const override; + private: SkMatrix fMatrix, fInverse; bool fMatrixIsInvertible; @@ -63,6 +65,7 @@ public: virtual bool filterPath(SkPath* dst, const SkPath& src, SkStrokeRec*, const SkRect*) const override; + void toString(SkString* str) const override; SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLine2DPathEffect) protected: @@ -90,6 +93,7 @@ public: return sk_sp<SkPathEffect>(new SkPath2DPathEffect(matrix, path)); } + 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 1a7031fad3..491a2b05b0 100644 --- a/include/effects/SkColorFilterImageFilter.h +++ b/include/effects/SkColorFilterImageFilter.h @@ -18,6 +18,7 @@ public: sk_sp<SkImageFilter> input, const CropRect* cropRect = nullptr); + 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 4e1f27e422..0bfb7d8c5c 100644 --- a/include/effects/SkComposeImageFilter.h +++ b/include/effects/SkComposeImageFilter.h @@ -16,6 +16,7 @@ public: SkRect computeFastBounds(const SkRect& src) const 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 cea31415bc..ac9401a7bc 100644 --- a/include/effects/SkCornerPathEffect.h +++ b/include/effects/SkCornerPathEffect.h @@ -27,6 +27,7 @@ public: virtual bool filterPath(SkPath* dst, const SkPath& src, SkStrokeRec*, const SkRect*) const 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 45a184fcb2..eb2a994982 100644 --- a/include/effects/SkDiscretePathEffect.h +++ b/include/effects/SkDiscretePathEffect.h @@ -34,6 +34,7 @@ public: virtual bool filterPath(SkPath* dst, const SkPath& src, SkStrokeRec*, const SkRect*) const 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 ab5fdca773..daf03d742c 100644 --- a/include/effects/SkDisplacementMapEffect.h +++ b/include/effects/SkDisplacementMapEffect.h @@ -41,6 +41,8 @@ public: SkIRect onFilterNodeBounds(const SkIRect&, const SkMatrix& ctm, MapDirection, const SkIRect* inputRect) const override; + void toString(SkString* str) const override; + protected: sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&, SkIPoint* offset) const override; diff --git a/include/effects/SkDropShadowImageFilter.h b/include/effects/SkDropShadowImageFilter.h index 7566a6eff3..d1ee44c168 100644 --- a/include/effects/SkDropShadowImageFilter.h +++ b/include/effects/SkDropShadowImageFilter.h @@ -29,6 +29,7 @@ public: const CropRect* cropRect = nullptr); SkRect computeFastBounds(const SkRect&) const 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 1b5cbb3cf9..6ef855ab93 100644 --- a/include/effects/SkImageSource.h +++ b/include/effects/SkImageSource.h @@ -21,6 +21,7 @@ public: SkRect computeFastBounds(const SkRect& src) const 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 18a9b93991..10a7274394 100644 --- a/include/effects/SkLayerDrawLooper.h +++ b/include/effects/SkLayerDrawLooper.h @@ -75,6 +75,8 @@ public: bool asABlurShadow(BlurShadowRec* rec) const 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 f81f4bdb21..bdf02d322e 100644 --- a/include/effects/SkLumaColorFilter.h +++ b/include/effects/SkLumaColorFilter.h @@ -33,6 +33,7 @@ public: GrContext*, const GrColorSpaceInfo&) const override; #endif + 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 460e40fe58..dda4190322 100644 --- a/include/effects/SkMagnifierImageFilter.h +++ b/include/effects/SkMagnifierImageFilter.h @@ -18,6 +18,7 @@ public: sk_sp<SkImageFilter> input, const CropRect* cropRect = nullptr); + 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 b1875fd8a9..5361fef928 100644 --- a/include/effects/SkMatrixConvolutionImageFilter.h +++ b/include/effects/SkMatrixConvolutionImageFilter.h @@ -67,6 +67,7 @@ public: sk_sp<SkImageFilter> input, const CropRect* cropRect = nullptr); + 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 ab8acc8411..b1a85d5c74 100644 --- a/include/effects/SkMergeImageFilter.h +++ b/include/effects/SkMergeImageFilter.h @@ -24,6 +24,7 @@ public: return Make(array, 2, cropRect); } + 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 05a9c2e96d..d88a31dc65 100644 --- a/include/effects/SkMorphologyImageFilter.h +++ b/include/effects/SkMorphologyImageFilter.h @@ -61,6 +61,7 @@ public: sk_sp<SkImageFilter> input, const CropRect* cropRect = nullptr); + void toString(SkString* str) const override; SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDilateImageFilter) protected: @@ -82,6 +83,7 @@ public: sk_sp<SkImageFilter> input, const CropRect* cropRect = nullptr); + 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 ac7be849a8..2d7b14f652 100644 --- a/include/effects/SkOffsetImageFilter.h +++ b/include/effects/SkOffsetImageFilter.h @@ -19,6 +19,7 @@ public: SkRect computeFastBounds(const SkRect& src) const 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 2791eb06d0..63f636a0cc 100644 --- a/include/effects/SkOverdrawColorFilter.h +++ b/include/effects/SkOverdrawColorFilter.h @@ -32,6 +32,8 @@ public: GrContext*, const GrColorSpaceInfo&) const override; #endif + void toString(SkString* str) const override; + static sk_sp<SkFlattenable> CreateProc(SkReadBuffer& buffer); Factory getFactory() const override { return CreateProc; } SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() diff --git a/include/effects/SkPaintImageFilter.h b/include/effects/SkPaintImageFilter.h index 943e3cb50f..b27c2624b1 100644 --- a/include/effects/SkPaintImageFilter.h +++ b/include/effects/SkPaintImageFilter.h @@ -26,6 +26,7 @@ public: bool affectsTransparentBlack() const 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 92bf71d4b4..1885cfe6ae 100644 --- a/include/effects/SkPictureImageFilter.h +++ b/include/effects/SkPictureImageFilter.h @@ -24,6 +24,7 @@ public: */ static sk_sp<SkImageFilter> Make(sk_sp<SkPicture> picture, const SkRect& cropRect); + 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 94acb1abe6..f62d8a02d4 100644 --- a/include/effects/SkTileImageFilter.h +++ b/include/effects/SkTileImageFilter.h @@ -27,6 +27,7 @@ public: MapDirection, const SkIRect* inputRect) const override; SkRect computeFastBounds(const SkRect& src) const 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 fe202a7a4b..03bb37b172 100644 --- a/include/effects/SkToSRGBColorFilter.h +++ b/include/effects/SkToSRGBColorFilter.h @@ -26,6 +26,7 @@ public: GrContext*, const GrColorSpaceInfo&) const override; #endif + void toString(SkString* str) const override; SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkToSRGBColorFilter) private: |