From da286e5a45ec67b693929012d52625d957148233 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Thu, 11 Oct 2018 15:14:07 -0400 Subject: [PATCH] Stop using color space xform canvas in picture image generator Guarded for Chrome to deal with layout tests. Bug: skia: Change-Id: I17fa1449b61a46835a8026aeb37dc8b4ecf15c6f Reviewed-on: https://skia-review.googlesource.com/c/161621 Reviewed-by: Mike Klein Commit-Queue: Brian Osman --- src/core/SkPictureImageGenerator.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/SkPictureImageGenerator.cpp b/src/core/SkPictureImageGenerator.cpp index 287d564c43..fa55538971 100644 --- a/src/core/SkPictureImageGenerator.cpp +++ b/src/core/SkPictureImageGenerator.cpp @@ -53,7 +53,11 @@ SkPictureImageGenerator::SkPictureImageGenerator(const SkImageInfo& info, sk_sp< bool SkPictureImageGenerator::onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, const Options& opts) { // TODO: Stop using xform canvas and simplify this code once rasterization works the same way +#ifdef SK_LEGACY_XFORM_CANVAS_IN_PICTURE_IMAGES bool useXformCanvas = /* kIgnore == behavior && */ info.colorSpace(); +#else + bool useXformCanvas = false; +#endif SkSurfaceProps props(0, kUnknown_SkPixelGeometry); SkImageInfo canvasInfo = useXformCanvas ? info.makeColorSpace(nullptr) : info; @@ -98,7 +102,11 @@ sk_sp SkPictureImageGenerator::onGenerateTexture( GrContext* ctx, const SkImageInfo& info, const SkIPoint& origin, bool willNeedMipMaps) { SkASSERT(ctx); // TODO: Stop using xform canvas and simplify this code once rasterization works the same way +#ifdef SK_LEGACY_XFORM_CANVAS_IN_PICTURE_IMAGES bool useXformCanvas = /* behavior == kIgnore && */ info.colorSpace(); +#else + bool useXformCanvas = false; +#endif // // TODO: respect the usage, by possibly creating a different (pow2) surface