Bug 36737 - Eliminate use of GL_BGRA in GraphicsContext3DSkia.cpp
Summary: Eliminate use of GL_BGRA in GraphicsContext3DSkia.cpp
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Kenneth Russell
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-28 19:34 PDT by Kenneth Russell
Modified: 2010-03-29 11:28 PDT (History)
4 users (show)

See Also:


Attachments
Patch (1.87 KB, patch)
2010-03-28 19:39 PDT, Kenneth Russell
fishd: review+
kbr: commit-queue-
Details | Formatted Diff | Diff
Revised patch (1.99 KB, patch)
2010-03-29 10:41 PDT, Kenneth Russell
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth Russell 2010-03-28 19:34:21 PDT
GraphicsContext3DSkia.cpp currently assumes it is running on desktop GL and uses the GL_BGRA format, which is not part of OpenGL ES 2.0. This code should swizzle the red and blue channels manually and use the GL_RGBA format.
Comment 1 Kenneth Russell 2010-03-28 19:39:04 PDT
Created attachment 51874 [details]
Patch
Comment 2 WebKit Review Bot 2010-03-29 00:02:12 PDT
Attachment 51874 [details] did not pass style-queue:

Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1
WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp:31:  Found other header before a header this file implements. Should be: config.h, primary header, blank line, and then alphabetically sorted.  [build/include_order] [4]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Darin Fisher (:fishd, Google) 2010-03-29 08:36:52 PDT
Comment on attachment 51874 [details]
Patch

> Index: WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp
> +    // FIXME: add GL_BGRA extension support
> +    for (int i = 0; i < size; i += 4)
> +        std::swap(outputVector[i], outputVector[i + 2]);
> +    *format = RGBA;
>      return true;
>  }

^^^ it would be nice to add a comment above the loop explaining
that you are converting from BGRA to RGBA.

r=me with such a comment
Comment 4 Kenneth Russell 2010-03-29 10:41:00 PDT
Created attachment 51928 [details]
Revised patch

Revised patch addressing review feedback and style issue.
Comment 5 Kenneth Russell 2010-03-29 11:28:30 PDT
Comment on attachment 51928 [details]
Revised patch

Clearing flags on attachment: 51928

Committed r56735: <http://trac.webkit.org/changeset/56735>
Comment 6 Kenneth Russell 2010-03-29 11:28:35 PDT
All reviewed patches have been landed.  Closing bug.