Title: [143101] trunk
Revision
143101
Author
[email protected]
Date
2013-02-16 04:45:57 -0800 (Sat, 16 Feb 2013)

Log Message

[skia] FEOffset should have a Skia implementation.
https://bugs.webkit.org/show_bug.cgi?id=109831

Reviewed by James Robinson.

Source/WebCore:

Covered by css3/filters/effect-reference.html and -hw.html.

* WebCore.gypi:
* platform/graphics/filters/FEOffset.h:  Implement createImageFilter()
for the Skia path.
* platform/graphics/filters/skia/FEOffsetSkia.cpp: Added.
(WebCore::FEOffset::createImageFilter):
Instantiate an SkOffsetImageFilter when building the Skia DAG.

LayoutTests:

* css3/filters/effect-reference-hw.html:
* css3/filters/effect-reference.html:
* platform/chromium/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (143100 => 143101)


--- trunk/LayoutTests/ChangeLog	2013-02-16 11:28:19 UTC (rev 143100)
+++ trunk/LayoutTests/ChangeLog	2013-02-16 12:45:57 UTC (rev 143101)
@@ -1,3 +1,14 @@
+2013-02-16  Stephen White  <[email protected]>
+
+        [skia] FEOffset should have a Skia implementation.
+        https://bugs.webkit.org/show_bug.cgi?id=109831
+
+        Reviewed by James Robinson.
+
+        * css3/filters/effect-reference-hw.html:
+        * css3/filters/effect-reference.html:
+        * platform/chromium/TestExpectations:
+
 2013-02-16  Vsevolod Vlasov  <[email protected]>
 
         Web Inspector: Create separate project for each domain for UISourceCode based on browser resources.

Modified: trunk/LayoutTests/css3/filters/effect-reference-hw.html (143100 => 143101)


--- trunk/LayoutTests/css3/filters/effect-reference-hw.html	2013-02-16 11:28:19 UTC (rev 143100)
+++ trunk/LayoutTests/css3/filters/effect-reference-hw.html	2013-02-16 12:45:57 UTC (rev 143101)
@@ -28,6 +28,9 @@
       <feColorMatrix type="matrix" values="0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 0 1"/>
       <feBlend in2="SourceGraphic" mode="multiply"/>
     </filter>
+    <filter id="offset" x="0%">
+      <feOffset dx="10" dy="10"/>
+    </filter>
   </defs>
 </svg>
 <style>
@@ -43,3 +46,4 @@
 <img style="-webkit-filter: url(#blurY); filter: url(#blurY);" src=""
 <img style="-webkit-filter: url(#blend); filter: url(#blend);" src=""
 <img style="-webkit-filter: url(#lighting); filter: url(#lighting);" src=""
+<img style="-webkit-filter: url(#offset); filter: url(#offset);" src=""

Modified: trunk/LayoutTests/css3/filters/effect-reference.html (143100 => 143101)


--- trunk/LayoutTests/css3/filters/effect-reference.html	2013-02-16 11:28:19 UTC (rev 143100)
+++ trunk/LayoutTests/css3/filters/effect-reference.html	2013-02-16 12:45:57 UTC (rev 143101)
@@ -28,6 +28,9 @@
       <feColorMatrix type="matrix" values="0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 0 1"/>
       <feBlend in2="SourceGraphic" mode="multiply"/>
     </filter>
+    <filter id="offset" x="0%">
+      <feOffset dx="10" dy="10"/>
+    </filter>
   </defs>
 </svg>
 <style>
@@ -42,3 +45,4 @@
 <img style="-webkit-filter: url(#blurY); filter: url(#blurY);" src=""
 <img style="-webkit-filter: url(#blend); filter: url(#blend);" src=""
 <img style="-webkit-filter: url(#lighting); filter: url(#lighting);" src=""
+<img style="-webkit-filter: url(#offset); filter: url(#offset);" src=""

Modified: trunk/LayoutTests/platform/chromium/TestExpectations (143100 => 143101)


--- trunk/LayoutTests/platform/chromium/TestExpectations	2013-02-16 11:28:19 UTC (rev 143100)
+++ trunk/LayoutTests/platform/chromium/TestExpectations	2013-02-16 12:45:57 UTC (rev 143101)
@@ -4345,6 +4345,10 @@
 
 webkit.org/b/108163 [ Debug ] platform/chromium/virtual/deferred/fast/images/icon-0colors.html [ Crash ]
 
