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

Issue 14883004: cc: Use SkPMColor consistently on readback. (Closed)

Created:
7 years, 7 months ago by aelias_OOO_until_Jul13
Modified:
7 years, 7 months ago
Reviewers:
danakj
CC:
chromium-reviews, cc-bugs_chromium.org, slavi
Visibility:
Public.

Description

cc: Use SkPMColor consistently on readback. There are three pixel formats used in Chromium: - SkColor (non-premultiplied, BGRA) - SkPMColor (premultiplied, BGRA on desktop and RGBA on Android) - OpenGL (on readback, premultiplied and RBGA -- in textures, same as SkPMColor) Raw pixels inside SkBitmaps are of type SkPMColor, not SkColor. This patch fixes two cases that cause inconsistencies on Android: 1. SkColor was used in bitmaps in SoftwareRendererTest. Use Skia methods instead of raw pixels in the test so that the correct format is used automatically. 2. GLRenderer's readback also swizzled consistently to BGRA instead of considering the Skia settings; switch that to use the platform's SkPMColor definition instead. This is a no-op change on non-Android. NOTRY=true BUG=154528 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=199043

Patch Set 1 #

Patch Set 2 : Premultiply #

Patch Set 3 : Switch to type SkPMColor #

Patch Set 4 : Change GLRenderer to also emit SkPMColor #

Total comments: 2

Patch Set 5 : Use SkBitmap in SoftwareRendererTest instead of doing raw pixel manipulation #

Unified diffs Side-by-side diffs Delta from patch set Stats (+61 lines, -55 lines) Patch
M cc/output/gl_renderer.cc View 1 2 3 1 chunk +5 lines, -5 lines 0 comments Download
M cc/output/software_renderer_unittest.cc View 1 2 3 4 6 chunks +56 lines, -50 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
aelias_OOO_until_Jul13
PTAL. If you are curious, the nature of the "luck" that was causing the two ...
7 years, 7 months ago (2013-05-08 06:08:31 UTC) #1
danakj
Interesting! However, this means that GetFramebufferPixels() returns different data with the software renderer than with ...
7 years, 7 months ago (2013-05-08 14:17:21 UTC) #2
aelias_OOO_until_Jul13
On 2013/05/08 14:17:21, danakj wrote: > Interesting! However, this means that GetFramebufferPixels() returns different > ...
7 years, 7 months ago (2013-05-08 15:51:13 UTC) #3
aelias_OOO_until_Jul13
PTAL. What I changed was to make the GLRenderer swizzle according to the current Skia ...
7 years, 7 months ago (2013-05-08 17:26:27 UTC) #4
danakj
https://codereview.chromium.org/14883004/diff/15001/cc/output/gl_renderer.cc File cc/output/gl_renderer.cc (right): https://codereview.chromium.org/14883004/diff/15001/cc/output/gl_renderer.cc#newcode2197 cc/output/gl_renderer.cc:2197: // Swizzle OpenGL -> Skia byte order. So, am ...
7 years, 7 months ago (2013-05-08 17:38:43 UTC) #5
aelias_OOO_until_Jul13
On 2013/05/08 17:38:43, danakj wrote: > cc/output/gl_renderer.cc:2197: // Swizzle OpenGL -> Skia byte order. > ...
7 years, 7 months ago (2013-05-08 18:02:11 UTC) #6
danakj
Mmmh, okay thanks for the explanation. LGTM
7 years, 7 months ago (2013-05-08 18:03:01 UTC) #7
aelias_OOO_until_Jul13
As a further cleanup, I changed SoftwareRendererTest to avoid raw pixel manipulation entirely as the ...
7 years, 7 months ago (2013-05-08 18:33:53 UTC) #8
danakj
Oh nice, thanks!
7 years, 7 months ago (2013-05-08 18:35:17 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/aelias@chromium.org/14883004/25001
7 years, 7 months ago (2013-05-08 22:49:18 UTC) #10
commit-bot: I haz the power
7 years, 7 months ago (2013-05-08 23:07:00 UTC) #11
Message was sent while issue was closed.
Change committed as 199043

Powered by Google App Engine
This is Rietveld 408576698