Source/WebCore: [chromium] CCLayerQuad does not return FloatQuad in correct order
authoralokp@chromium.org <alokp@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Dec 2011 21:08:40 +0000 (21:08 +0000)
committeralokp@chromium.org <alokp@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Dec 2011 21:08:40 +0000 (21:08 +0000)
https://bugs.webkit.org/show_bug.cgi?id=73247

Reviewed by James Robinson.

Returned the FloatQuad coordinates in correct order.

Covered by new unit tests in CCLayerQuadTest.cpp.

* platform/graphics/chromium/cc/CCLayerQuad.cpp:
(WebCore::CCLayerQuad::floatQuad):

Source/WebKit/chromium: [chromium] CCLayerQuad does not return FloatQuad in correct order
https://bugs.webkit.org/show_bug.cgi?id=73247

Reviewed by James Robinson.

* WebKit.gypi:
* tests/CCLayerQuadTest.cpp: Added.
(WebCore::TEST):

LayoutTests: [chromium] CCLayerQuad does not return FloatQuad in correct order
https://bugs.webkit.org/show_bug.cgi?id=73247

Reviewed by James Robinson.

* platform/chromium/test_expectations.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@101844 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/chromium/test_expectations.txt
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/cc/CCLayerQuad.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/WebKit.gypi
Source/WebKit/chromium/tests/CCLayerQuadTest.cpp [new file with mode: 0644]

index c93bf05..7d10404 100644 (file)
@@ -1,3 +1,12 @@
+2011-12-01  Alok Priyadarshi  <alokp@chromium.org>
+
+        [chromium] CCLayerQuad does not return FloatQuad in correct order
+        https://bugs.webkit.org/show_bug.cgi?id=73247
+
+        Reviewed by James Robinson.
+
+        * platform/chromium/test_expectations.txt:
+
 2011-12-02  Vincent Scheib  <scheib@chromium.org>
 
         [Chromium] Marking slow test: http/tests/appcache/video.html
index d90f402..2c9c47c 100644 (file)
@@ -3744,6 +3744,26 @@ BUG_CARYCLARK MAC CPU : fast/writing-mode/vertical-align-table-baseline.html = I
 BUG_CARYCLARK MAC CPU : fast/writing-mode/vertical-baseline-alignment.html = IMAGE
 BUG_CARYCLARK MAC CPU : fast/writing-mode/vertical-font-fallback.html = IMAGE
 
+BUGALOKP : compositing/color-matching/image-color-matching.html = IMAGE
+BUGALOKP : compositing/direct-image-compositing.html = IMAGE
+BUGALOKP : compositing/geometry/ancestor-overflow-change.html = IMAGE
+BUGALOKP : compositing/geometry/fixed-position-transform-composited-page-scale.html = IMAGE
+BUGALOKP : compositing/geometry/layer-due-to-layer-children-deep.html = IMAGE
+BUGALOKP : compositing/geometry/layer-due-to-layer-children.html = IMAGE
+BUGALOKP : compositing/geometry/vertical-scroll-composited.html = IMAGE
+BUGALOKP : compositing/reflections/nested-reflection-transformed.html = IMAGE
+BUGALOKP : compositing/reflections/nested-reflection-transformed2.html = IMAGE
+BUGALOKP : compositing/reflections/nested-reflection-transition.html = IMAGE
+BUGALOKP : compositing/reflections/reflection-in-composited.html = IMAGE
+BUGALOKP : compositing/scaling/tiled-layer-recursion.html = IMAGE
+BUGALOKP MAC LINUX: compositing/shadows/shadow-drawing.html = IMAGE
+BUGALOKP : platform/chromium/compositing/huge-layer-rotated.html = IMAGE
+BUGALOKP : platform/chromium/compositing/layout-width-change.html = IMAGE
+BUGALOKP : platform/chromium/compositing/tiny-layer-rotated.html = IMAGE
+BUGALOKP GPU: media/video-layer-crash.html = IMAGE
+BUGALOKP GPU: media/video-transformed.html = IMAGE
+BUGALOKP GPU: media/video-zoom-controls.html = IMAGE
+
 BUGWK72271 MAC DEBUG : fast/loader/javascript-url-in-embed.html = PASS CRASH
 BUGWK72271 SNOWLEOPARD DEBUG : fast/dom/node-iterator-reference-node-moved-crash.html = PASS CRASH
 
