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>
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),