+# New test cases added to these tests will require rebaselines.
+webkit.org/b/109831 css3/filters/effect-reference.html
+webkit.org/b/109831 css3/filters/effect-reference-hw.html
+
 # New clamping logic in the tile shader will causes slight diffs. These images must be rebaselined.
 crbug.com/170722 [ Mac Win Linux ] compositing/color-matching/image-color-matching.html [ ImageOnlyFailure ]
 crbug.com/170722 [ Mac Win Linux ] compositing/visibility/visibility-image-layers.html [ ImageOnlyFailure ]

Modified: trunk/Source/WebCore/ChangeLog (143100 => 143101)


--- trunk/Source/WebCore/ChangeLog	2013-02-16 11:28:19 UTC (rev 143100)
+++ trunk/Source/WebCore/ChangeLog	2013-02-16 12:45:57 UTC (rev 143101)
@@ -1,3 +1,19 @@
+2013-02-16  Stephen White  <[email protected]>
+
+        [skia] FEOffset should have a Skia implementation.
+        https://bugs.webkit.org/show_bug.cgi?id=109831
+
+        Reviewed by James Robinson.
+
+        Covered by css3/filters/effect-reference.html and -hw.html.
+
+        * WebCore.gypi:
+        * platform/graphics/filters/FEOffset.h:  Implement createImageFilter()
+        for the Skia path.
+        * platform/graphics/filters/skia/FEOffsetSkia.cpp: Added.
+        (WebCore::FEOffset::createImageFilter):
+        Instantiate an SkOffsetImageFilter when building the Skia DAG.
+
 2013-02-16  Vsevolod Vlasov  <[email protected]>
 
         Web Inspector: Create separate project for each domain for UISourceCode based on browser resources.

Modified: trunk/Source/WebCore/WebCore.gypi (143100 => 143101)


--- trunk/Source/WebCore/WebCore.gypi	2013-02-16 11:28:19 UTC (rev 143100)
+++ trunk/Source/WebCore/WebCore.gypi	2013-02-16 12:45:57 UTC (rev 143101)
@@ -4032,6 +4032,7 @@
             'platform/graphics/filters/skia/FEGaussianBlurSkia.cpp',
             'platform/graphics/filters/skia/FEMorphologySkia.cpp',
             'platform/graphics/filters/skia/FELightingSkia.cpp',
+            'platform/graphics/filters/skia/FEOffsetSkia.cpp',
             'platform/graphics/filters/skia/SkiaImageFilterBuilder.cpp',
             'platform/graphics/filters/skia/SkiaImageFilterBuilder.h',
             'platform/graphics/filters/skia/DropShadowImageFilter.cpp',

Modified: trunk/Source/WebCore/platform/graphics/filters/FEOffset.h (143100 => 143101)


--- trunk/Source/WebCore/platform/graphics/filters/FEOffset.h	2013-02-16 11:28:19 UTC (rev 143100)
+++ trunk/Source/WebCore/platform/graphics/filters/FEOffset.h	2013-02-16 12:45:57 UTC (rev 143101)
@@ -45,6 +45,10 @@
 
     virtual TextStream& externalRepresentation(TextStream&, int indention) const;
 
+#if USE(SKIA)
+    virtual SkImageFilter* createImageFilter(SkiaImageFilterBuilder*);
+#endif
+
 private:
     FEOffset(Filter*, float dx, float dy);
 

Added: trunk/Source/WebCore/platform/graphics/filters/skia/FEOffsetSkia.cpp (0 => 143101)


--- trunk/Source/WebCore/platform/graphics/filters/skia/FEOffsetSkia.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/filters/skia/FEOffsetSkia.cpp	2013-02-16 12:45:57 UTC (rev 143101)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2013 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 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 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"
+
+#if ENABLE(FILTERS)
+#include "FEOffset.h"
+
+#include "SkOffsetImageFilter.h"
+#include "SkiaImageFilterBuilder.h"
+
+namespace WebCore {
+
+SkImageFilter* FEOffset::createImageFilter(SkiaImageFilterBuilder* builder)
+{
+    SkAutoTUnref<SkImageFilter> input(builder->build(inputEffect(0)));
+    return new SkOffsetImageFilter(SkFloatToScalar(m_dx), SkFloatToScalar(m_dy), input);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to