Merge "Prepare for removal of SK_SURFACE_COPY_ON_WRITE_CRASHES"

This commit is contained in:
TreeHugger Robot
2021-10-29 12:57:39 +00:00
committed by Android (Google) Code Review
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 {}
};
}