[chromium] Fix layer sorting perspective w if w becomes negative
authorshawnsingh@chromium.org <shawnsingh@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Apr 2012 19:31:56 +0000 (19:31 +0000)
committershawnsingh@chromium.org <shawnsingh@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Apr 2012 19:31:56 +0000 (19:31 +0000)
commitaecfd7096501778b82f9c3c11fa85454466293b9
tree7d76308038c0ead6df5856f5628cde7cd3d4bc16
parent7c32e5312918b1a75e9e75e25c28743b26e8dc3e
[chromium] Fix layer sorting perspective w if w becomes negative
https://bugs.webkit.org/show_bug.cgi?id=82997

Reviewed by Adrienne Walker.

Source/WebCore:

Unit test added to CCLayerSorterTest.cpp.

This is a follow-up patch after r113364. That other patch
implemented proper clipping so that perspective transforms do not
accidentally make geometry disappear. This patch fixes a similar
problem in the layer sorter code so that layers do not
accidentally get sorted incorrectly.

* platform/graphics/chromium/cc/CCLayerSorter.cpp:
(WebCore::CCLayerSorter::LayerShape::LayerShape):
* platform/graphics/chromium/cc/CCMathUtil.cpp:
(WebCore::computeEnclosingRect):
(WebCore::addVertexToClippedQuad):
(WebCore::CCMathUtil::mapClippedQuad):
(WebCore):
(WebCore::CCMathUtil::computeEnclosingRectOfVertices):
* platform/graphics/chromium/cc/CCMathUtil.h:
(WebCore):
(CCMathUtil):

Source/WebKit/chromium:

* tests/CCLayerSorterTest.cpp:
(WebCore::TEST):
(WebCore):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113606 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/cc/CCLayerSorter.cpp
Source/WebCore/platform/graphics/chromium/cc/CCMathUtil.cpp
Source/WebCore/platform/graphics/chromium/cc/CCMathUtil.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/CCLayerSorterTest.cpp