Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Issue 1786813002: Fix BGRA/RGBA readback conversions on mac (Closed)

Created:
4 years, 9 months ago by ericrk
Modified:
4 years, 9 months ago
Reviewers:
bsalomon, reed1
CC:
reviews_skia.org
Base URL:
https://chromium.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Fix BGRA/RGBA readback conversions on mac Reading back from a BGRA framebuffer as RGBA or vis-versa is slow on mac. On my early 2013 MBP, we see a 40% regression when using the discrete GPU or a 13% regression on integrated. This change adds a workaround which causes Mac to use the existing Mesa path and prefer readback from the same format as the framebuffer. BUG=581311 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1786813002 Committed: https://skia.googlesource.com/skia/+/b4ecabd5a2c359f66a20207ffb02a77e624560c4

Patch Set 1 : #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -1 line) Patch
M src/gpu/gl/GrGLCaps.h View 2 chunks +4 lines, -0 lines 0 comments Download
M src/gpu/gl/GrGLCaps.cpp View 3 chunks +13 lines, -0 lines 0 comments Download
M src/gpu/gl/GrGLGpu.cpp View 1 chunk +1 line, -1 line 1 comment Download

Messages

Total messages: 13 (7 generated)
ericrk
4 years, 9 months ago (2016-03-11 20:58:05 UTC) #5
bsalomon
lgtm
4 years, 9 months ago (2016-03-11 22:56:53 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1786813002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1786813002/20001
4 years, 9 months ago (2016-03-11 23:05:05 UTC) #8
commit-bot: I haz the power
Committed patchset #1 (id:20001) as https://skia.googlesource.com/skia/+/b4ecabd5a2c359f66a20207ffb02a77e624560c4
4 years, 9 months ago (2016-03-11 23:18:24 UTC) #10
reed1
Is it interesting to write a bench for this, at least to document/point-to the motivation ...
4 years, 9 months ago (2016-03-12 11:06:36 UTC) #12
ericrk
4 years, 9 months ago (2016-03-14 16:55:10 UTC) #13
Message was sent while issue was closed.
On 2016/03/12 11:06:36, reed1 wrote:
> Is it interesting to write a bench for this, at least to document/point-to the
> motivation for the checks? I'm thinking of mesa and mac.
> 
> aside: I wonder how often this actually happens, that on a mac someone would
be
> using bgra.
> 
> https://codereview.chromium.org/1786813002/diff/20001/src/gpu/gl/GrGLGpu.cpp
> File src/gpu/gl/GrGLGpu.cpp (right):
> 
>
https://codereview.chromium.org/1786813002/diff/20001/src/gpu/gl/GrGLGpu.cpp#...
> src/gpu/gl/GrGLGpu.cpp:2567: // Mesa 3D takes a slow path on when reading back
> BGRA from an RGBA surface and vice-versa.
> Possibly we should update the comment to refer to the flag, rather than Mesa
> explicitly?

Good points, thanks!

I'll put together a follow up patch to add a bench and fix the comment.

As far as how often this happens - Chrome defaults to BGRA on desktop platforms,
so we definitely use a lot of BGRA resources on mac. This investigation was
prompted due to a canvas readback regression - canvas readback is RGBA, which
was causing us to hit the BGRA > RGBA path during any readback.

Powered by Google App Engine
This is Rietveld 408576698