[Webkit-unassigned] [Bug 137793] Calling glReadPixels with BGRA format on an NVIDIA machine with an opaque context returns the wrong alpha values.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 17 11:38:42 PDT 2014


https://bugs.webkit.org/show_bug.cgi?id=137793

--- Comment #8 from Dean Jackson <dino at apple.com> ---
Comment on attachment 240001
  --> https://bugs.webkit.org/attachment.cgi?id=240001
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=240001&action=review

> Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:72
> +        ::glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, pixels);
> +        int totalBytes = width * height * 4;
> +        for (int i = 0; i < totalBytes; i += 4)

e.g.
vImage_Buffer src;
src.height = height;
src.width = width;
src.rowBytes = srcBytesPerRow;
src.data = srcRows;

vImage_Buffer dest;
dest.height = height;
dest.width = width;
dest.rowBytes = destBytesPerRow;
dest.data = destRows;

// Swap pixel channels from BGRA to RGBA.
const uint8_t map[4] = { 2, 1, 0, 3 };
vImagePermuteChannels_ARGB8888(&src, &dest, map, kvImageNoFlags);

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20141017/6abfac6c/attachment-0002.html>


More information about the webkit-unassigned mailing list