diff options
author | Greg Daniel <egdaniel@google.com> | 2018-02-05 09:34:02 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-02-05 14:56:46 +0000 |
commit | 490695babbe0748ff33c9d23cf9b9f038db59afa (patch) | |
tree | 844e32e04dae8a532a102a1821fec7ed29bb93a4 | |
parent | d587ebe9ea6e06c45b69c71ee1fa32ef6b86296a (diff) |
Add param to GrMakeCachedImageProxy to specify the SkBackingFit
Bug: skia:
Change-Id: Ic103330eb9bab9ba7beb4d1449b559b32072530b
Reviewed-on: https://skia-review.googlesource.com/103461
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
-rw-r--r-- | src/gpu/SkGr.cpp | 5 | ||||
-rw-r--r-- | src/gpu/SkGr.h | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp index 29a89434d9..09ad206b50 100644 --- a/src/gpu/SkGr.cpp +++ b/src/gpu/SkGr.cpp @@ -257,7 +257,8 @@ static void create_unique_key_for_image(const SkImage* image, GrUniqueKey* resul } sk_sp<GrTextureProxy> GrMakeCachedImageProxy(GrProxyProvider* proxyProvider, - sk_sp<SkImage> srcImage) { + sk_sp<SkImage> srcImage, + SkBackingFit fit) { sk_sp<GrTextureProxy> proxy; GrUniqueKey originalKey; @@ -269,7 +270,7 @@ sk_sp<GrTextureProxy> GrMakeCachedImageProxy(GrProxyProvider* proxyProvider, if (!proxy) { proxy = proxyProvider->createTextureProxy(std::move(srcImage), kNone_GrSurfaceFlags, kTopLeft_GrSurfaceOrigin, 1, SkBudgeted::kYes, - SkBackingFit::kExact); + fit); if (proxy && originalKey.isValid()) { proxyProvider->assignUniqueKeyToProxy(originalKey, proxy.get()); } diff --git a/src/gpu/SkGr.h b/src/gpu/SkGr.h index 8cd6e61bcc..c131ef8f22 100644 --- a/src/gpu/SkGr.h +++ b/src/gpu/SkGr.h @@ -248,7 +248,8 @@ sk_sp<GrTextureProxy> GrMakeCachedBitmapProxy(GrProxyProvider*, const SkBitmap& * Create a texture proxy from the provided 'srcImage' and add it to the texture cache * using the key also extracted from 'srcImage'. */ -sk_sp<GrTextureProxy> GrMakeCachedImageProxy(GrProxyProvider*, sk_sp<SkImage> srcImage); +sk_sp<GrTextureProxy> GrMakeCachedImageProxy(GrProxyProvider*, sk_sp<SkImage> srcImage, + SkBackingFit fit = SkBackingFit::kExact); /** * Our key includes the offset, width, and height so that bitmaps created by extractSubset() |