From 5366eb0eb72ea05d964fe8d227aeaf3e1b122e5e Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Sat, 13 May 2017 10:33:04 -0700 Subject: [PATCH] Add SkColorSpace to Picture.toImage() (flutter/engine#3691) Skia doesn't actually create the image if we don't supply a color space. --- engine/src/flutter/lib/ui/painting/picture.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/src/flutter/lib/ui/painting/picture.cc b/engine/src/flutter/lib/ui/painting/picture.cc index a63970dadf4..aaeb31a4ff5 100644 --- a/engine/src/flutter/lib/ui/painting/picture.cc +++ b/engine/src/flutter/lib/ui/painting/picture.cc @@ -40,7 +40,7 @@ ftl::RefPtr Picture::toImage(int width, int height) { // TODO(abarth): We should pass in an SkColorSpace at some point. image->set_image( SkImage::MakeFromPicture(picture_, SkISize::Make(width, height), nullptr, - nullptr, SkImage::BitDepth::kU8, nullptr)); + nullptr, SkImage::BitDepth::kU8, SkColorSpace::MakeSRGB())); return image; }