From f7ee95c3d0b317e527314329437dea0b3ab9b422 Mon Sep 17 00:00:00 2001 From: Mike Reed Date: Mon, 4 Dec 2017 14:27:01 -0500 Subject: helper api to force a raster image Bug: skia: Change-Id: I53f3d426e97f446b17dc965fa8dd6d6aae441ac9 Reviewed-on: https://skia-review.googlesource.com/79901 Reviewed-by: Brian Osman Commit-Queue: Mike Reed --- include/core/SkImage.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/core') diff --git a/include/core/SkImage.h b/include/core/SkImage.h index 1d725c237d..75d7083805 100644 --- a/include/core/SkImage.h +++ b/include/core/SkImage.h @@ -384,6 +384,14 @@ public: * the pixels fails). Otherwise, it returns the original image. */ sk_sp makeNonTextureImage() const; + + /** + * If this image is already backed by raster (i.e. peekPixels would succeed), then this just + * returns itself. If not, this attempts to create a raster version of this image and returns + * that, or nullptr if that fails. + */ + sk_sp makeRasterImage() const; + /** * Apply a given image filter to this image, and return the filtered result. * -- cgit v1.2.3