Unreviewed, rolling out r122243.
authoryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Sep 2012 09:38:12 +0000 (09:38 +0000)
committeryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Sep 2012 09:38:12 +0000 (09:38 +0000)
http://trac.webkit.org/changeset/129243
https://bugs.webkit.org/show_bug.cgi?id=97441

WebFilterOperationsTest.saveAndRestore added in the change is failing.

Source/Platform:

* chromium/public/WebFilterOperation.h:
(WebKit::WebFilterOperation::amount):
(WebKit::WebFilterOperation::dropShadowOffset):
(WebKit::WebFilterOperation::matrix):
(WebKit::WebFilterOperation::zoomRect):
(WebFilterOperation):

Source/WebKit/chromium:

* tests/FilterOperationsTest.cpp:

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

Source/Platform/ChangeLog
Source/Platform/chromium/public/WebFilterOperation.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/FilterOperationsTest.cpp

index 60164f9..7502f1c 100644 (file)
@@ -1,3 +1,18 @@
+2012-09-24  Yury Semikhatsky  <yurys@chromium.org>
+
+        Unreviewed, rolling out r122243.
+        http://trac.webkit.org/changeset/129243
+        https://bugs.webkit.org/show_bug.cgi?id=97441
+
+        WebFilterOperationsTest.saveAndRestore added in the change is failing.
+
+        * chromium/public/WebFilterOperation.h:
+        (WebKit::WebFilterOperation::amount):
+        (WebKit::WebFilterOperation::dropShadowOffset):
+        (WebKit::WebFilterOperation::matrix):
+        (WebKit::WebFilterOperation::zoomRect):
+        (WebFilterOperation):
+
 2012-09-21  Alexandre Elias  <aelias@chromium.org>
 
         [chromium] Forward-declare WebSize as a struct
index 3628f48..9f15519 100644 (file)
@@ -55,23 +55,12 @@ public:
 
     float amount() const
     {
-        WEBKIT_ASSERT(m_type == FilterTypeGrayscale
-                   || m_type == FilterTypeSepia
-                   || m_type == FilterTypeSaturate
-                   || m_type == FilterTypeHueRotate
-                   || m_type == FilterTypeInvert
-                   || m_type == FilterTypeBrightness
-                   || m_type == FilterTypeContrast
-                   || m_type == FilterTypeOpacity
-                   || m_type == FilterTypeBlur
-                   || m_type == FilterTypeDropShadow
-                   || m_type == FilterTypeZoom);
         return m_amount;
     }
     WebPoint dropShadowOffset() const
     {
         WEBKIT_ASSERT(m_type == FilterTypeDropShadow);
-        return m_dropShadowOffset;
+        return WebPoint(m_dropShadowOffset);
     }
     WebColor dropShadowColor() const
     {
@@ -80,16 +69,16 @@ public:
     }
     const SkScalar* matrix() const
     {
-        WEBKIT_ASSERT(m_type == FilterTypeColorMatrix);
         return m_matrix;
     }
 
     WebRect zoomRect() const
     {
         WEBKIT_ASSERT(m_type == FilterTypeZoom);
-        return m_zoomRect;
+        return WebRect(m_zoomRect);
     }
 
+#define WEBKIT_HAS_NEW_WEBFILTEROPERATION_API 1
     static WebFilterOperation createGrayscaleFilter(float amount) { return WebFilterOperation(FilterTypeGrayscale, amount); }
     static WebFilterOperation createSepiaFilter(float amount) { return WebFilterOperation(FilterTypeSepia, amount); }
     static WebFilterOperation createSaturateFilter(float amount) { return WebFilterOperation(FilterTypeSaturate, amount); }
@@ -105,46 +94,6 @@ public:
 
     bool equals(const WebFilterOperation& other) const;
 