index 92288b2..65ce970 100644 (file)
@@ -1,3 +1,17 @@
+2011-12-01  Alok Priyadarshi  <alokp@chromium.org>
+
+        [chromium] CCLayerQuad does not return FloatQuad in correct order
+        https://bugs.webkit.org/show_bug.cgi?id=73247
+
+        Reviewed by James Robinson.
+
+        Returned the FloatQuad coordinates in correct order.
+        
+        Covered by new unit tests in CCLayerQuadTest.cpp.
+
+        * platform/graphics/chromium/cc/CCLayerQuad.cpp:
+        (WebCore::CCLayerQuad::floatQuad):
+
 2011-12-02  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r101833.
index 896b2ac..2c5f7ec 100644 (file)
@@ -60,10 +60,10 @@ CCLayerQuad::CCLayerQuad(const FloatQuad& quad)
 
 FloatQuad CCLayerQuad::floatQuad() const
 {
-    return FloatQuad(m_bottom.intersect(m_left),
-                     m_left.intersect(m_top),
+    return FloatQuad(m_left.intersect(m_top),
                      m_top.intersect(m_right),
-                     m_right.intersect(m_bottom));
+                     m_right.intersect(m_bottom),
+                     m_bottom.intersect(m_left));
 }
 
 void CCLayerQuad::toFloatArray(float flattened[12]) const
index 35f3a47..cab747e 100644 (file)
@@ -1,3 +1,14 @@
+2011-12-01  Alok Priyadarshi  <alokp@chromium.org>
+
+        [chromium] CCLayerQuad does not return FloatQuad in correct order
+        https://bugs.webkit.org/show_bug.cgi?id=73247
+
+        Reviewed by James Robinson.
+
+        * WebKit.gypi:
+        * tests/CCLayerQuadTest.cpp: Added.
+        (WebCore::TEST):
+
 2011-11-30  Adam Klein  <adamk@chromium.org>
 
         [chromium] WebKitMutationObserver::deliverAllMutations should be exposed through the Chromium API
index d7433ab..fcf9cf0 100644 (file)
@@ -58,6 +58,7 @@
             'tests/CCDelayBasedTimeSourceTest.cpp',
             'tests/CCFrameRateControllerTest.cpp',
             'tests/CCLayerImplTest.cpp',
+            'tests/CCLayerQuadTest.cpp',
             'tests/CCLayerSorterTest.cpp',
             'tests/CCLayerTreeHostCommonTest.cpp',
             'tests/CCLayerTreeHostImplTest.cpp',
diff --git a/Source/WebKit/chromium/tests/CCLayerQuadTest.cpp b/Source/WebKit/chromium/tests/CCLayerQuadTest.cpp
new file mode 100644 (file)
index 0000000..2ab4ec4
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "cc/CCLayerQuad.h"
+
+#include <gtest/gtest.h>
+
+using namespace WebCore;
+
+namespace {
+
+TEST(CCLayerQuadTest, FloatQuadConversion)
+{
+    FloatPoint p1(-0.5, -0.5);
+    FloatPoint p2( 0.5, -0.5);
+    FloatPoint p3( 0.5,  0.5);
+    FloatPoint p4(-0.5,  0.5);
+
+    FloatQuad quadCW(p1, p2, p3, p4);
+    CCLayerQuad layerQuadCW(quadCW);
+    EXPECT_TRUE(layerQuadCW.floatQuad() == quadCW);
+
+    FloatQuad quadCCW(p1, p4, p3, p2);
+    CCLayerQuad layerQuadCCW(quadCCW);
+    EXPECT_TRUE(layerQuadCCW.floatQuad() == quadCCW);
+}
+
+TEST(CCLayerQuadTest, Inflate)
+{
+    FloatPoint p1(-0.5, -0.5);
+    FloatPoint p2( 0.5, -0.5);
+    FloatPoint p3( 0.5,  0.5);
+    FloatPoint p4(-0.5,  0.5);
+
+    FloatQuad quad(p1, p2, p3, p4);
+    CCLayerQuad layerQuad(quad);
+    quad.scale(2.0, 2.0);
+    layerQuad.inflate(0.5);
+    EXPECT_TRUE(layerQuad.floatQuad() == quad);
+}
+
+} // namespace