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

Unified Diff: src/effects/SkMorphologyImageFilter.cpp

Issue 1421493003: tunnel down texture-size-constraint to imagefilters (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 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
Index: src/effects/SkMorphologyImageFilter.cpp
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index 4e08d9dd733148b369105604461332dd09ce534e..9447a7347df6b7f131a91496cfc8b98af4691ea8 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -547,7 +547,8 @@ bool apply_morphology(const SkBitmap& input,
const SkIRect& rect,
GrMorphologyEffect::MorphologyType morphType,
SkISize radius,
- SkBitmap* dst) {
+ SkBitmap* dst,
+ GrTextureProvider::SizeConstraint constraint) {
SkAutoTUnref<GrTexture> srcTexture(SkRef(input.getTexture()));
SkASSERT(srcTexture);
GrContext* context = srcTexture->getContext();
@@ -565,7 +566,7 @@ bool apply_morphology(const SkBitmap& input,
SkIRect srcRect = rect;
if (radius.fWidth > 0) {
- GrTexture* scratch = context->textureProvider()->createApproxTexture(desc);
+ GrTexture* scratch = context->textureProvider()->createTexture(desc, constraint);
if (nullptr == scratch) {
return false;
}
@@ -589,7 +590,7 @@ bool apply_morphology(const SkBitmap& input,
srcRect = dstRect;
}
if (radius.fHeight > 0) {
- GrTexture* scratch = context->textureProvider()->createApproxTexture(desc);
+ GrTexture* scratch = context->textureProvider()->createTexture(desc, constraint);
if (nullptr == scratch) {
return false;
}
@@ -647,7 +648,8 @@ 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)) {
+ if (!apply_morphology(input, srcBounds, type, SkISize::Make(width, height), result,
+ proxy->getSizeConstraint())) {
return false;
}
offset->fX = bounds.left();

Powered by Google App Engine
This is Rietveld 408576698