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

Unified Diff: cc/output/gl_renderer.cc

Issue 14883004: cc: Use SkPMColor consistently on readback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change GLRenderer to also emit SkPMColor Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/output/software_renderer_unittest.cc » ('j') | cc/output/software_renderer_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/gl_renderer.cc
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index 5577aa4e26b16857c3a466c5a977eb02a52671a1..65e8ede21c258283ae3ae09420f48209ea2d934f 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -2194,12 +2194,12 @@ void GLRenderer::FinishedReadback(
for (size_t dest_y = 0; dest_y < total_bytes; dest_y += row_bytes) {
// Flip Y axis.
size_t src_y = total_bytes - dest_y - row_bytes;
- // Swizzle BGRA -> RGBA.
+ // Swizzle OpenGL -> Skia byte order.
danakj 2013/05/08 17:38:43 So, am I right in understanding this won't change
for (size_t x = 0; x < row_bytes; x += 4) {
- dest_pixels[dest_y + (x + 0)] = src_pixels[src_y + (x + 2)];
- dest_pixels[dest_y + (x + 1)] = src_pixels[src_y + (x + 1)];
- dest_pixels[dest_y + (x + 2)] = src_pixels[src_y + (x + 0)];
- dest_pixels[dest_y + (x + 3)] = src_pixels[src_y + (x + 3)];
+ dest_pixels[dest_y + x + SK_R32_SHIFT/8] = src_pixels[src_y + x + 0];
+ dest_pixels[dest_y + x + SK_G32_SHIFT/8] = src_pixels[src_y + x + 1];
+ dest_pixels[dest_y + x + SK_B32_SHIFT/8] = src_pixels[src_y + x + 2];
+ dest_pixels[dest_y + x + SK_A32_SHIFT/8] = src_pixels[src_y + x + 3];
}
}
« no previous file with comments | « no previous file | cc/output/software_renderer_unittest.cc » ('j') | cc/output/software_renderer_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698