diff options
author | Brian Salomon <bsalomon@google.com> | 2018-05-04 13:43:19 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-05-07 18:08:40 +0000 |
commit | 2a943df011ef8cfbc9b4f8829ebf9f6385e40054 (patch) | |
tree | 6cd980ebdb5655cdeb15d4526d624b5ae2f8b2ee /src/gpu/GrTextureAdjuster.cpp | |
parent | 817847c0c6ca538d5a1b87647dc94cdc31b30c41 (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/gpu/GrTextureAdjuster.cpp')
-rw-r--r-- | src/gpu/GrTextureAdjuster.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gpu/GrTextureAdjuster.cpp b/src/gpu/GrTextureAdjuster.cpp index f30b0eb03d..e39937d356 100644 --- a/src/gpu/GrTextureAdjuster.cpp +++ b/src/gpu/GrTextureAdjuster.cpp @@ -65,8 +65,11 @@ sk_sp<GrTextureProxy> GrTextureAdjuster::refTextureProxyCopy(const CopyParams& c return copy; } -sk_sp<GrTextureProxy> GrTextureAdjuster::refTextureProxySafeForParams(const GrSamplerState& params, - SkScalar scaleAdjust[2]) { +sk_sp<GrTextureProxy> GrTextureAdjuster::onRefTextureProxyForParams( + const GrSamplerState& params, + SkColorSpace* dstColorSpace, + sk_sp<SkColorSpace>* texColorSpace, + SkScalar scaleAdjust[2]) { sk_sp<GrTextureProxy> proxy = this->originalProxyRef(); CopyParams copyParams; @@ -75,6 +78,9 @@ sk_sp<GrTextureProxy> GrTextureAdjuster::refTextureProxySafeForParams(const GrSa return nullptr; } + if (texColorSpace) { + *texColorSpace = sk_ref_sp(fColorSpace); + } SkASSERT(this->width() <= fContext->caps()->maxTextureSize() && this->height() <= fContext->caps()->maxTextureSize()); @@ -104,7 +110,7 @@ std::unique_ptr<GrFragmentProcessor> GrTextureAdjuster::createFragmentProcessor( } SkScalar scaleAdjust[2] = { 1.0f, 1.0f }; sk_sp<GrTextureProxy> proxy( - this->refTextureProxySafeForParams(samplerState, scaleAdjust)); + this->refTextureProxyForParams(samplerState, nullptr, nullptr, scaleAdjust)); if (!proxy) { return nullptr; } |