aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-04-20 11:48:36 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-20 11:48:36 -0700
commit3e302275b324172c845627cbd00cee8a06571baf (patch)
tree51b7ab49a3e044145d8818051ad019432a820654 /include
parent9ca06c4b00bfb9bb1a7f352efd264185e5a95fbc (diff)
Begin removing deprecated (and now, unused) ImageFilter code paths
This CL focuses on removing the Proxy objects but takes some other stuff with it. BUG=skia:4965 TBR=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1896383003 Review URL: https://codereview.chromium.org/1896383003
Diffstat (limited to 'include')
-rw-r--r--include/core/SkDevice.h1
-rw-r--r--include/core/SkImageFilter.h61
2 files changed, 16 insertions, 46 deletions
diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h
index 83a7093607..c8a1d5eeb9 100644
--- a/include/core/SkDevice.h
+++ b/include/core/SkDevice.h
@@ -374,7 +374,6 @@ private:
friend class SkDraw;
friend class SkDrawIter;
friend class SkDeviceFilteredPaint;
- friend class SkImageFilter::DeviceProxy;
friend class SkNoPixelsBitmapDevice;
friend class SkSurface_Raster;
diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h
index a19633b7ab..8cab6ef3a7 100644
--- a/include/core/SkImageFilter.h
+++ b/include/core/SkImageFilter.h
@@ -111,25 +111,6 @@ public:
kNever_TileUsage, //!< the created device will never be drawn tiled
};
- class Proxy {
- public:
- virtual ~Proxy() {}
-
- virtual SkBaseDevice* createDevice(int width, int height,
- TileUsage usage = kNever_TileUsage) = 0;
- };
-
- class DeviceProxy : public Proxy {
- public:
- DeviceProxy(SkBaseDevice* device) : fDevice(device) {}
-
- SkBaseDevice* createDevice(int width, int height,
- TileUsage usage = kNever_TileUsage) override;
-
- private:
- SkBaseDevice* fDevice;
- };
-
/**
* Request a new (result) image to be created from the src image.
*
@@ -168,8 +149,7 @@ public:
#if SK_SUPPORT_GPU
static sk_sp<SkSpecialImage> DrawWithFP(GrContext* context,
sk_sp<GrFragmentProcessor> fp,
- const SkIRect& bounds,
- SkImageFilter::Proxy* proxy);
+ const SkIRect& bounds);
#endif
/**
@@ -217,9 +197,7 @@ public:
* The size of the crop rect should be
* used as the size of the destination image. The origin of this rect
* should be used to offset access to the input images, and should also
- * be added to the "offset" parameter in onFilterImage and
- * filterImageGPU(). (The latter ensures that the resulting buffer is
- * drawn in the correct location.)
+ * be added to the "offset" parameter in onFilterImage.
*/
bool cropRectIsSet() const { return fCropRect.flags() != 0x0; }
@@ -257,12 +235,6 @@ public:
}
#endif
-
- sk_sp<SkSpecialImage> filterInput(int index,
- SkSpecialImage* src,
- const Context&,
- SkIPoint* offset) const;
-
SK_TO_STRING_PUREVIRT()
SK_DEFINE_FLATTENABLE_TYPE(SkImageFilter)
@@ -320,15 +292,15 @@ protected:
* Offset is the amount to translate the resulting image relative to the
* src when it is drawn. This is an out-param.
*
- * If the result image cannot be created, this should false, in which
- * case both the result and offset parameters will be ignored by the
- * caller.
+ * If the result image cannot be created (either because of error or if, say, the result
+ * is entirely clipped out), this should return nullptr.
+ * Callers that affect transparent black should explicitly handle nullptr
+ * results and press on. In the error case this behavior will produce a better result
+ * than nothing and is necessary for the clipped out case.
+ * If the return value is nullptr then offset should be ignored.
*/
- virtual bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
- SkBitmap* result, SkIPoint* offset) const;
-
virtual sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* src, const Context&,
- SkIPoint* offset) const;
+ SkIPoint* offset) const = 0;
/**
* This function recurses into its inputs with the given rect (first
@@ -359,12 +331,13 @@ protected:
virtual SkIRect onFilterNodeBounds(const SkIRect&, const SkMatrix&, MapDirection) const;
// Helper function which invokes filter processing on the input at the
- // specified "index". If the input is null, it leaves "result" and
- // "offset" untouched, and returns true. If the input is non-null, it
- // calls filterImage() on that input, and returns true on success.
- // i.e., return !getInput(index) || getInput(index)->filterImage(...);
- bool filterInputDeprecated(int index, Proxy*, const SkBitmap& src, const Context&,
- SkBitmap* result, SkIPoint* offset) const;
+ // specified "index". If the input is null, it returns "src" and leaves
+ // "offset" untouched. If the input is non-null, it
+ // calls filterImage() on that input, and returns the result.
+ sk_sp<SkSpecialImage> filterInput(int index,
+ SkSpecialImage* src,
+ const Context&,
+ SkIPoint* offset) const;
/**
* Return true (and return a ref'd colorfilter) if this node in the DAG is just a
@@ -409,8 +382,6 @@ private:
static void PurgeCache();
void init(sk_sp<SkImageFilter>* inputs, int inputCount, const CropRect* cropRect);
- bool filterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
- SkBitmap* result, SkIPoint* offset) const;
bool usesSrcInput() const { return fUsesSrcInput; }
virtual bool affectsTransparentBlack() const { return false; }