Merge "Attach color space after performing a readback" into pi-dev

This commit is contained in:
Leon Scroggins
2018-04-24 20:01:22 +00:00
committed by Android (Google) Code Review

View File

@@ -296,6 +296,11 @@ void Bitmap::getSkBitmap(SkBitmap* outBitmap) {
outBitmap->allocPixels(info());
}
uirenderer::renderthread::RenderProxy::copyGraphicBufferInto(graphicBuffer(), outBitmap);
if (mInfo.colorSpace()) {
sk_sp<SkPixelRef> pixelRef = sk_ref_sp(outBitmap->pixelRef());
outBitmap->setInfo(mInfo);
outBitmap->setPixelRef(std::move(pixelRef), 0, 0);
}
return;
}
outBitmap->setInfo(mInfo, rowBytes());