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
This commit is contained in:
Ben Wagner
2021-10-28 21:42:35 +00:00
parent 371454135e
commit 9b87556cbb
2 changed files with 8 additions and 0 deletions

View File

@@ -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) {}
};

View File

@@ -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 {}
};
}