diff options
-rw-r--r-- | gn/android_framework_defines.gni | 1 | ||||
-rw-r--r-- | src/image/SkSurface_Base.h | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/gn/android_framework_defines.gni b/gn/android_framework_defines.gni index f84c275294..76c8339a9c 100644 --- a/gn/android_framework_defines.gni +++ b/gn/android_framework_defines.gni @@ -16,4 +16,5 @@ android_framework_defines = [ "SK_SUPPORT_LEGACY_SHADER_ISABITMAP", "SK_SUPPORT_LEGACY_EMBOSSMASKFILTER", "SK_SUPPORT_LEGACY_CANVAS_HELPERS", + "SK_SUPPORT_LEGACY_IMG_SNAPSHOT", ] diff --git a/src/image/SkSurface_Base.h b/src/image/SkSurface_Base.h index 1b0f9ff975..e0005647e6 100644 --- a/src/image/SkSurface_Base.h +++ b/src/image/SkSurface_Base.h @@ -43,7 +43,16 @@ public: * must faithfully represent the current contents, even if the surface * is changed after this called (e.g. it is drawn to via its canvas). */ +#ifdef SK_SUPPORT_LEGACY_IMG_SNAPSHOT + // This entry point is never called but is just here so Android unit tests will compile + virtual sk_sp<SkImage> onNewImageSnapshot(SkBudgeted) { return nullptr; } + + // This entry point should be pure virtual. It has a default implementation so Android + // unit tests will compile. + virtual sk_sp<SkImage> onNewImageSnapshot() { return nullptr; } +#else virtual sk_sp<SkImage> onNewImageSnapshot() = 0; +#endif /** * Default implementation: |