diff options
author | 2021-10-28 21:42:35 +0000 | |
---|---|---|
committer | 2021-10-28 21:45:20 +0000 | |
commit | 9b87556cbb7f131f6a5179169a393e170fd8531d (patch) | |
tree | 37fc2270d0c5d3c3eae2eb40fbb3d510fabc4b28 | |
parent | 371454135eeffc0902d19900659a48d6941288a5 (diff) |
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
-rw-r--r-- | libs/hwui/tests/unit/RenderNodeDrawableTests.cpp | 4 | ||||
-rw-r--r-- | libs/hwui/tests/unit/SkiaPipelineTests.cpp | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp b/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp index 423400eb8ff1..8260ae213056 100644 --- a/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp +++ b/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp @@ -469,7 +469,11 @@ RENDERTHREAD_SKIA_PIPELINE_TEST(RenderNodeDrawable, projectionHwLayer) { } 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 57a7fe3fd466..fadb1de43376 100644 --- a/libs/hwui/tests/unit/SkiaPipelineTests.cpp +++ b/libs/hwui/tests/unit/SkiaPipelineTests.cpp @@ -221,7 +221,11 @@ public: 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 {} }; } |