Bug 43858

Summary: Add support for BGRA pixel formats to GraphicsContext3D
Product: WebKit Reporter: Stephen White <senorblanco>
Component: New BugsAssignee: Stephen White <senorblanco>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, commit-queue, dglazkov, eric, fishd, jamesr, levin, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Bug Depends on: 43896    
Bug Blocks: 43804    
Attachments:
Description Flags
Patch
none
Patch none

Description Stephen White 2010-08-11 09:32:28 PDT
Add support for BGRA pixel formats to GraphicsContext3D
Comment 1 Stephen White 2010-08-11 09:36:56 PDT
Created attachment 64127 [details]
Patch
Comment 2 James Robinson 2010-08-11 10:19:49 PDT
Comment on attachment 64127 [details]
Patch

> +    // FIXME:  This should be made pure virtual, once the chrome side change
> +    // has landed.
> +    virtual bool supportsBGRA() { return true; }

Land the chrome side (implementation) first and you won't have to do this.  You'll temporarily have an uncallable function definition in chromium land, but that's OK.

I think this looks fine.
Comment 3 Stephen White 2010-08-11 15:52:33 PDT
(In reply to comment #2)
> (From update of attachment 64127 [details])
> > +    // FIXME:  This should be made pure virtual, once the chrome side change
> > +    // has landed.
> > +    virtual bool supportsBGRA() { return true; }
> 
> Land the chrome side (implementation) first and you won't have to do this.  You'll temporarily have an uncallable function definition in chromium land, but that's OK.

Good idea.  Done.
Comment 4 Stephen White 2010-08-11 15:54:11 PDT
Created attachment 64172 [details]
Patch
Comment 5 James Robinson 2010-08-11 16:03:43 PDT
I think you need implementations in GraphicsContext3DQt.cpp and GraphicsContext3DMac.mm or the builds on those platforms will break.  Otherwise, this looks good to me.
Comment 6 Stephen White 2010-08-11 16:08:46 PDT
(In reply to comment #5)
> I think you need implementations in GraphicsContext3DQt.cpp and GraphicsContext3DMac.mm or the builds on those platforms will break.  Otherwise, this looks good to me.

There's an implementation in GraphicsContext3D.cpp for !PLATFORM(CHROMIUM).
Comment 7 David Levin 2010-08-11 16:24:34 PDT
Comment on attachment 64172 [details]
Patch

r=me (I'm not setting r+ so that the ews bots will still run your patch through them, but consider this to be r+ by me).


Please make sure to rev DEPS (WebKit/chromium/DEPS) to pick up the necessary chromium change.

> Index: WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
> +bool WebGraphicsContext3DDefaultImpl::supportsBGRA()
> +{
> +    // Supported since OpenGL 1.2.  However, glTexImage2D() must be modified
> +    // to translate the internalFormat from GL_BGRA to GL_RGBA, since the
> +    // former is not accepted by desktop GL.  Return false until this is done.

nit: WebKit uses single spaces after "."
Comment 8 James Robinson 2010-08-11 22:53:45 PDT
Comment on attachment 64172 [details]
Patch

Chromium side's landed, flipping cq bit.
Comment 9 WebKit Commit Bot 2010-08-12 00:00:59 PDT
Comment on attachment 64172 [details]
Patch

Clearing flags on attachment: 64172

Committed r65221: <http://trac.webkit.org/changeset/65221>
Comment 10 WebKit Commit Bot 2010-08-12 00:01:04 PDT
All reviewed patches have been landed.  Closing bug.
Comment 11 David Levin 2010-08-12 00:15:09 PDT
This broke the snow leopard release build. Within minutes after it was submitted, this was noticeable.
Comment 12 David Levin 2010-08-12 00:28:46 PDT
(In reply to comment #11)
> This broke the snow leopard release build. Within minutes after it was submitted, this was noticeable.

As jamesr pointed out, this is due to a missing return value here:
819 #if !PLATFORM(CHROMIUM)
 820 GraphicsContext3D::supportsBGRA()

Also, please consider fixing:
> Index: WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
> +bool WebGraphicsContext3DDefaultImpl::supportsBGRA()
> +{
> +    // Supported since OpenGL 1.2.  However, glTexImage2D() must be modified
> +    // to translate the internalFormat from GL_BGRA to GL_RGBA, since the
> +    // former is not accepted by desktop GL.  Return false until this is done.

nit: WebKit uses single spaces after "."

r=me with these addressed (mostly the build break but the spaces issue would be nice).
Comment 13 Stephen White 2010-08-12 08:27:18 PDT
Committed r65247: <http://trac.webkit.org/changeset/65247>
Comment 14 WebKit Review Bot 2010-08-12 11:15:09 PDT
http://trac.webkit.org/changeset/65247 might have broken Leopard Intel Debug (Tests)