-    // Methods for restoring a WebFilterOperation.
-    static WebFilterOperation createEmptyFilter() { return WebFilterOperation(FilterTypeGrayscale, 0.0); }
-    void setType(FilterType type) { m_type = type; }
-    void setAmount(float amount)
-    {
-        WEBKIT_ASSERT(m_type == FilterTypeGrayscale
-                   || m_type == FilterTypeSepia
-                   || m_type == FilterTypeSaturate
-                   || m_type == FilterTypeHueRotate
-                   || m_type == FilterTypeInvert
-                   || m_type == FilterTypeBrightness
-                   || m_type == FilterTypeContrast
-                   || m_type == FilterTypeOpacity
-                   || m_type == FilterTypeBlur
-                   || m_type == FilterTypeDropShadow
-                   || m_type == FilterTypeZoom);
-        m_amount = amount;
-    }
-    void setDropShadowOffset(WebPoint offset)
-    {
-        WEBKIT_ASSERT(m_type == FilterTypeDropShadow);
-        m_dropShadowOffset = offset;
-    }
-    void setDropShadowColor(WebColor color)
-    {
-        WEBKIT_ASSERT(m_type == FilterTypeDropShadow);
-        m_dropShadowColor = color;
-    }
-    void setMatrix(const SkScalar matrix[20])
-    {
-        WEBKIT_ASSERT(m_type == FilterTypeColorMatrix);
-        for (unsigned i = 0; i < 20; ++i)
-            m_matrix[i] = matrix[i];
-    }
-    void setZoomRect(WebRect rect)
-    {
-        WEBKIT_ASSERT(m_type == FilterTypeZoom);
-        m_zoomRect = rect;
-    }
-
 private:
     FilterType m_type;
 
index ea34ae0..340eed6 100644 (file)
@@ -1,3 +1,13 @@
+2012-09-24  Yury Semikhatsky  <yurys@chromium.org>
+
+        Unreviewed, rolling out r122243.
+        http://trac.webkit.org/changeset/129243
+        https://bugs.webkit.org/show_bug.cgi?id=97441
+
+        WebFilterOperationsTest.saveAndRestore added in the change is failing.
+
+        * tests/FilterOperationsTest.cpp:
+
 2012-09-23  Keishi Hattori  <keishi@webkit.org>
 
         Add suggestionPicker to CalendarPicker
index 9f9a647..8a3c5d8 100644 (file)
@@ -89,108 +89,5 @@ TEST(WebFilterOperationsTest, getOutsetsDropShadow)
     EXPECT_EQ(54, left);
 }
 
