Chromium Code Reviews| Index: include/core/SkDevice.h |
| diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h |
| index 9f3ac580080590c36989f4a657040e6a79092317..012a3674cf058477813b8d235fb07cd221c67cbe 100644 |
| --- a/include/core/SkDevice.h |
| +++ b/include/core/SkDevice.h |
| @@ -17,11 +17,14 @@ |
| class SkClipStack; |
| class SkDraw; |
| struct SkIRect; |
| +class SkImage; |
| class SkMatrix; |
| class SkMetaData; |
| class SkRegion; |
| struct SkDeviceProperties; |
| class GrRenderTarget; |
| +class SkSurface_Base; |
| + |
| class SK_API SkBaseDevice : public SkRefCnt { |
| public: |
| @@ -199,6 +202,8 @@ protected: |
| const SkMatrix& matrix, const SkPaint& paint) = 0; |
| virtual void drawSprite(const SkDraw&, const SkBitmap& bitmap, |
| int x, int y, const SkPaint& paint) = 0; |
| + virtual void drawImage(const SkDraw&, const SkImage& image, |
| + int x, int y, const SkPaint& paint); |
| /** |
| * The default impl. will create a bitmap-shader from the bitmap, |
| @@ -273,14 +278,14 @@ protected: |
| /** |
| * Related (but not required) to canHandleImageFilter, this method returns |
| - * true if the device could apply the filter to the src bitmap and return |
| + * true if the device could apply the filter to the src image and return |
| * the result (and updates offset as needed). |
| * If the device does not recognize or support this filter, |
| * it just returns false and leaves result and offset unchanged. |
| */ |
| - virtual bool filterImage(const SkImageFilter*, const SkBitmap&, |
| + virtual bool filterImage(const SkImageFilter*, SkImage&, |
| const SkImageFilter::Context&, |
| - SkBitmap* /*result*/, SkIPoint* /*offset*/) { |
| + SkAutoTUnref<SkImage>& /*result*/, SkIPoint* /*offset*/) { |
| return false; |
| } |
| @@ -350,6 +355,10 @@ protected: |
| const SkPixelGeometry fPixelGeometry; |
| }; |
| + virtual SkSurface* onCreateCompatibleSurface(const CreateInfo&) { |
| + return NULL; |
| + } |
| + // TODO: left to compile pdf et al. |
| virtual SkBaseDevice* onCreateCompatibleDevice(const CreateInfo&) { |
| return NULL; |
| } |
| @@ -366,8 +375,17 @@ private: |
| friend class SkDeferredDevice; // for newSurface |
| friend class SkNoPixelsBitmapDevice; |
| + friend class SkSurface; |
| + friend class SkSurface_Gpu; |
| friend class SkSurface_Raster; |
| + // TODO: remove when GrRenderTarget is-a SkSurface. |
|
bsalomon
2015/02/13 14:24:35
Do you mean to make GrRenderTarget be a subclass o
|
| + SkSurface_Base* getSurfaceBase() const { return fSurfaceBase; } |
| + void setSurfaceBase(SkSurface_Base* sb) { |
| + SkASSERT(fSurfaceBase == NULL || sb == NULL); |
| + fSurfaceBase = sb; |
| + } |
| + |
| // 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. |
| @@ -389,6 +407,8 @@ private: |
| SkMetaData* fMetaData; |
| SkDeviceProperties* fLeakyProperties; // will always exist. |
| + SkSurface_Base* fSurfaceBase; |
| + |
| #ifdef SK_DEBUG |
| bool fAttachedToCanvas; |
| #endif |