webgl: Use correct format for exported low latency canvas resource.
SkiaRenderer is strict about ensuring that the resource format passed in to the display compositor via TransferableResource, which is used to create the GrSurfaceProxy, matches the underlying SharedImageBacking's format which is the GrSurfaceBackend. In the context of DrawingBuffer this means that for low latency mode, the ExternalCanvasResource must have the same format as the shared image or swap chain. One problematic case is RGBA8 vs BGRA8 because the default CanvasColorParams() used when creating the resource uses the platform specific default for Skia, which is based on endianness, to determine the format passed to the display compositor. To solve this problem, this CL adds the shared image resource format to ColorBuffer, and makes it the source of truth for all places that need the format in DrawingBuffer. In particular, the CanvasColorParams is constructed to match the underlying resource format instead of relying on the defaults. Bug: 1122638 Change-Id: I8c4e93d7f08566e695a3948505f98541d55b7216 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2391410 Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org> Reviewed-by:Kenneth Russell <kbr@chromium.org> Reviewed-by:
Kai Ninomiya <kainino@chromium.org> Reviewed-by:
Zhenyao Mo <zmo@chromium.org> Cr-Commit-Position: refs/heads/master@{#805027}
Showing
Please register or sign in to comment