From 1e18aecd0b5bdb6dea0b0bcebf985a8bb221e6a6 Mon Sep 17 00:00:00 2001 From: Mike Reed Date: Thu, 19 Jan 2017 22:21:16 -0500 Subject: remove unused device apis BUG=skia: Change-Id: I7a6b185a0fbe779e3fa4c135437d4d1fb9b94bd8 Reviewed-on: https://skia-review.googlesource.com/7322 Reviewed-by: Mike Reed Commit-Queue: Mike Reed --- src/core/SkBitmapDevice.cpp | 4 --- src/core/SkBitmapDevice.h | 60 ++++++++++++--------------------------------- src/core/SkDevice.cpp | 10 -------- src/core/SkDevice.h | 21 ---------------- 4 files changed, 16 insertions(+), 79 deletions(-) diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp index 6d63ecf620..a409517090 100644 --- a/src/core/SkBitmapDevice.cpp +++ b/src/core/SkBitmapDevice.cpp @@ -148,10 +148,6 @@ SkBaseDevice* SkBitmapDevice::onCreateDevice(const CreateInfo& cinfo, const SkPa return SkBitmapDevice::Create(cinfo.fInfo, surfaceProps, cinfo.fAllocator); } -const SkBitmap& SkBitmapDevice::onAccessBitmap() { - return fBitmap; -} - bool SkBitmapDevice::onAccessPixels(SkPixmap* pmap) { if (this->onPeekPixels(pmap)) { fBitmap.notifyPixelsChanged(); diff --git a/src/core/SkBitmapDevice.h b/src/core/SkBitmapDevice.h index 776b6a0dec..2d67271c02 100644 --- a/src/core/SkBitmapDevice.h +++ b/src/core/SkBitmapDevice.h @@ -71,14 +71,11 @@ protected: DrawFilter. */ void drawPaint(const SkDraw&, const SkPaint& paint) override; - virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode, size_t count, + void drawPoints(const SkDraw&, SkCanvas::PointMode mode, size_t count, const SkPoint[], const SkPaint& paint) override; - virtual void drawRect(const SkDraw&, const SkRect& r, - const SkPaint& paint) override; - virtual void drawOval(const SkDraw&, const SkRect& oval, - const SkPaint& paint) override; - virtual void drawRRect(const SkDraw&, const SkRRect& rr, - const SkPaint& paint) override; + void drawRect(const SkDraw&, const SkRect& r, const SkPaint& paint) override; + void drawOval(const SkDraw&, const SkRect& oval, const SkPaint& paint) override; + void drawRRect(const SkDraw&, const SkRRect& rr, const SkPaint& paint) override; /** * If pathIsMutable, then the implementation is allowed to cast path to a @@ -91,14 +88,10 @@ protected: * affect the geometry/rasterization, then the pre matrix can just be * pre-concated with the current matrix. */ - virtual void drawPath(const SkDraw&, const SkPath& path, - const SkPaint& paint, - const SkMatrix* prePathMatrix = NULL, - bool pathIsMutable = false) override; - virtual void drawBitmap(const SkDraw&, const SkBitmap& bitmap, - const SkMatrix& matrix, const SkPaint& paint) override; - virtual void drawSprite(const SkDraw&, const SkBitmap& bitmap, - int x, int y, const SkPaint& paint) override; + void drawPath(const SkDraw&, const SkPath&, const SkPaint&, const SkMatrix* prePathMatrix, + bool pathIsMutable) override; + void drawBitmap(const SkDraw&, const SkBitmap&, const SkMatrix&, const SkPaint&) override; + void drawSprite(const SkDraw&, const SkBitmap&, int x, int y, const SkPaint&) override; /** * The default impl. will create a bitmap-shader from the bitmap, @@ -111,17 +104,14 @@ protected: * Does not handle text decoration. * Decorations (underline and stike-thru) will be handled by SkCanvas. */ - virtual void drawText(const SkDraw&, const void* text, size_t len, - SkScalar x, SkScalar y, const SkPaint& paint) override; - virtual void drawPosText(const SkDraw&, const void* text, size_t len, - const SkScalar pos[], int scalarsPerPos, - const SkPoint& offset, const SkPaint& paint) override; - virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCount, - const SkPoint verts[], const SkPoint texs[], - const SkColor colors[], SkBlendMode, - const uint16_t indices[], int indexCount, - const SkPaint& paint) override; - virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, const SkPaint&) override; + void drawText(const SkDraw&, const void* text, size_t len, SkScalar x, SkScalar y, + const SkPaint&) override; + void drawPosText(const SkDraw&, const void* text, size_t len, const SkScalar pos[], + int scalarsPerPos, const SkPoint& offset, const SkPaint& paint) override; + void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCount, const SkPoint verts[], + const SkPoint texs[], const SkColor colors[], SkBlendMode, + const uint16_t indices[], int indexCount, const SkPaint&) override; + void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, const SkPaint&) override; /////////////////////////////////////////////////////////////////////////// @@ -132,24 +122,6 @@ protected: /////////////////////////////////////////////////////////////////////////// - /** Update as needed the pixel value in the bitmap, so that the caller can - access the pixels directly. Note: only the pixels field should be - altered. The config/width/height/rowbytes must remain unchanged. - @return the device contents as a bitmap - */ -#ifdef SK_SUPPORT_LEGACY_ACCESSBITMAP - const SkBitmap& onAccessBitmap() override; -#else - const SkBitmap& onAccessBitmap(); -#endif - - SkPixelRef* getPixelRef() const { return fBitmap.pixelRef(); } - // just for subclasses, to assign a custom pixelref - void setPixelRef(sk_sp pr) { fBitmap.setPixelRef(std::move(pr), 0, 0); } -#ifdef SK_SUPPORT_LEGACY_BITMAP_SETPIXELREF - SkPixelRef* setPixelRef(SkPixelRef* pr) { return fBitmap.setPixelRef(pr); } -#endif - bool onReadPixels(const SkImageInfo&, void*, size_t, int x, int y) override; bool onWritePixels(const SkImageInfo&, const void*, size_t, int, int) override; bool onPeekPixels(SkPixmap*) override; diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp index 37a2535d7c..7800c370c1 100644 --- a/src/core/SkDevice.cpp +++ b/src/core/SkDevice.cpp @@ -35,16 +35,6 @@ SkBaseDevice::SkBaseDevice(const SkImageInfo& info, const SkSurfaceProps& surfac SkBaseDevice::~SkBaseDevice() {} -#ifdef SK_SUPPORT_LEGACY_ACCESSBITMAP -const SkBitmap& SkBaseDevice::accessBitmap(bool changePixels) { - const SkBitmap& bitmap = this->onAccessBitmap(); - if (changePixels) { - bitmap.notifyPixelsChanged(); - } - return bitmap; -} -#endif - SkPixelGeometry SkBaseDevice::CreateInfo::AdjustGeometry(const SkImageInfo& info, TileUsage tileUsage, SkPixelGeometry geo, diff --git a/src/core/SkDevice.h b/src/core/SkDevice.h index db5db6444c..f38f7ea00a 100644 --- a/src/core/SkDevice.h +++ b/src/core/SkDevice.h @@ -75,16 +75,6 @@ public: return this->imageInfo().isOpaque(); } -#ifdef SK_SUPPORT_LEGACY_ACCESSBITMAP - /** Return the bitmap associated with this device. Call this each time you need - to access the bitmap, as it notifies the subclass to perform any flushing - etc. before you examine the pixels. - @param changePixels set to true if the caller plans to change the pixels - @return the device's bitmap - */ - const SkBitmap& accessBitmap(bool changePixels); -#endif - bool writePixels(const SkImageInfo&, const void*, size_t rowBytes, int x, int y); /** @@ -242,17 +232,6 @@ protected: /////////////////////////////////////////////////////////////////////////// -#ifdef SK_SUPPORT_LEGACY_ACCESSBITMAP - /** Update as needed the pixel value in the bitmap, so that the caller can - access the pixels directly. - @return The device contents as a bitmap - */ - virtual const SkBitmap& onAccessBitmap() { - SkASSERT(0); - return fLegacyBitmap; - } -#endif - virtual GrContext* context() const { return nullptr; } virtual sk_sp makeSurface(const SkImageInfo&, const SkSurfaceProps&); -- cgit v1.2.3