Chromium Code Reviews| Index: include/core/SkDevice.h |
| diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h |
| index c52c579424a2ad7e450b501585052d0aa8eea050..fd8bb5752ff52b6a02232b3b623d0a577dfbbda9 100644 |
| --- a/include/core/SkDevice.h |
| +++ b/include/core/SkDevice.h |
| @@ -374,9 +374,27 @@ private: |
| friend class SkDeviceFilteredPaint; |
| friend class SkImageFilter::DeviceProxy; |
| friend class SkNoPixelsBitmapDevice; |
| - |
| friend class SkSurface_Raster; |
| + /** |
| + * Returns true if the caller can call the imagefilter "directly" on the src bitmap, |
| + * without needing to first draw it into a temp layer. |
| + * |
| + * The conditions are: |
| + * - the paint has an imagefilter |
| + * - the matrix is only translate (or identity) |
| + * - the device itself does not want to handle the filter |
|
Stephen White
2015/12/02 23:45:15
So this will only work for the raster path, then?
reed1
2015/12/03 21:26:51
Fixed.
|
| + * |
| + * If all of the above are true, the caller may call filterSprite() |
| + */ |
| + bool canCallFilterSprite(const SkMatrix*, const SkPaint&); |
| + |
| + /** |
| + * Will invoke the paint's imagefilter directly on the bitmap, and draw the result. |
| + * Assumes that the caller has previously called canCallFilterSprite(). |
| + */ |
| + void filterSprite(const SkDraw&, const SkBitmap&, int x, int y, const SkPaint&); |
| + |
| // used to change the backend's pixels (and possibly config/rowbytes) |
| // but cannot change the width/height, so there should be no change to |
| // any clip information. |