Bug 55679 - [chromium] Regression: r80081
Summary: [chromium] Regression: r80081
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Adrienne Walker
URL: http://http://peter.sh/2010/06/chromi...
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-03 08:42 PST by Jonathan Backer
Modified: 2011-03-04 15:57 PST (History)
5 users (show)

See Also:


Attachments
Patch (1.58 KB, patch)
2011-03-03 10:39 PST, Adrienne Walker
no flags Details | Formatted Diff | Diff
Patch (14.53 KB, patch)
2011-03-04 13:06 PST, Adrienne Walker
no flags Details | Formatted Diff | Diff
Patch (9.88 KB, patch)
2011-03-04 14:28 PST, Adrienne Walker
jamesr: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Backer 2011-03-03 08:42:32 PST
Affects all platforms (Windows requires --use-gl=desktop to repro): enable accelerated compositing by moving the z slider on URL above. Then select some text on the rotated layer. This causes the layer to display some corrupted graphics. I built Chrome by hand and narrowed it down to the specific commit.

http://trac.webkit.org/changeset/80081
Comment 1 Adrienne Walker 2011-03-03 09:43:32 PST
Thanks for taking the time to narrow this down to a single commit.  I'll take a look.
Comment 2 Adrienne Walker 2011-03-03 10:05:09 PST
This looks like it's occurring on large layers.  Probably just a mismatched stride somewhere.
Comment 3 Adrienne Walker 2011-03-03 10:39:26 PST
Created attachment 84583 [details]
Patch
Comment 4 James Robinson 2011-03-03 12:58:27 PST
Comment on attachment 84583 [details]
Patch

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

> Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp:215
>      const uint8_t* uploadPixels = pixels + srcStride * m_uploadUpdateRect.x();

this line is also clearly wrong (multiplying a stride by an x offset makes no sense).  would you mind changing this as well?

can you take a shot at making a test?  clearly the tests in LayoutTests/compositing/ are insufficient to catch this error, since they all pass, and since we're planning to rewrite this code again I would really like to have some tests that exercise this code a bit more.
Comment 5 Adrienne Walker 2011-03-03 13:04:06 PST
(In reply to comment #4)
> (From update of attachment 84583 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=84583&action=review
> 
> > Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp:215
> >      const uint8_t* uploadPixels = pixels + srcStride * m_uploadUpdateRect.x();
> 
> this line is also clearly wrong (multiplying a stride by an x offset makes no sense).  would you mind changing this as well?
> 
> can you take a shot at making a test?  clearly the tests in LayoutTests/compositing/ are insufficient to catch this error, since they all pass, and since we're planning to rewrite this code again I would really like to have some tests that exercise this code a bit more.

We do have a large layer test for images, but it's a solid color, so a stride difference is a no-op.  I could just add a gradient and rebaseline.
Comment 6 James Robinson 2011-03-03 13:18:41 PST
(In reply to comment #5)
> (In reply to comment #4)
> > (From update of attachment 84583 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=84583&action=review
> > 
> > > Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp:215
> > >      const uint8_t* uploadPixels = pixels + srcStride * m_uploadUpdateRect.x();
> > 
> > this line is also clearly wrong (multiplying a stride by an x offset makes no sense).  would you mind changing this as well?
> > 
> > can you take a shot at making a test?  clearly the tests in LayoutTests/compositing/ are insufficient to catch this error, since they all pass, and since we're planning to rewrite this code again I would really like to have some tests that exercise this code a bit more.
> 
> We do have a large layer test for images, but it's a solid color, so a stride difference is a no-op.  I could just add a gradient and rebaseline.

D'oh!  Yeah having some sort of pattern or gradient or something would be awesome so we can tell if we are uploading garbage.  Either augmenting the existing test or just adding a new one sound great to me.
Comment 7 James Robinson 2011-03-03 14:19:19 PST
Comment on attachment 84583 [details]
Patch

I promise to R+ once we have test coverage :)
Comment 8 Adrienne Walker 2011-03-03 14:22:12 PST
As it turns out the huge-layer-img.html test would have caught this had it been a pixel test.  Of course, that uncovered a second bug (yay testing) where the image layer is replaced by a scrollbar texture (oops), so I'll fix that too before I upload another patch.
Comment 9 James Robinson 2011-03-04 12:17:25 PST
I've confirmed locally that this fixes the stride issue on https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/webgl-conformance-tests.html as well (to repro, click 'run' on a test such as conformance/buffer-preserve-test.html and select some text in the iframe in the top left.  It's a large layer and looks pretty jacked up without this patch).
Comment 10 Adrienne Walker 2011-03-04 13:06:47 PST
Created attachment 84791 [details]
Patch
Comment 11 Adrienne Walker 2011-03-04 13:09:18 PST
(In reply to comment #10)
> Created an attachment (id=84791) [details]
> Patch

I added one image for this test, but it's going to fail on a bunch of platforms because it was previously text-only.  What's the best way to handle this? Is it ok to land and immediately fix the tests that I know will be broken?

It's a little unclear for me how to sort out which platforms even run this test, but another option might be to change test_expectations to fail IMAGE for all the rest as a part of this patch?
Comment 12 James Robinson 2011-03-04 13:20:33 PST
We chatted in person.  I think the best approach is to make a new copy of this test that does not have visible text and has overflow:hidden on the <body> to hide the scrollbars.
Comment 13 Adrienne Walker 2011-03-04 14:28:58 PST
Created attachment 84798 [details]
Patch
Comment 14 James Robinson 2011-03-04 15:17:51 PST
Comment on attachment 84798 [details]
Patch

R=me.
Comment 15 Adrienne Walker 2011-03-04 15:57:37 PST
Committed r80384: <http://trac.webkit.org/changeset/80384>