RESOLVED FIXED Bug 111333
[EFL] Ensure right format is used in SnapshotImageGL.
https://bugs.webkit.org/show_bug.cgi?id=111333
Summary [EFL] Ensure right format is used in SnapshotImageGL.
Kalyan
Reported 2013-03-04 08:24:58 PST
In SnapshotImageGL we use GL_BGRA as the format with glReadPixels. This is not the standard format on OpenGLES2.0. With GLES we should use GL_RGBA as the format and convert the result to BGRA.
Attachments
patch (1.97 KB, patch)
2013-03-04 09:58 PST, Kalyan
no flags
patchv2 (1.96 KB, patch)
2013-03-04 15:37 PST, Kalyan
benjamin: review-
patchv3 (1.83 KB, patch)
2013-03-05 18:16 PST, Kalyan
no flags
Kalyan
Comment 1 2013-03-04 09:58:05 PST
Kenneth Rohde Christiansen
Comment 2 2013-03-04 10:39:22 PST
Comment on attachment 191264 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=191264&action=review > Source/WebKit2/UIProcess/API/efl/SnapshotImageGL.cpp:60 > + > + for (int i = 0; i < totalBytes; i += 4) > + std::swap(buf[i], buf[i + 2]); why this indentation?
Kalyan
Comment 3 2013-03-04 15:37:38 PST
Kalyan
Comment 4 2013-03-04 15:38:54 PST
(In reply to comment #2) > (From update of attachment 191264 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=191264&action=review > > > + std::swap(buf[i], buf[i + 2]); > > why this indentation? oops, fixed it now.
Benjamin Poulain
Comment 5 2013-03-05 17:10:38 PST
Comment on attachment 191328 [details] patchv2 View in context: https://bugs.webkit.org/attachment.cgi?id=191328&action=review > Source/WebKit2/UIProcess/API/efl/SnapshotImageGL.cpp:62 > +#if USE(OPENGL_ES_2) > + // Convert to BGRA. > + int totalBytes = width * height * 4; > + > + for (int i = 0; i < totalBytes; i += 4) > + std::swap(buf[i], buf[i + 2]); > +#endif > + It is hard to believe you must do something so inefficient. :( Here: std::swap(buf[i], buf[i + 2]); You swap to 32bits pixels, not 2 * 8 bits component.
Kalyan
Comment 6 2013-03-05 18:16:51 PST
Kalyan
Comment 7 2013-03-05 18:19:11 PST
(In reply to comment #5) > (From update of attachment 191328 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=191328&action=review > It is hard to believe you must do something so inefficient. :( > > Here: std::swap(buf[i], buf[i + 2]); > You swap to 32bits pixels, not 2 * 8 bits component. Thanks for highlighting this. Fixed it now.
WebKit Review Bot
Comment 8 2013-03-05 23:39:14 PST
Comment on attachment 191629 [details] patchv3 Clearing flags on attachment: 191629 Committed r144887: <http://trac.webkit.org/changeset/144887>
WebKit Review Bot
Comment 9 2013-03-05 23:39:18 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.