-#define SAVE_RESTORE_AMOUNT(Type, a) \
-    { \
-        WebFilterOperation op = WebFilterOperation::create##Type##Filter(a); \
-        EXPECT_EQ(WebFilterOperation::FilterType##Type, op.type()); \
-        EXPECT_EQ(a, op.amount()); \
-        \
-        WebFilterOperation op2 = WebFilterOperation::createEmptyFilter(); \
-        op2.setType(WebFilterOperation::FilterType##Type); \
-        \
-        EXPECT_NE(a, op2.amount()); \
-        \
-        op2.setAmount(a); \
-        \
-        EXPECT_EQ(WebFilterOperation::FilterType##Type, op2.type()); \
-        EXPECT_EQ(a, op2.amount()); \
-    }
-
-#define SAVE_RESTORE_OFFSET_AMOUNT_COLOR(Type, a, b, c) \
-    { \
-        WebFilterOperation op = WebFilterOperation::create##Type##Filter(a, b, c); \
-        EXPECT_EQ(WebFilterOperation::FilterType##Type, op.type()); \
-        EXPECT_EQ(a, op.dropShadowOffset()); \
-        EXPECT_EQ(b, op.amount()); \
-        EXPECT_EQ(c, op.dropShadowColor()); \
-        \
-        WebFilterOperation op2 = WebFilterOperation::createEmptyFilter(); \
-        op2.setType(WebFilterOperation::FilterType##Type); \
-        \
-        EXPECT_NE(a, op2.dropShadowOffset()); \
-        EXPECT_NE(b, op2.amount()); \
-        EXPECT_NE(c, op2.dropShadowColor()); \
-        \
-        op2.setDropShadowOffset(a); \
-        op2.setAmount(b); \
-        op2.setDropShadowColor(c); \
-        \
-        EXPECT_EQ(WebFilterOperation::FilterType##Type, op2.type()); \
-        EXPECT_EQ(a, op2.dropShadowOffset()); \
-        EXPECT_EQ(b, op2.amount()); \
-        EXPECT_EQ(c, op2.dropShadowColor()); \
-    }
-
-#define SAVE_RESTORE_MATRIX(Type, a) \
-    { \
-        WebFilterOperation op = WebFilterOperation::create##Type##Filter(a); \
-        EXPECT_EQ(WebFilterOperation::FilterType##Type, op.type());     \
-        for (unsigned i = 0; i < 20; ++i) \
-            EXPECT_EQ(a[i], op.matrix()[i]); \
-        \
-        WebFilterOperation op2 = WebFilterOperation::createEmptyFilter(); \
-        op2.setType(WebFilterOperation::FilterType##Type); \
-        \
-        for (unsigned i = 0; i < 20; ++i) \
-            EXPECT_NE(a[i], op2.matrix()[i]); \
-        \
-        op2.setMatrix(a); \
-        \
-        EXPECT_EQ(WebFilterOperation::FilterType##Type, op2.type()); \
-        for (unsigned i = 0; i < 20; ++i) \
-            EXPECT_EQ(a[i], op.matrix()[i]); \
-    }
-
-#define SAVE_RESTORE_ZOOMRECT_AMOUNT(Type, a, b) \
-    { \
-        WebFilterOperation op = WebFilterOperation::create##Type##Filter(a, b); \
-        EXPECT_EQ(WebFilterOperation::FilterType##Type, op.type()); \
-        EXPECT_EQ(a, op.zoomRect()); \
-        EXPECT_EQ(b, op.amount()); \
-        \
-        WebFilterOperation op2 = WebFilterOperation::createEmptyFilter(); \
-        op2.setType(WebFilterOperation::FilterType##Type); \
-        \
-        EXPECT_NE(a, op2.zoomRect()); \
-        EXPECT_NE(b, op2.amount()); \
-        \
-        op2.setZoomRect(a); \
-        op2.setAmount(b); \
-        \
-        EXPECT_EQ(WebFilterOperation::FilterType##Type, op2.type()); \
-        EXPECT_EQ(a, op2.zoomRect()); \
-        EXPECT_EQ(b, op2.amount()); \
-    }
-
-
-TEST(WebFilterOperationsTest, saveAndRestore)
-{
-    SAVE_RESTORE_AMOUNT(Grayscale, 0.6f);
-    SAVE_RESTORE_AMOUNT(Sepia, 0.6f);
-    SAVE_RESTORE_AMOUNT(Saturate, 0.6f);
-    SAVE_RESTORE_AMOUNT(HueRotate, 0.6f);
-    SAVE_RESTORE_AMOUNT(Invert, 0.6f);
-    SAVE_RESTORE_AMOUNT(Brightness, 0.6f);
-    SAVE_RESTORE_AMOUNT(Contrast, 0.6f);
-    SAVE_RESTORE_AMOUNT(Opacity, 0.6f);
-    SAVE_RESTORE_AMOUNT(Blur, 0.6f);
-    SAVE_RESTORE_OFFSET_AMOUNT_COLOR(DropShadow, WebPoint(3, 4), 0.4f, 0xffffff00);
-
-    SkScalar matrix[20] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 };
-    SAVE_RESTORE_MATRIX(ColorMatrix, matrix);
-
-    SAVE_RESTORE_ZOOMRECT_AMOUNT(Zoom, WebRect(20, 19, 18, 17), 32);
-}
-
 }