
IsAccelerated for OffscreenCanvas always returned false. That's because IsAccelerated is implemented using GetRasterMode [1], and GetRasterMode early aborts if preferred_2d_raster_mode() is kPreferCPU. This however is the default value and the preferred raster mode is only ever set for HTMLCanvasElement. Thus, for OffscreenCanvas, GetRasterMode() always returns kCPU. This CL removes the early abort in GetRasterMode, which should be a safe since the check on preferred_2d_raster_mode() is repeated a second time below, in ShouldTryToUseGpuRaster(). [1]: https://crsrc.org/c/third_party/blink/renderer/modules/canvas/canvas2d/canvas_2d_recorder_context.cc;l=2942;drc=e08e8c85cbaa594c61e0235319dcc08b1ed3560e [2]: https://crsrc.org/c/third_party/blink/renderer/platform/graphics/canvas_resource_host.cc;l=101;drc=e08e8c85cbaa594c61e0235319dcc08b1ed3560e Fixed: 403282523 Change-Id: I2ed4816edd4fc711f1a41174ab6b2bcdbd7666b9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6355067 Reviewed-by: Colin Blundell <blundell@chromium.org> Commit-Queue: Jean-Philippe Gravel <jpgravel@chromium.org> Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org> Cr-Commit-Position: refs/heads/main@{#1433880}
The third_party directory contains sources from other projects.
For guidelines on adding a new package to the third_party directory can be found at //docs/adding_to_third_party.md