diff options
author | 2016-09-22 07:15:37 -0700 | |
---|---|---|
committer | 2016-09-22 07:15:37 -0700 | |
commit | 2a75e5df300a2838f943ca52a52a85a5cf69802b (patch) | |
tree | ef64ee5043762606de08fde3da60b39777c3bc22 /src/core/SkImageFilter.cpp | |
parent | 4be0e7cfe0efceeaf4c7a4d598d77c27cfd3e69b (diff) |
Add output format properties to SkImageFilter::Context
For now, this is just the color space (of the original
requesting device). This is used when constructing
intermediate rendering surfaces, so that we ensure we
land in a surface that's similar/compatible to the
final consumer of the DAG's output.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2357273002
Review-Url: https://codereview.chromium.org/2357273002
Diffstat (limited to 'src/core/SkImageFilter.cpp')
-rw-r--r-- | src/core/SkImageFilter.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp index 64b62759e2..9ec6f2c28f 100644 --- a/src/core/SkImageFilter.cpp +++ b/src/core/SkImageFilter.cpp @@ -278,11 +278,12 @@ bool SkImageFilter::canComputeFastBounds() const { sk_sp<SkSpecialImage> SkImageFilter::DrawWithFP(GrContext* context, sk_sp<GrFragmentProcessor> fp, const SkIRect& bounds, - sk_sp<SkColorSpace> colorSpace) { + const OutputProperties& outputProperties) { GrPaint paint; paint.addColorFragmentProcessor(std::move(fp)); paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); + sk_sp<SkColorSpace> colorSpace = sk_ref_sp(outputProperties.colorSpace()); GrPixelConfig config = GrRenderableConfigForColorSpace(colorSpace.get()); sk_sp<GrDrawContext> drawContext(context->makeDrawContext(SkBackingFit::kApprox, bounds.width(), bounds.height(), @@ -416,7 +417,7 @@ SkIRect SkImageFilter::onFilterNodeBounds(const SkIRect& src, const SkMatrix&, M SkImageFilter::Context SkImageFilter::mapContext(const Context& ctx) const { SkIRect clipBounds = this->onFilterNodeBounds(ctx.clipBounds(), ctx.ctm(), MapDirection::kReverse_MapDirection); - return Context(ctx.ctm(), clipBounds, ctx.cache()); + return Context(ctx.ctm(), clipBounds, ctx.cache(), ctx.outputProperties()); } sk_sp<SkImageFilter> SkImageFilter::MakeMatrixFilter(const SkMatrix& matrix, |