Bug 82997

Summary: [chromium] Fix layer sorting perspective w if w becomes negative
Product: WebKit Reporter: Shawn Singh <shawnsingh>
Component: Layout and RenderingAssignee: Shawn Singh <shawnsingh>
Status: RESOLVED FIXED    
Severity: Normal CC: cc-bugs, enne, jamesr, vangelis, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Working fix, without unit test yet
none
Patch with unit test none

Description Shawn Singh 2012-04-02 20:16:09 PDT
A follow-up to https://bugs.webkit.org/show_bug.cgi?id=80806

There are still some minor flashing/sorting artifacts that occur that are most likely to to this issue.
Comment 1 Shawn Singh 2012-04-06 13:44:12 PDT
So here's the situation:

I was able to whip up a quick fix for this, and it did fix the flashing sorting artifacts that we were seeing:
   - css space cube demo
   - mozilla cardboard box + paper sheep demo

However, the fix as I've hacked it currently, uses only a sub-portion of the clipped geometry to do layer sorting.  (so that I can still use FloatQuad instead of the clipped polygon).

Of course, this causes other potential layer sorting bugs, for example, it regresses acko.net to have flaky sorting again.


There are two options I can think of to fix this:

(1) make layer sorter work with general clipped polygons of up to 8 vertices.  We can create a quick data structure, ClippedQuad, that internally holds up to 8 vertices without using the allocator.

(2) make layer sorter support multiple quads per layer and accumulate all topological dependencies for all quads.

Any preferences?   At the moment it seems like #2 will be easier to implement.
Comment 2 Shawn Singh 2012-04-06 15:22:07 PDT
(In reply to comment #1)

> Of course, this causes other potential layer sorting bugs, for example, it regresses acko.net to have flaky sorting again.
> 

Actually, those acko.net sorting bugs already existed, even before the previous perspective clipping patch.  So my fix should be OK without forcing more complexity.
Comment 3 Shawn Singh 2012-04-06 16:48:15 PDT
Created attachment 136096 [details]
Working fix, without unit test yet
Comment 4 Shawn Singh 2012-04-08 22:14:20 PDT
Created attachment 136184 [details]
Patch with unit test

Shuffled around some CCMathUtil code at the same time, for cleanliness
Comment 5 Adrienne Walker 2012-04-09 10:12:47 PDT
Comment on attachment 136184 [details]
Patch with unit test

R=me.
Comment 6 Shawn Singh 2012-04-09 10:28:48 PDT
Comment on attachment 136184 [details]
Patch with unit test


Thanks!
Comment 7 WebKit Review Bot 2012-04-09 12:32:19 PDT
Comment on attachment 136184 [details]
Patch with unit test

Clearing flags on attachment: 136184

Committed r113606: <http://trac.webkit.org/changeset/113606>
Comment 8 WebKit Review Bot 2012-04-09 12:32:24 PDT
All reviewed patches have been landed.  Closing bug.