aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-05-04 13:43:19 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-07 18:08:40 +0000
commit2a943df011ef8cfbc9b4f8829ebf9f6385e40054 (patch)
tree6cd980ebdb5655cdeb15d4526d624b5ae2f8b2ee /src/image
parent817847c0c6ca538d5a1b87647dc94cdc31b30c41 (diff)
Make GPU lattice/nine patch not bleed across cells.
Consolidate code for handling various image/bitmap and lattice/ninepatch flavors. Makes refTextureForParams virtual on GrTextureProducer. Previously both subclasses had non-virtual flavors of this. Bug: b/77917978 Change-Id: I14787faef33c4617ef359039e81453d683f33ff1 Reviewed-on: https://skia-review.googlesource.com/125520 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/image')
-rw-r--r--src/image/SkImage_Gpu.cpp6
-rw-r--r--src/image/SkImage_Raster.cpp6
2 files changed, 2 insertions, 10 deletions
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index 4786407104..17a0a25f5a 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -135,13 +135,9 @@ sk_sp<GrTextureProxy> SkImage_Gpu::asTextureProxyRef(GrContext* context,
return nullptr;
}
- if (texColorSpace) {
- *texColorSpace = this->fColorSpace;
- }
-
GrTextureAdjuster adjuster(fContext, fProxy, this->alphaType(), this->uniqueID(),
this->fColorSpace.get());
- return adjuster.refTextureProxySafeForParams(params, scaleAdjust);
+ return adjuster.refTextureProxyForParams(params, dstColorSpace, texColorSpace, scaleAdjust);
}
static void apply_premul(const SkImageInfo& info, void* pixels, size_t rowBytes) {
diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp
index 688f71c673..cd9ada6bb5 100644
--- a/src/image/SkImage_Raster.cpp
+++ b/src/image/SkImage_Raster.cpp
@@ -180,16 +180,12 @@ sk_sp<GrTextureProxy> SkImage_Raster::asTextureProxyRef(GrContext* context,
return nullptr;
}
- if (texColorSpace) {
- *texColorSpace = sk_ref_sp(fBitmap.colorSpace());
- }
-
uint32_t uniqueID;
sk_sp<GrTextureProxy> tex = this->refPinnedTextureProxy(&uniqueID);
if (tex) {
GrTextureAdjuster adjuster(context, fPinnedProxy, fBitmap.alphaType(), fPinnedUniqueID,
fBitmap.colorSpace());
- return adjuster.refTextureProxySafeForParams(params, scaleAdjust);
+ return adjuster.refTextureProxyForParams(params, dstColorSpace, texColorSpace, scaleAdjust);
}
return GrRefCachedBitmapTextureProxy(context, fBitmap, params, scaleAdjust);