Bug 50189 - [chromium] ContentLayerChromium shader should honor the platform Sk_x_SHIFT value instead of assuming BGRA color
Summary: [chromium] ContentLayerChromium shader should honor the platform Sk_x_SHIFT v...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Grace Kloba
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-29 16:40 PST by Grace Kloba
Modified: 2010-12-01 12:05 PST (History)
7 users (show)

See Also:


Attachments
patch (3.08 KB, patch)
2010-11-29 16:45 PST, Grace Kloba
no flags Details | Formatted Diff | Diff
Patch (3.04 KB, patch)
2010-11-29 17:28 PST, Grace Kloba
no flags Details | Formatted Diff | Diff
Patch (3.03 KB, patch)
2010-11-30 19:41 PST, Grace Kloba
kbr: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Grace Kloba 2010-11-29 16:40:43 PST
The shader in ContentLayerChromium assumes that color is in BGRA. It should honor the platform setting so that for the platform using RGBA, the color will be correct.
Comment 1 Grace Kloba 2010-11-29 16:45:25 PST
Created attachment 75082 [details]
patch
Comment 2 Kenneth Russell 2010-11-29 17:21:33 PST
Comment on attachment 75082 [details]
patch

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

The code change looks fine (though the duplicated shader is a little unfortunate) but the OOPS line about no new tests needs to be removed and the patch regenerated or the commit queue will reject it.

> WebCore/ChangeLog:8
> +        No new tests. (OOPS!)

This line needs to be deleted.
Comment 3 Grace Kloba 2010-11-29 17:28:07 PST
Created attachment 75088 [details]
Patch
Comment 4 Kenneth Russell 2010-11-29 17:29:26 PST
Comment on attachment 75088 [details]
Patch

Looks good.
Comment 5 Vangelis Kokkevis 2010-11-29 17:31:56 PST
Comment on attachment 75088 [details]
Patch

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

> WebCore/platform/graphics/chromium/ContentLayerChromium.cpp:97
> +    m_contentShaderProgram = createShaderProgram(m_context, vertexShaderString, SK_B32_SHIFT ? rgbaFragmentShaderString : bgraFragmentShaderString);

As far as I can tell from SkColorPriv.h SK_B32_SHIFT is always non-zero, regardless of little or big endian.  Did you mean to check SK_R32_SHIFT instead?
Comment 6 Grace Kloba 2010-11-29 17:40:31 PST
This is actually not for the big endian or little endian. In chrome/skia/config/SkUserConfig.h, it tries to set the packing to BGRA instead of the default RGBA. So if the platform uses SkUserConfig.h, it uses BGRA packing. If the platform doesn't use the SkUserConfig.h, it uses the default RGBA packing.

(In reply to comment #5)
> (From update of attachment 75088 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=75088&action=review
> 
> > WebCore/platform/graphics/chromium/ContentLayerChromium.cpp:97
> > +    m_contentShaderProgram = createShaderProgram(m_context, vertexShaderString, SK_B32_SHIFT ? rgbaFragmentShaderString : bgraFragmentShaderString);
> 
> As far as I can tell from SkColorPriv.h SK_B32_SHIFT is always non-zero, regardless of little or big endian.  Did you mean to check SK_R32_SHIFT instead?
Comment 7 Vangelis Kokkevis 2010-11-29 17:55:24 PST
(In reply to comment #6)
> This is actually not for the big endian or little endian. In chrome/skia/config/SkUserConfig.h, it tries to set the packing to BGRA instead of the default RGBA. So if the platform uses SkUserConfig.h, it uses BGRA packing. If the platform doesn't use the SkUserConfig.h, it uses the default RGBA packing.
> 

Ah, ok.  Makes sense. Thanks.

> (In reply to comment #5)
> > (From update of attachment 75088 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=75088&action=review
> > 
> > > WebCore/platform/graphics/chromium/ContentLayerChromium.cpp:97
> > > +    m_contentShaderProgram = createShaderProgram(m_context, vertexShaderString, SK_B32_SHIFT ? rgbaFragmentShaderString : bgraFragmentShaderString);
> > 
> > As far as I can tell from SkColorPriv.h SK_B32_SHIFT is always non-zero, regardless of little or big endian.  Did you mean to check SK_R32_SHIFT instead?
Comment 8 WebKit Commit Bot 2010-11-29 21:14:47 PST
The commit-queue encountered the following flaky tests while processing attachment 75088 [details]:

fast/workers/storage/use-same-database-in-page-and-workers.html
http/tests/appcache/foreign-fallback.html

Please file bugs against the tests.  These tests were authored by ap@webkit.org and dumi@chromium.org.  The commit-queue is continuing to process your patch.
Comment 9 WebKit Commit Bot 2010-11-29 23:27:00 PST
Comment on attachment 75088 [details]
Patch

Rejecting patch 75088 from commit-queue.

Failed to run "['./WebKitTools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=eseidel-cq-sl', 'build', '--no-clean', '--no-update', '--build-style=both']" exit_code: 2
Last 500 characters of output:
86_64 c++ com.apple.compilers.gcc.4_2
	CompileC /Projects/CommitQueue/WebKitBuild/WebCore.build/Debug/WebCore.build/Objects-normal/x86_64/IndentOutdentCommand.o /Projects/CommitQueue/WebCore/editing/IndentOutdentCommand.cpp normal x86_64 c++ com.apple.compilers.gcc.4_2
	CompileC /Projects/CommitQueue/WebKitBuild/WebCore.build/Debug/WebCore.build/Objects-normal/x86_64/ImageDocument.o /Projects/CommitQueue/WebCore/html/ImageDocument.cpp normal x86_64 c++ com.apple.compilers.gcc.4_2
(21 failures)


Full output: http://queues.webkit.org/results/6415104
Comment 10 Kenneth Russell 2010-11-30 10:37:30 PST
That build failure looks unrelated to this change. Trying again.
Comment 11 Grace Kloba 2010-11-30 17:37:51 PST
I do have a style change for this CL. If it is not committed yet, can I provide another patch?
Comment 12 Kenneth Russell 2010-11-30 18:10:17 PST
(In reply to comment #11)
> I do have a style change for this CL. If it is not committed yet, can I provide another patch?

Go ahead. It looks like the commit queue has not been running due to redness in the tree. I'll remove the cq+ and we can hope that the initial patch doesn't get landed; if it does, I'll deal with the merge by hand.
Comment 13 WebKit Commit Bot 2010-11-30 18:14:52 PST
The commit-queue encountered the following flaky tests while processing attachment 75088 [details]:

fast/workers/storage/use-same-database-in-page-and-workers.html

Please file bugs against the tests.  These tests were authored by dumi@chromium.org.  The commit-queue is continuing to process your patch.
Comment 14 Grace Kloba 2010-11-30 19:41:58 PST
Created attachment 75244 [details]
Patch
Comment 15 Kenneth Russell 2010-12-01 11:11:17 PST
Comment on attachment 75244 [details]
Patch

Looks fine. I'm going to land this by hand.
Comment 16 Kenneth Russell 2010-12-01 11:14:01 PST
Committed r73046: <http://trac.webkit.org/changeset/73046>
Comment 17 WebKit Review Bot 2010-12-01 12:00:19 PST
http://trac.webkit.org/changeset/73046 might have broken GTK Linux 32-bit Release
The following tests are not passing:
media/controls-drag-timebar.html
Comment 18 Kenneth Russell 2010-12-01 12:05:31 PST
There was a compiler warning on Mac OS X in the original patch that Darin helpfully fixed up in http://trac.webkit.org/changeset/73053 .