Canvas: Clean up ExtractImageData
This is towards deleting StaticBitmapImage::CopyToByteArray and other helpers. The function ExtractImageData: - Allocates a temporary surface with SkSurface::MakeRaster. - Draws the image into that surface. - Allocates output ArrayBufferContents. - Make a copy of the SkSurface's contents using SkSurface::makeImageSnapshot. - Copy the aforementioned copy to the output ArrayBufferContents using StaticBitmapImage::CopyToByteArray, which may do some sort of color conversion during the copy. Change the function to: - Allocate output ArrayBufferContents and point a surface directly at those pixels using SkSurface::MakeRasterDirect. - Draw into the pixels, converting to the desired format on the fly. Bug: 1115317 Change-Id: I656c1ed701c7bafade694d7dfad38dbb0bc74564 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2533289Reviewed-by:enne <enne@chromium.org> Commit-Queue: ccameron <ccameron@chromium.org> Cr-Commit-Position: refs/heads/master@{#827502}
Showing
Please register or sign in to comment