diff options
author | 2016-06-09 08:01:03 -0700 | |
---|---|---|
committer | 2016-06-09 08:01:03 -0700 | |
commit | 06ca8ec87cf6fab57cadd043a5ac18c4154a4129 (patch) | |
tree | 95e7eaaaf3f42ce550332277c431e3ec119446f4 /src/gpu/GrTextureParamsAdjuster.cpp | |
parent | 897a8e38879643d81a64d2bb6bed4e22af982aa4 (diff) |
sk_sp for Ganesh.
Convert use of GrFragmentProcessor, GrGeometryProcessor, and
GrXPFactory to sk_sp. This clarifies ownership and should
reduce reference count churn by moving ownership.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2041113004
Review-Url: https://codereview.chromium.org/2041113004
Diffstat (limited to 'src/gpu/GrTextureParamsAdjuster.cpp')
-rw-r--r-- | src/gpu/GrTextureParamsAdjuster.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/gpu/GrTextureParamsAdjuster.cpp b/src/gpu/GrTextureParamsAdjuster.cpp index 076750ee5a..a68c3d7657 100644 --- a/src/gpu/GrTextureParamsAdjuster.cpp +++ b/src/gpu/GrTextureParamsAdjuster.cpp @@ -93,9 +93,9 @@ static GrTexture* copy_on_gpu(GrTexture* inputTexture, const SkIRect* subset, // better! SkASSERT(copyParams.fFilter != GrTextureParams::kMipMap_FilterMode); paint.addColorFragmentProcessor( - GrTextureDomainEffect::Create(inputTexture, SkMatrix::I(), domain, - GrTextureDomain::kClamp_Mode, - copyParams.fFilter))->unref(); + GrTextureDomainEffect::Make(inputTexture, SkMatrix::I(), domain, + GrTextureDomain::kClamp_Mode, + copyParams.fFilter)); } else { GrTextureParams params(SkShader::kClamp_TileMode, copyParams.fFilter); paint.addColorTextureProcessor(inputTexture, SkMatrix::I(), params); @@ -342,7 +342,7 @@ static DomainMode determine_domain_mode( return kDomain_DomainMode; } -static const GrFragmentProcessor* create_fp_for_domain_and_filter( +static sk_sp<GrFragmentProcessor> create_fp_for_domain_and_filter( GrTexture* texture, const SkMatrix& textureMatrix, DomainMode domainMode, @@ -351,25 +351,25 @@ static const GrFragmentProcessor* create_fp_for_domain_and_filter( SkASSERT(kTightCopy_DomainMode != domainMode); if (filterOrNullForBicubic) { if (kDomain_DomainMode == domainMode) { - return GrTextureDomainEffect::Create(texture, textureMatrix, domain, - GrTextureDomain::kClamp_Mode, - *filterOrNullForBicubic); + return GrTextureDomainEffect::Make(texture, textureMatrix, domain, + GrTextureDomain::kClamp_Mode, + *filterOrNullForBicubic); } else { GrTextureParams params(SkShader::kClamp_TileMode, *filterOrNullForBicubic); - return GrSimpleTextureEffect::Create(texture, textureMatrix, params); + return GrSimpleTextureEffect::Make(texture, textureMatrix, params); } } else { if (kDomain_DomainMode == domainMode) { - return GrBicubicEffect::Create(texture, textureMatrix, domain); + return GrBicubicEffect::Make(texture, textureMatrix, domain); } else { static const SkShader::TileMode kClampClamp[] = { SkShader::kClamp_TileMode, SkShader::kClamp_TileMode }; - return GrBicubicEffect::Create(texture, textureMatrix, kClampClamp); + return GrBicubicEffect::Make(texture, textureMatrix, kClampClamp); } } } -const GrFragmentProcessor* GrTextureAdjuster::createFragmentProcessor( +sk_sp<GrFragmentProcessor> GrTextureAdjuster::createFragmentProcessor( const SkMatrix& origTextureMatrix, const SkRect& origConstraintRect, FilterConstraint filterConstraint, @@ -467,7 +467,7 @@ GrTexture* GrTextureMaker::refTextureForParams(const GrTextureParams& params, return result; } -const GrFragmentProcessor* GrTextureMaker::createFragmentProcessor( +sk_sp<GrFragmentProcessor> GrTextureMaker::createFragmentProcessor( const SkMatrix& textureMatrix, const SkRect& constraintRect, FilterConstraint filterConstraint, |