aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkMorphologyImageFilter.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-01-11 10:56:59 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-11 10:56:59 -0800
commit4e23cdaa6b892afeaa150c6d74099dc6c2065b7e (patch)
tree259fa62c7cbb4a3cdbdc069719012148dd5ff836 /src/effects/SkMorphologyImageFilter.cpp
parent5651ee6376dc3271ea8f4fc91b037c8f361c3cfa (diff)
remove imagefilter::sizeconstraint
Diffstat (limited to 'src/effects/SkMorphologyImageFilter.cpp')
-rw-r--r--src/effects/SkMorphologyImageFilter.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index 205fc0d1eb..895000e86e 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -548,8 +548,7 @@ bool apply_morphology(const SkBitmap& input,
const SkIRect& rect,
GrMorphologyEffect::MorphologyType morphType,
SkISize radius,
- SkBitmap* dst,
- GrTextureProvider::SizeConstraint constraint) {
+ SkBitmap* dst) {
SkAutoTUnref<GrTexture> srcTexture(SkRef(input.getTexture()));
SkASSERT(srcTexture);
GrContext* context = srcTexture->getContext();
@@ -567,14 +566,7 @@ bool apply_morphology(const SkBitmap& input,
SkIRect srcRect = rect;
if (radius.fWidth > 0) {
- GrTextureProvider::SizeConstraint horiConstraint = constraint;
- if (radius.fHeight > 0) {
- // Optimization: we will fall through and allocate the "real" texture after this one
- // so ours can be approximate (likely faster to allocate)
- horiConstraint = GrTextureProvider::kApprox_SizeConstraint;
- }
-
- GrTexture* scratch = context->textureProvider()->createTexture(desc, horiConstraint);
+ GrTexture* scratch = context->textureProvider()->createApproxTexture(desc);
if (nullptr == scratch) {
return false;
}
@@ -598,7 +590,7 @@ bool apply_morphology(const SkBitmap& input,
srcRect = dstRect;
}
if (radius.fHeight > 0) {
- GrTexture* scratch = context->textureProvider()->createTexture(desc, constraint);
+ GrTexture* scratch = context->textureProvider()->createApproxTexture(desc);
if (nullptr == scratch) {
return false;
}
@@ -656,8 +648,7 @@ bool SkMorphologyImageFilter::filterImageGPUGeneric(bool dilate,
GrMorphologyEffect::MorphologyType type = dilate ? GrMorphologyEffect::kDilate_MorphologyType
: GrMorphologyEffect::kErode_MorphologyType;
- if (!apply_morphology(input, srcBounds, type, SkISize::Make(width, height), result,
- GrTextureProvider::FromImageFilter(ctx.sizeConstraint()))) {
+ if (!apply_morphology(input, srcBounds, type, SkISize::Make(width, height), result)) {
return false;
}
offset->fX = bounds.left();