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

Unified Diff: src/effects/SkMorphologyImageFilter.cpp

Issue 1571033002: remove imagefilter::sizeconstraint (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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/SkLightingImageFilter.cpp ('k') | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkMorphologyImageFilter.cpp
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index 205fc0d1eb2c71d924d8badd35ee4c518b3dd3a3..895000e86e93b834446689c78e2e71210faff8fb 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();
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698