Add SkColorSpace to Picture.toImage() (flutter/engine#3691)

Skia doesn't actually create the image if we don't supply a color space.
This commit is contained in:
Adam Barth 2017-05-13 10:33:04 -07:00 committed by GitHub
parent 1cc1f25bbf
commit 5366eb0eb7

View File

@ -40,7 +40,7 @@ ftl::RefPtr<CanvasImage> 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;
}