diff options
author | brianosman <brianosman@google.com> | 2016-09-22 07:15:37 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-22 07:15:37 -0700 |
commit | 2a75e5df300a2838f943ca52a52a85a5cf69802b (patch) | |
tree | ef64ee5043762606de08fde3da60b39777c3bc22 /src/pdf | |
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/pdf')
-rw-r--r-- | src/pdf/SkPDFDevice.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp index e79c915283..eed4992c6c 100644 --- a/src/pdf/SkPDFDevice.cpp +++ b/src/pdf/SkPDFDevice.cpp @@ -2288,7 +2288,10 @@ void SkPDFDevice::drawSpecial(const SkDraw& draw, SkSpecialImage* srcImg, int x, matrix.postTranslate(SkIntToScalar(-x), SkIntToScalar(-y)); const SkIRect clipBounds = draw.fRC->getBounds().makeOffset(-x, -y); SkAutoTUnref<SkImageFilterCache> cache(this->getImageFilterCache()); - SkImageFilter::Context ctx(matrix, clipBounds, cache.get()); + // TODO: Should PDF be operating in a specified color space? For now, run the filter + // in the same color space as the source (this is different from all other backends). + SkImageFilter::OutputProperties outputProperties(srcImg->getColorSpace()); + SkImageFilter::Context ctx(matrix, clipBounds, cache.get(), outputProperties); sk_sp<SkSpecialImage> resultImg(filter->filterImage(srcImg, ctx, &offset)); if (resultImg) { |