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

Unified Diff: src/effects/SkMorphologyImageFilter.cpp

Issue 2357273002: Add output format properties to SkImageFilter::Context (Closed)
Patch Set: Spelling Created 4 years, 3 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/SkMatrixConvolutionImageFilter.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 f6d400111c604a1c7384d01fd78b55753ca1aecd..b8d488423959ff6ea425cfe3b31b29c6846fcf31 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -469,14 +469,16 @@ static void apply_morphology_pass(GrDrawContext* drawContext,
}
}
-static sk_sp<SkSpecialImage> apply_morphology(GrContext* context,
- SkSpecialImage* input,
- const SkIRect& rect,
- GrMorphologyEffect::MorphologyType morphType,
- SkISize radius) {
+static sk_sp<SkSpecialImage> apply_morphology(
+ GrContext* context,
+ SkSpecialImage* input,
+ const SkIRect& rect,
+ GrMorphologyEffect::MorphologyType morphType,
+ SkISize radius,
+ const SkImageFilter::OutputProperties& outputProperties) {
sk_sp<GrTexture> srcTexture(input->asTextureRef(context));
SkASSERT(srcTexture);
- sk_sp<SkColorSpace> colorSpace = sk_ref_sp(input->getColorSpace());
+ sk_sp<SkColorSpace> colorSpace = sk_ref_sp(outputProperties.colorSpace());
GrPixelConfig config = GrRenderableConfigForColorSpace(colorSpace.get());
// setup new clip
@@ -571,7 +573,8 @@ sk_sp<SkSpecialImage> SkMorphologyImageFilter::onFilterImage(SkSpecialImage* sou
auto type = (kDilate_Op == this->op()) ? GrMorphologyEffect::kDilate_MorphologyType
: GrMorphologyEffect::kErode_MorphologyType;
sk_sp<SkSpecialImage> result(apply_morphology(context, input.get(), srcBounds, type,
- SkISize::Make(width, height)));
+ SkISize::Make(width, height),
+ ctx.outputProperties()));
if (result) {
offset->fX = bounds.left();
offset->fY = bounds.top();
« no previous file with comments | « src/effects/SkMatrixConvolutionImageFilter.cpp ('k') | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698