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

Unified Diff: src/effects/SkLightingImageFilter.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/SkDisplacementMapEffect.cpp ('k') | src/effects/SkMagnifierImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkLightingImageFilter.cpp
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index 3485bd867ced0ee6795736a09f1208cec3d3b43c..138ba8bdc430dfb0649988e847e9148520855bfe 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -360,7 +360,8 @@ protected:
sk_sp<SkSpecialImage> filterImageGPU(SkSpecialImage* source,
SkSpecialImage* input,
const SkIRect& bounds,
- const SkMatrix& matrix) const;
+ const SkMatrix& matrix,
+ const OutputProperties& outputProperties) const;
virtual sk_sp<GrFragmentProcessor> makeFragmentProcessor(GrTexture*,
const SkMatrix&,
const SkIRect* srcBounds,
@@ -399,10 +400,12 @@ void SkLightingImageFilterInternal::drawRect(GrDrawContext* drawContext,
drawContext->fillRectToRect(clip, paint, SkMatrix::I(), dstRect, srcRect);
}
-sk_sp<SkSpecialImage> SkLightingImageFilterInternal::filterImageGPU(SkSpecialImage* source,
- SkSpecialImage* input,
- const SkIRect& offsetBounds,
- const SkMatrix& matrix) const {
+sk_sp<SkSpecialImage> SkLightingImageFilterInternal::filterImageGPU(
+ SkSpecialImage* source,
+ SkSpecialImage* input,
+ const SkIRect& offsetBounds,
+ const SkMatrix& matrix,
+ const OutputProperties& outputProperties) const {
SkASSERT(source->isTextureBacked());
GrContext* context = source->getContext();
@@ -412,8 +415,8 @@ sk_sp<SkSpecialImage> SkLightingImageFilterInternal::filterImageGPU(SkSpecialIma
sk_sp<GrDrawContext> drawContext(
context->makeDrawContext(SkBackingFit::kApprox,offsetBounds.width(), offsetBounds.height(),
- GrRenderableConfigForColorSpace(source->getColorSpace()),
- sk_ref_sp(source->getColorSpace())));
+ GrRenderableConfigForColorSpace(outputProperties.colorSpace()),
+ sk_ref_sp(outputProperties.colorSpace())));
if (!drawContext) {
return nullptr;
}
@@ -1260,7 +1263,7 @@ sk_sp<SkSpecialImage> SkDiffuseLightingImageFilter::onFilterImage(SkSpecialImage
SkMatrix matrix(ctx.ctm());
matrix.postTranslate(SkIntToScalar(-offset->fX), SkIntToScalar(-offset->fY));
- return this->filterImageGPU(source, input.get(), bounds, matrix);
+ return this->filterImageGPU(source, input.get(), bounds, matrix, ctx.outputProperties());
}
#endif
@@ -1425,7 +1428,7 @@ sk_sp<SkSpecialImage> SkSpecularLightingImageFilter::onFilterImage(SkSpecialImag
SkMatrix matrix(ctx.ctm());
matrix.postTranslate(SkIntToScalar(-offset->fX), SkIntToScalar(-offset->fY));
- return this->filterImageGPU(source, input.get(), bounds, matrix);
+ return this->filterImageGPU(source, input.get(), bounds, matrix, ctx.outputProperties());
}
#endif
« no previous file with comments | « src/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/SkMagnifierImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698