Make bicubic FP factories return const FPs
TBR=egdaniel@google.com Review URL: https://codereview.chromium.org/1413403008
This commit is contained in:
parent
a4d3797c3b
commit
8515377d8f
@ -400,7 +400,7 @@ const GrFragmentProcessor* SkBitmapProcShader::asFragmentProcessor(GrContext* co
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
SkAutoTUnref<GrFragmentProcessor> inner;
|
SkAutoTUnref<const GrFragmentProcessor> inner;
|
||||||
if (doBicubic) {
|
if (doBicubic) {
|
||||||
inner.reset(GrBicubicEffect::Create(texture, matrix, tm));
|
inner.reset(GrBicubicEffect::Create(texture, matrix, tm));
|
||||||
} else {
|
} else {
|
||||||
|
@ -32,8 +32,8 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Create a simple filter effect with custom bicubic coefficients and optional domain.
|
* Create a simple filter effect with custom bicubic coefficients and optional domain.
|
||||||
*/
|
*/
|
||||||
static GrFragmentProcessor* Create(GrTexture* tex, const SkScalar coefficients[16],
|
static const GrFragmentProcessor* Create(GrTexture* tex, const SkScalar coefficients[16],
|
||||||
const SkRect* domain = nullptr) {
|
const SkRect* domain = nullptr) {
|
||||||
if (nullptr == domain) {
|
if (nullptr == domain) {
|
||||||
static const SkShader::TileMode kTileModes[] = { SkShader::kClamp_TileMode,
|
static const SkShader::TileMode kTileModes[] = { SkShader::kClamp_TileMode,
|
||||||
SkShader::kClamp_TileMode };
|
SkShader::kClamp_TileMode };
|
||||||
@ -48,8 +48,8 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Create a Mitchell filter effect with specified texture matrix and x/y tile modes.
|
* Create a Mitchell filter effect with specified texture matrix and x/y tile modes.
|
||||||
*/
|
*/
|
||||||
static GrFragmentProcessor* Create(GrTexture* tex, const SkMatrix& matrix,
|
static const GrFragmentProcessor* Create(GrTexture* tex, const SkMatrix& matrix,
|
||||||
SkShader::TileMode tileModes[2]) {
|
SkShader::TileMode tileModes[2]) {
|
||||||
return Create(tex, gMitchellCoefficients, matrix, tileModes);
|
return Create(tex, gMitchellCoefficients, matrix, tileModes);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,17 +57,17 @@ public:
|
|||||||
* Create a filter effect with custom bicubic coefficients, the texture matrix, and the x/y
|
* Create a filter effect with custom bicubic coefficients, the texture matrix, and the x/y
|
||||||
* tilemodes.
|
* tilemodes.
|
||||||
*/
|
*/
|
||||||
static GrFragmentProcessor* Create(GrTexture* tex, const SkScalar coefficients[16],
|
static const GrFragmentProcessor* Create(GrTexture* tex, const SkScalar coefficients[16],
|
||||||
const SkMatrix& matrix,
|
const SkMatrix& matrix,
|
||||||
const SkShader::TileMode tileModes[2]) {
|
const SkShader::TileMode tileModes[2]) {
|
||||||
return new GrBicubicEffect(tex, coefficients, matrix, tileModes);
|
return new GrBicubicEffect(tex, coefficients, matrix, tileModes);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a Mitchell filter effect with a texture matrix and a domain.
|
* Create a Mitchell filter effect with a texture matrix and a domain.
|
||||||
*/
|
*/
|
||||||
static GrFragmentProcessor* Create(GrTexture* tex, const SkMatrix& matrix,
|
static const GrFragmentProcessor* Create(GrTexture* tex, const SkMatrix& matrix,
|
||||||
const SkRect& domain) {
|
const SkRect& domain) {
|
||||||
return new GrBicubicEffect(tex, gMitchellCoefficients, matrix, domain);
|
return new GrBicubicEffect(tex, gMitchellCoefficients, matrix, domain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ const GrFragmentProcessor* SkImageShader::asFragmentProcessor(GrContext* context
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
SkAutoTUnref<GrFragmentProcessor> inner;
|
SkAutoTUnref<const GrFragmentProcessor> inner;
|
||||||
if (doBicubic) {
|
if (doBicubic) {
|
||||||
inner.reset(GrBicubicEffect::Create(texture, matrix, tm));
|
inner.reset(GrBicubicEffect::Create(texture, matrix, tm));
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user