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

Unified Diff: src/gpu/effects/GrBicubicEffect.h

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/gpu/effects/GrBezierEffect.cpp ('k') | src/gpu/effects/GrBicubicEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrBicubicEffect.h
diff --git a/src/gpu/effects/GrBicubicEffect.h b/src/gpu/effects/GrBicubicEffect.h
index 208719217bc284669c1b78df165ca5310dbd7157..3c84f979191d396fb0430deac717d9c0c674675d 100644
--- a/src/gpu/effects/GrBicubicEffect.h
+++ b/src/gpu/effects/GrBicubicEffect.h
@@ -32,43 +32,46 @@ public:
/**
* Create a simple filter effect with custom bicubic coefficients and optional domain.
*/
- static const GrFragmentProcessor* Create(GrTexture* tex, const SkScalar coefficients[16],
- const SkRect* domain = nullptr) {
+ static sk_sp<GrFragmentProcessor> Make(GrTexture* tex, const SkScalar coefficients[16],
+ const SkRect* domain = nullptr) {
if (nullptr == domain) {
static const SkShader::TileMode kTileModes[] = { SkShader::kClamp_TileMode,
SkShader::kClamp_TileMode };
- return Create(tex, coefficients, GrCoordTransform::MakeDivByTextureWHMatrix(tex),
- kTileModes);
+ return Make(tex, coefficients, GrCoordTransform::MakeDivByTextureWHMatrix(tex),
+ kTileModes);
} else {
- return new GrBicubicEffect(tex, coefficients,
- GrCoordTransform::MakeDivByTextureWHMatrix(tex), *domain);
+ return sk_sp<GrFragmentProcessor>(
+ new GrBicubicEffect(tex, coefficients,
+ GrCoordTransform::MakeDivByTextureWHMatrix(tex), *domain));
}
}
/**
* Create a Mitchell filter effect with specified texture matrix and x/y tile modes.
*/
- static const GrFragmentProcessor* Create(GrTexture* tex, const SkMatrix& matrix,
- const SkShader::TileMode tileModes[2]) {
- return Create(tex, gMitchellCoefficients, matrix, tileModes);
+ static sk_sp<GrFragmentProcessor> Make(GrTexture* tex, const SkMatrix& matrix,
+ const SkShader::TileMode tileModes[2]) {
+ return Make(tex, gMitchellCoefficients, matrix, tileModes);
}
/**
* Create a filter effect with custom bicubic coefficients, the texture matrix, and the x/y
* tilemodes.
*/
- static const GrFragmentProcessor* Create(GrTexture* tex, const SkScalar coefficients[16],
- const SkMatrix& matrix,
- const SkShader::TileMode tileModes[2]) {
- return new GrBicubicEffect(tex, coefficients, matrix, tileModes);
+ static sk_sp<GrFragmentProcessor> Make(GrTexture* tex, const SkScalar coefficients[16],
+ const SkMatrix& matrix,
+ const SkShader::TileMode tileModes[2]) {
+ return sk_sp<GrFragmentProcessor>(new GrBicubicEffect(tex, coefficients, matrix,
+ tileModes));
}
/**
* Create a Mitchell filter effect with a texture matrix and a domain.
*/
- static const GrFragmentProcessor* Create(GrTexture* tex, const SkMatrix& matrix,
- const SkRect& domain) {
- return new GrBicubicEffect(tex, gMitchellCoefficients, matrix, domain);
+ static sk_sp<GrFragmentProcessor> Make(GrTexture* tex, const SkMatrix& matrix,
+ const SkRect& domain) {
+ return sk_sp<GrFragmentProcessor>(new GrBicubicEffect(tex, gMitchellCoefficients, matrix,
+ domain));
}
/**
« no previous file with comments | « src/gpu/effects/GrBezierEffect.cpp ('k') | src/gpu/effects/GrBicubicEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698