Index: src/image/SkImage_Raster.cpp |
diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp |
index 8afe7fd13aeec1668dd08c6ea15b1f985387c375..5025dfa8c458007623b8544f634eda31b65686a9 100644 |
--- a/src/image/SkImage_Raster.cpp |
+++ b/src/image/SkImage_Raster.cpp |
@@ -231,18 +231,6 @@ SkImage* SkImage::NewFromRaster(const SkImageInfo& info, const void* pixels, siz |
return new SkImage_Raster(info, data, rowBytes, ctable, nullptr); |
} |
-SkImage* SkImage::NewFromGenerator(SkImageGenerator* generator, const SkIRect* subset) { |
- SkBitmap bitmap; |
- if (!SkInstallDiscardablePixelRef(generator, subset, &bitmap, nullptr)) { |
- return nullptr; |
- } |
- if (0 == bitmap.width() || 0 == bitmap.height()) { |
- return nullptr; |
- } |
- |
- return new SkImage_Raster(bitmap, nullptr); |
-} |
- |
SkImage* SkNewImageFromPixelRef(const SkImageInfo& info, SkPixelRef* pr, |
const SkIPoint& pixelRefOrigin, size_t rowBytes, |
const SkSurfaceProps* props) { |
@@ -301,3 +289,16 @@ bool SkImage_Raster::onAsLegacyBitmap(SkBitmap* bitmap, LegacyBitmapMode mode) c |
} |
return this->INHERITED::onAsLegacyBitmap(bitmap, mode); |
} |
+ |
+#ifdef SK_SUPPORT_LEGACY_NEWFROMGENERATOR |
+SkImage* SkImage::NewFromGenerator(SkImageGenerator* generator, const SkIRect* subset) { |
+ SkBitmap bitmap; |
+ if (!SkInstallDiscardablePixelRef(generator, subset, &bitmap, nullptr)) { |
+ return nullptr; |
+ } |
+ if (0 == bitmap.width() || 0 == bitmap.height()) { |
+ return nullptr; |
+ } |
+ return new SkImage_Raster(bitmap, nullptr); |
+} |
+#endif |