diff options
author | schenney <schenney@chromium.org> | 2015-10-06 12:59:55 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-06 12:59:55 -0700 |
commit | 95376a0dde3cdf414eb97a20cef3af19ed7e0151 (patch) | |
tree | b304b560eec5feed75d621c1aa3ec9a7df2573d9 /include/effects/SkPictureImageFilter.h | |
parent | ccb88bcab03c2d7450b25f614b9203b8b9d7640d (diff) |
Revert of factories should return baseclass, allowing the impl to specialize (patchset #4 id:60001 of https://codereview.chromium.org/1390523005/ )
Reason for revert:
Breaks Chrome with this link error: ../../third_party/skia/include/effects/SkMorphologyImageFilter.h:75: error: undefined reference to 'SkMorphologyImageFilter::SkMorphologyImageFilter(int, int, SkImageFilter*, SkImageFilter::CropRect const*)'
../../third_party/skia/include/effects/SkMorphologyImageFilter.h:104: error: undefined reference to 'SkMorphologyImageFilter::SkMorphologyImageFilter(int, int, SkImageFilter*, SkImageFilter::CropRect const*)'
Presumably due to code in third_party/WebKit/Source/platform/graphics/filters/FEMorphology.cpp that contains:
#include "SkMorphologyImageFilter.h"
...
if (m_type == FEMORPHOLOGY_OPERATOR_DILATE)
return adoptRef(SkDilateImageFilter::Create(radiusX, radiusY, input.get(), &rect));
return adoptRef(SkErodeImageFilter::Create(radiusX, radiusY, input.get(), &rect));
Original issue's description:
> factories should return baseclass, allowing the impl to specialize
>
> waiting on https://codereview.chromium.org/1386163002/# to land
>
> BUG=skia:4424
>
> Committed: https://skia.googlesource.com/skia/+/80a6dcaa1b757826ed7414f64b035d512d9ccbf8
TBR=senorblanco@google.com,robertphillips@google.com,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:4424
Review URL: https://codereview.chromium.org/1389063002
Diffstat (limited to 'include/effects/SkPictureImageFilter.h')
-rw-r--r-- | include/effects/SkPictureImageFilter.h | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/include/effects/SkPictureImageFilter.h b/include/effects/SkPictureImageFilter.h index 934d1324c0..231a492900 100644 --- a/include/effects/SkPictureImageFilter.h +++ b/include/effects/SkPictureImageFilter.h @@ -16,7 +16,7 @@ public: /** * Refs the passed-in picture. */ - static SkImageFilter* Create(const SkPicture* picture) { + static SkPictureImageFilter* Create(const SkPicture* picture) { return new SkPictureImageFilter(picture); } @@ -24,7 +24,7 @@ public: * Refs the passed-in picture. cropRect can be used to crop or expand the destination rect when * the picture is drawn. (No scaling is implied by the dest rect; only the CTM is applied.) */ - static SkImageFilter* Create(const SkPicture* picture, const SkRect& cropRect) { + static SkPictureImageFilter* Create(const SkPicture* picture, const SkRect& cropRect) { return new SkPictureImageFilter(picture, cropRect, kDeviceSpace_PictureResolution, kLow_SkFilterQuality); } @@ -36,13 +36,12 @@ public: * expand the destination rect when the picture is drawn. (No scaling is implied by the * dest rect; only the CTM is applied.) */ - static SkImageFilter* CreateForLocalSpace(const SkPicture* picture, + static SkPictureImageFilter* CreateForLocalSpace(const SkPicture* picture, const SkRect& cropRect, SkFilterQuality filterQuality) { return new SkPictureImageFilter(picture, cropRect, kLocalSpace_PictureResolution, filterQuality); } - SK_TO_STRING_OVERRIDE() SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPictureImageFilter) @@ -52,8 +51,10 @@ protected: kLocalSpace_PictureResolution }; + explicit SkPictureImageFilter(const SkPicture* picture); + SkPictureImageFilter(const SkPicture* picture, const SkRect& cropRect, + PictureResolution, SkFilterQuality); virtual ~SkPictureImageFilter(); - /* Constructs an SkPictureImageFilter object from an SkReadBuffer. * Note: If the SkPictureImageFilter object construction requires bitmap * decoding, the decoder must be set on the SkReadBuffer parameter by calling @@ -61,13 +62,11 @@ protected: * @param SkReadBuffer Serialized picture data. */ void flatten(SkWriteBuffer&) const override; - bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result, - SkIPoint* offset) const override; + virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, + SkBitmap* result, SkIPoint* offset) const override; private: - explicit SkPictureImageFilter(const SkPicture* picture); - SkPictureImageFilter(const SkPicture* picture, const SkRect& cropRect, - PictureResolution, SkFilterQuality); + void drawPictureAtDeviceResolution(SkBaseDevice*, const SkIRect& deviceBounds, const Context&) const; @@ -78,7 +77,6 @@ private: SkRect fCropRect; PictureResolution fPictureResolution; SkFilterQuality fFilterQuality; - typedef SkImageFilter INHERITED; }; |