Bug 82997 - [chromium] Fix layer sorting perspective w if w becomes negative
Summary: [chromium] Fix layer sorting perspective w if w becomes negative
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Shawn Singh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-02 20:16 PDT by Shawn Singh
Modified: 2012-04-09 12:32 PDT (History)
5 users (show)

See Also:


Attachments
Working fix, without unit test yet (9.57 KB, patch)
2012-04-06 16:48 PDT, Shawn Singh
no flags Details | Formatted Diff | Diff
Patch with unit test (14.16 KB, patch)
2012-04-08 22:14 PDT, Shawn Singh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.