Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Unified Diff: src/effects/SkXfermodeImageFilter.cpp

Issue 2041113004: sk_sp for gpu. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reserve correctly. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/SkTableColorFilter.cpp ('k') | src/effects/gradients/SkLinearGradient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkXfermodeImageFilter.cpp
diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp
index 1921e00a1afa6b3443f0490bdb95f655600c343c..785b46fcc70d321821aeea7abbeaea505783243c 100644
--- a/src/effects/SkXfermodeImageFilter.cpp
+++ b/src/effects/SkXfermodeImageFilter.cpp
@@ -180,22 +180,22 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter::filterImageGPU(SkSpecialImage* sour
GrPaint paint;
// SRGBTODO: AllowSRGBInputs?
- SkAutoTUnref<const GrFragmentProcessor> bgFP;
+ sk_sp<GrFragmentProcessor> bgFP;
if (backgroundTex) {
SkMatrix backgroundMatrix;
backgroundMatrix.setIDiv(backgroundTex->width(), backgroundTex->height());
backgroundMatrix.preTranslate(SkIntToScalar(-backgroundOffset.fX),
SkIntToScalar(-backgroundOffset.fY));
- bgFP.reset(GrTextureDomainEffect::Create(
+ bgFP = GrTextureDomainEffect::Make(
backgroundTex.get(), backgroundMatrix,
GrTextureDomain::MakeTexelDomain(backgroundTex.get(),
background->subset()),
GrTextureDomain::kDecal_Mode,
- GrTextureParams::kNone_FilterMode));
+ GrTextureParams::kNone_FilterMode);
} else {
- bgFP.reset(GrConstColorProcessor::Create(GrColor_TRANSPARENT_BLACK,
- GrConstColorProcessor::kIgnore_InputMode));
+ bgFP = GrConstColorProcessor::Make(GrColor_TRANSPARENT_BLACK,
+ GrConstColorProcessor::kIgnore_InputMode);
}
if (foregroundTex) {
@@ -204,16 +204,16 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter::filterImageGPU(SkSpecialImage* sour
foregroundMatrix.preTranslate(SkIntToScalar(-foregroundOffset.fX),
SkIntToScalar(-foregroundOffset.fY));
- SkAutoTUnref<const GrFragmentProcessor> foregroundFP;
+ sk_sp<GrFragmentProcessor> foregroundFP;
- foregroundFP.reset(GrTextureDomainEffect::Create(
+ foregroundFP = GrTextureDomainEffect::Make(
foregroundTex.get(), foregroundMatrix,
GrTextureDomain::MakeTexelDomain(foregroundTex.get(),
foreground->subset()),
GrTextureDomain::kDecal_Mode,
- GrTextureParams::kNone_FilterMode));
+ GrTextureParams::kNone_FilterMode);
- paint.addColorFragmentProcessor(foregroundFP.get());
+ paint.addColorFragmentProcessor(std::move(foregroundFP));
// A null fMode is interpreted to mean kSrcOver_Mode (to match raster).
SkAutoTUnref<SkXfermode> mode(SkSafeRef(fMode.get()));
@@ -228,14 +228,15 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter::filterImageGPU(SkSpecialImage* sour
mode.reset(new SkProcCoeffXfermode(rec, SkXfermode::kSrcOver_Mode));
}
- sk_sp<const GrFragmentProcessor> xferFP(mode->getFragmentProcessorForImageFilter(bgFP));
+ sk_sp<GrFragmentProcessor> xferFP(
+ mode->makeFragmentProcessorForImageFilter(std::move(bgFP)));
// A null 'xferFP' here means kSrc_Mode was used in which case we can just proceed
if (xferFP) {
- paint.addColorFragmentProcessor(xferFP.get());
+ paint.addColorFragmentProcessor(std::move(xferFP));
}
} else {
- paint.addColorFragmentProcessor(bgFP);
+ paint.addColorFragmentProcessor(std::move(bgFP));
}
paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode);
« no previous file with comments | « src/effects/SkTableColorFilter.cpp ('k') | src/effects/gradients/SkLinearGradient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698