Bug 36737

Summary: Eliminate use of GL_BGRA in GraphicsContext3DSkia.cpp
Product: WebKit Reporter: Kenneth Russell <kbr>
Component: WebGLAssignee: Kenneth Russell <kbr>
Severity: Normal CC: dglazkov, fishd, webkit.review.bot, zmo
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Description Flags
fishd: review+, kbr: commit-queue-
Revised patch none

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]
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]

> 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.