no need for SK_SUPPORT_LEGACY_CANVAS_IS_REFCNT anymore
BUG=skia:
Change-Id: If0aa01beb8be9bd7d9a3a5b23c795223b02f02d3
Reviewed-on: https://skia-review.googlesource.com/5690
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 0804ae4..9ba441a 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -59,13 +59,7 @@
color, typeface, textSize, strokeWidth, shader (e.g. gradients, patterns),
etc.
*/
-class SK_API SkCanvas
-#ifdef SK_SUPPORT_LEGACY_CANVAS_IS_REFCNT
-: public SkRefCnt
-#else
-: SkNoncopyable
-#endif
-{
+class SK_API SkCanvas : SkNoncopyable {
enum PrivateSaveLayerFlags {
kDontClipToLayer_PrivateSaveLayerFlag = 1U << 31,
};
@@ -112,16 +106,6 @@
return MakeRasterDirect(SkImageInfo::MakeN32Premul(width, height), pixels, rowBytes);
}
-#ifdef SK_SUPPORT_LEGACY_CANVAS_IS_REFCNT
- static SkCanvas* NewRasterDirect(const SkImageInfo& info, void* pixels, size_t rowBytes) {
- return MakeRasterDirect(info, pixels, rowBytes).release();
- }
-
- static SkCanvas* NewRasterDirectN32(int width, int height, SkPMColor* pixels, size_t rowBytes) {
- return MakeRasterDirectN32(width, height, pixels, rowBytes).release();
- }
-#endif
-
/**
* Creates an empty canvas with no backing device/pixels, and zero
* dimensions.
diff --git a/include/core/SkPictureRecorder.h b/include/core/SkPictureRecorder.h
index 7bf081d..a440790 100644
--- a/include/core/SkPictureRecorder.h
+++ b/include/core/SkPictureRecorder.h
@@ -115,11 +115,7 @@
uint32_t fFlags;
SkRect fCullRect;
sk_sp<SkBBoxHierarchy> fBBH;
-#ifdef SK_SUPPORT_LEGACY_CANVAS_IS_REFCNT
- sk_sp<SkRecorder> fRecorder;
-#else
std::unique_ptr<SkRecorder> fRecorder;
-#endif
sk_sp<SkRecord> fRecord;
SkMiniRecorder fMiniRecorder;
diff --git a/include/svg/SkSVGCanvas.h b/include/svg/SkSVGCanvas.h
index b72f273..f544f64 100644
--- a/include/svg/SkSVGCanvas.h
+++ b/include/svg/SkSVGCanvas.h
@@ -26,12 +26,6 @@
* SVG element).
*/
static std::unique_ptr<SkCanvas> Make(const SkRect& bounds, SkXMLWriter*);
-
-#ifdef SK_SUPPORT_LEGACY_CANVAS_IS_REFCNT
- static SkCanvas* Create(const SkRect& bounds, SkXMLWriter* writer) {
- return Make(bounds, writer).release();
- }
-#endif
};
#endif
diff --git a/include/utils/SkCanvasStateUtils.h b/include/utils/SkCanvasStateUtils.h
index fbc3a6f..23cada8 100644
--- a/include/utils/SkCanvasStateUtils.h
+++ b/include/utils/SkCanvasStateUtils.h
@@ -63,11 +63,6 @@
* calling unref on the SkCanvas.
*/
static std::unique_ptr<SkCanvas> MakeFromCanvasState(const SkCanvasState* state);
-#ifdef SK_SUPPORT_LEGACY_CANVAS_IS_REFCNT
- static SkCanvas* CreateFromCanvasState(const SkCanvasState* state) {
- return MakeFromCanvasState(state).release();
- }
-#endif
/**
* Free the memory associated with the captured canvas state. The state
diff --git a/include/utils/SkNullCanvas.h b/include/utils/SkNullCanvas.h
index 884b68b..8e5e0ac 100644
--- a/include/utils/SkNullCanvas.h
+++ b/include/utils/SkNullCanvas.h
@@ -8,19 +8,11 @@
#ifndef SkNullCanvas_DEFINED
#define SkNullCanvas_DEFINED
-#include "SkBitmap.h"
-
-class SkCanvas;
+#include "SkCanvas.h"
/**
* Creates a canvas that draws nothing. This is useful for performance testing.
*/
SK_API std::unique_ptr<SkCanvas> SkMakeNullCanvas();
-#ifdef SK_SUPPORT_LEGACY_CANVAS_IS_REFCNT
-static inline SkCanvas* SkCreateNullCanvas() {
- return SkMakeNullCanvas().release();
-}
-#endif
-
#endif
diff --git a/src/utils/SkCanvasStateUtils.cpp b/src/utils/SkCanvasStateUtils.cpp
index c1307b2..d31eaa6 100644
--- a/src/utils/SkCanvasStateUtils.cpp
+++ b/src/utils/SkCanvasStateUtils.cpp
@@ -105,11 +105,7 @@
layers = nullptr;
mcState.clipRectCount = 0;
mcState.clipRects = nullptr;
-#ifdef SK_SUPPORT_LEGACY_CANVAS_IS_REFCNT
- originalCanvas = SkRef(canvas);
-#else
originalCanvas = canvas;
-#endif
}
~SkCanvasState_v1() {
@@ -120,10 +116,6 @@
sk_free(mcState.clipRects);
sk_free(layers);
-
-#ifdef SK_SUPPORT_LEGACY_CANVAS_IS_REFCNT
- originalCanvas->unref();
-#endif
}
SkMCState mcState;