Reland "Use skia.mojom.BitmapN32 in Detection mojoms"
This is a reland of c7326b7f Canvases may have different color formats than N32, and when we pull the content of them into a cpu bitmap through SkImage::toLegacyBitmap() we need to convert that to N32 format if we're going to send the bitmap over IPC due to security restrictions of the BitmapN32 mojom type. This does that conversion in the blink ShapeDetector and adds a test with a float16 color format canvas which would cause the IPC sending to be dropped (and the renderer to crash). TBR=dcheng Original change's description: > Use skia.mojom.BitmapN32 in Detection mojoms > > These bitmaps are safer for transport from untrustworthy sources since > all bitmaps should be in N32 format and the browser can make bad > assumptions as a result. > > R=dcheng@chromium.org, reillyg@chromium.org > > Bug: 1144462 > Change-Id: I7d02cb187c62be37259f445a182f8c971aa03661 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2580483 > Commit-Queue: danakj <danakj@chromium.org> > Reviewed-by: Reilly Grant <reillyg@chromium.org> > Reviewed-by: Daniel Cheng <dcheng@chromium.org> > Cr-Commit-Position: refs/heads/master@{#835685} Bug: 1144462 Change-Id: I23ef3df85049a7111830c5d272c02b69f9d7cd38 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2593827 Commit-Queue: danakj <danakj@chromium.org> Reviewed-by:Reilly Grant <reillyg@chromium.org> Cr-Commit-Position: refs/heads/master@{#837241}
Showing
Please register or sign in to comment