diff options
author | Christopher Cameron <ccameron@chromium.org> | 2017-05-22 23:12:01 -0700 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-23 20:20:54 +0000 |
commit | 92eaad6d508aafa670b8409ea697ff605ec4306a (patch) | |
tree | 917da340994ff156c351d255f84250302ebd5220 | |
parent | ee92f131b8bb96c8608358799b380f8b8bbf26ec (diff) |
Make SkPictureImageFilter::drawPictureAtLocalResolution use color xform
This creates a temporary SkCanvas, which needs to be wrapped in a color
xform canvas to behave appropriately.
bug:725372
Change-Id: I572437770f271b7fb813519c0966cd3177b9eeaf
Reviewed-on: https://skia-review.googlesource.com/17658
Reviewed-by: Matt Sarett <msarett@google.com>
Reviewed-by: Christopher Cameron <ccameron@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
-rw-r--r-- | src/effects/SkPictureImageFilter.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/effects/SkPictureImageFilter.cpp b/src/effects/SkPictureImageFilter.cpp index 12ec3c2b36..3c59e5e109 100644 --- a/src/effects/SkPictureImageFilter.cpp +++ b/src/effects/SkPictureImageFilter.cpp @@ -193,7 +193,14 @@ void SkPictureImageFilter::drawPictureAtLocalResolution(SkSpecialImage* source, SkCanvas* localCanvas = localSurface->getCanvas(); SkASSERT(localCanvas); - + std::unique_ptr<SkCanvas> xformCanvas = nullptr; + if (fColorSpace) { + // Only non-null in the case where onMakeColorSpace() was called. This instructs + // us to do the color space xform on playback. + xformCanvas = SkCreateColorSpaceXformCanvas(localCanvas, fColorSpace); + localCanvas = xformCanvas.get(); + } + localCanvas->clear(0x0); localCanvas->translate(-SkIntToScalar(localIBounds.fLeft), |