aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-06-12 16:39:59 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-13 13:55:56 +0000
commit5f4b09d523a761a3a5c622bb01eeba47905da5f0 (patch)
tree899574a311503375d911ee6486894eb921138550 /include
parented8ed91ec8c0eb523262eb7bb91558399c7e591f (diff)
Allow caller to specify if the want mip maps in makeTextureImage call.
Since Ganesh no longer will allocate mips late, this gives the clients a way to tell skia that they want the texture they will be using to have mips. It also supports allowing a client to take a non mipped texture backed image and turn it into a new image which is mipped and texture backed. Bug: chromium:834837 Change-Id: I1781ce618c22023b6309f248e7ee49e69bd3c6df Reviewed-on: https://skia-review.googlesource.com/134323 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Eric Karl <ericrk@chromium.org> Reviewed-by: Cary Clark <caryclark@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/core/SkImage.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/core/SkImage.h b/include/core/SkImage.h
index 5aba2433ad..788abe69c8 100644
--- a/include/core/SkImage.h
+++ b/include/core/SkImage.h
@@ -740,17 +740,22 @@ public:
sk_sp<SkImage> makeSubset(const SkIRect& subset) const;
/** Returns SkImage backed by GPU texture associated with context. Returned SkImage is
- compatible with SkSurface created with dstColorSpace. Returns original
- SkImage if context and dstColorSpace match.
+ compatible with SkSurface created with dstColorSpace. The returned SkImage will also
+ support the request GrMipMapped status. In other words if mipMapped is GrMipMapped::kYes,
+ then the backing texture will have mip map levles allocated. Returns original SkImage if
+ context and dstColorSpace match and mipMapped is compatible with the backing GPU_Texture.
Returns nullptr if context is nullptr, or if SkImage was created with another
GrContext.
@param context GPU context
@param dstColorSpace range of colors of matching SkSurface on GPU
+ @param mipMapped whether the returned SkImage's texture must have allocated Mip_Map
+ levels.
@return created SkImage, or nullptr
*/
- sk_sp<SkImage> makeTextureImage(GrContext* context, SkColorSpace* dstColorSpace) const;
+ sk_sp<SkImage> makeTextureImage(GrContext* context, SkColorSpace* dstColorSpace,
+ GrMipMapped mipMapped = GrMipMapped::kNo) const;
/** Returns raster image or lazy image. Copies SkImage backed by GPU texture into
CPU memory if needed. Returns original SkImage if decoded in raster bitmap,