Prepare for removal of SK_SURFACE_COPY_ON_WRITE_CRASHES

The SK_SURFACE_COPY_ON_WRITE_CRASHES is to be removed, so update the code as needed behind the flag so that the flag can be removed.

Change-Id: Ib4e839c502f044253c5cd97f14582651b49f5104
diff --git a/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp b/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp
index 423400e..8260ae2 100644
--- a/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp
+++ b/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp
@@ -469,7 +469,11 @@
         }
         SkCanvas* onNewCanvas() override { return new ProjectionTestCanvas(mDrawCounter); }
         sk_sp<SkSurface> onNewSurface(const SkImageInfo&) override { return nullptr; }
+#ifdef SK_SURFACE_COPY_ON_WRITE_CRASHES
         void onCopyOnWrite(ContentChangeMode) override {}
+#else
+        bool onCopyOnWrite(ContentChangeMode) override { return true; }
+#endif
         int* mDrawCounter;
         void onWritePixels(const SkPixmap&, int x, int y) {}
     };
diff --git a/libs/hwui/tests/unit/SkiaPipelineTests.cpp b/libs/hwui/tests/unit/SkiaPipelineTests.cpp
index 57a7fe3..fadb1de 100644
--- a/libs/hwui/tests/unit/SkiaPipelineTests.cpp
+++ b/libs/hwui/tests/unit/SkiaPipelineTests.cpp
@@ -221,7 +221,11 @@
     sk_sp<SkSurface> onNewSurface(const SkImageInfo&) override { return nullptr; }
     sk_sp<SkImage> onNewImageSnapshot(const SkIRect* bounds) override { return nullptr; }
     T* canvas() { return static_cast<T*>(getCanvas()); }
+#ifdef SK_SURFACE_COPY_ON_WRITE_CRASHES
     void onCopyOnWrite(ContentChangeMode) override {}
+#else
+    bool onCopyOnWrite(ContentChangeMode) override { return true; }
+#endif
     void onWritePixels(const SkPixmap&, int x, int y) override {}
 };
 }