GLRenderer should try not to swizzle for SkBitmap copy requests |
|||
Issue descriptionWhen executing CopyOutputRequests that return SkBitmap results, there is some swizzle-to-native-Skia byte ordering code. However, it's very possible the OpenGL implementations on some (all?) platforms prefer the native Skia byte ordering anyway. How it works today (two swizzles on the CPU!): 1. glReadPixels(in GL_RGBA format). 2. GPU natively uses BGRA ordering, and so the GPU driver must swizzle to RGBA ordering. 3. Code in our GLRenderer then swizzles back to BGRA (what Skia needs). How it should work: 1. glReadPixels(in GL_BGRA_EXT format). 2. GPU natively uses BGRA ordering, and so the driver does NO swizzling. 3. Code in GLRenderer can do a straight memcpy() without swizzling too!
,
Oct 25 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/bab63555df3d1c31bfb96f14c8dae96ab773f65c commit bab63555df3d1c31bfb96f14c8dae96ab773f65c Author: Yuri Wiitala <miu@chromium.org> Date: Wed Oct 25 00:19:37 2017 GLRendererCopier: Use optimal readback format. Queries whether the GPU+driver internally use BGRA byte ordering and, if so, uses that for readback. Otherwise, use the standard RGBA byte order. This optimization prevents the need for extra memcpy/swizzling when CopyOutputRequests produce SkBitmap results. This change is also a prerequisite for a soon-upcoming change to add I420 format readback to CopyOutputRequests. Bug: 760351 , 770422 Change-Id: I718401750470241e4188dfee2406867fa7293899 Reviewed-on: https://chromium-review.googlesource.com/731869 Commit-Queue: Yuri Wiitala <miu@chromium.org> Reviewed-by: danakj <danakj@chromium.org> Cr-Commit-Position: refs/heads/master@{#511317} [modify] https://crrev.com/bab63555df3d1c31bfb96f14c8dae96ab773f65c/components/viz/service/display/gl_renderer_copier.cc [modify] https://crrev.com/bab63555df3d1c31bfb96f14c8dae96ab773f65c/components/viz/service/display/gl_renderer_copier.h [modify] https://crrev.com/bab63555df3d1c31bfb96f14c8dae96ab773f65c/components/viz/service/display/gl_renderer_copier_unittest.cc
,
Oct 25 2017
,
Feb 26 2018
|
|||
►
Sign in to add a comment |
|||
Comment 1 by bugdroid1@chromium.org
, Oct 2 2017