Title: [184093] releases/WebKitGTK/webkit-2.8
Revision
184093
Author
[email protected]
Date
2015-05-11 06:38:50 -0700 (Mon, 11 May 2015)

Log Message

Merge r183088 - [Cairo] Implement Path::addPath
https://bugs.webkit.org/show_bug.cgi?id=130580

Reviewed by Dirk Schulze.

Source/WebCore:

Add support for addPath method for ports using cairo.
This patch is originally authored by Jae Hyun Park <[email protected]>.

Test: fast/canvas/canvas-path-addPath.html

* platform/graphics/cairo/PathCairo.cpp:
(WebCore::Path::addPath): Implement addPath for cairo.

LayoutTests:

Enable addPath testcase in EFL port.

* platform/efl/TestExpectations:

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog (184092 => 184093)


--- releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog	2015-05-11 13:32:39 UTC (rev 184092)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog	2015-05-11 13:38:50 UTC (rev 184093)
@@ -1,3 +1,14 @@
+2015-04-21  Jinwoo Song  <[email protected]>
+
+        [Cairo] Implement Path::addPath
+        https://bugs.webkit.org/show_bug.cgi?id=130580
+
+        Reviewed by Dirk Schulze.
+
+        Enable addPath testcase in EFL port.
+
+        * platform/efl/TestExpectations:
+
 2015-04-20  Simon Fraser  <[email protected]>
 
         REGRESSION (r177494): -webkit-mask-image: with data URI fails on non-local files

Modified: releases/WebKitGTK/webkit-2.8/LayoutTests/platform/efl/TestExpectations (184092 => 184093)


--- releases/WebKitGTK/webkit-2.8/LayoutTests/platform/efl/TestExpectations	2015-05-11 13:32:39 UTC (rev 184092)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/platform/efl/TestExpectations	2015-05-11 13:38:50 UTC (rev 184093)
@@ -204,9 +204,6 @@
 # Tests for features under development
 # ------------------------------------
 
-# Path::addPath needs to be implemented
-webkit.org/b/130464 fast/canvas/canvas-path-addPath.html
-
 # Unclassified failures
 fast/events/platform-wheelevent-paging-x-in-non-scrolling-div.html
 fast/events/platform-wheelevent-paging-x-in-non-scrolling-page.html

Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog (184092 => 184093)


--- releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog	2015-05-11 13:32:39 UTC (rev 184092)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog	2015-05-11 13:38:50 UTC (rev 184093)
@@ -1,3 +1,18 @@
+2015-04-21  Jinwoo Song  <[email protected]>
+
+        [Cairo] Implement Path::addPath
+        https://bugs.webkit.org/show_bug.cgi?id=130580
+
+        Reviewed by Dirk Schulze.
+
+        Add support for addPath method for ports using cairo.
+        This patch is originally authored by Jae Hyun Park <[email protected]>.
+
+        Test: fast/canvas/canvas-path-addPath.html
+
+        * platform/graphics/cairo/PathCairo.cpp:
+        (WebCore::Path::addPath): Implement addPath for cairo.
+
 2015-04-21  Chris Dumez  <[email protected]>
 
         Use ASSERT_WITH_SECURITY_IMPLICATION() for NoEventDispatchAssertion

Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/cairo/PathCairo.cpp (184092 => 184093)


--- releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/cairo/PathCairo.cpp	2015-05-11 13:32:39 UTC (rev 184092)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/cairo/PathCairo.cpp	2015-05-11 13:38:50 UTC (rev 184093)
@@ -31,7 +31,6 @@
 #include "AffineTransform.h"
 #include "FloatRect.h"
 #include "GraphicsContext.h"
-#include "NotImplemented.h"
 #include "OwnPtrCairo.h"
 #include "PlatformPathCairo.h"
 #include "StrokeStyleApplier.h"
@@ -296,10 +295,23 @@
     cairo_restore(cr);
 }
 
-void Path::addPath(const Path&, const AffineTransform&)
+void Path::addPath(const Path& path, const AffineTransform& transform)
 {
-    // FIXME: This should probably be very similar to Path::transform.
-    notImplemented();
+    if (path.isNull())
+        return;
+
+    cairo_matrix_t matrix(transform);
+    if (cairo_matrix_invert(&matrix) != CAIRO_STATUS_SUCCESS)
+        return;
+
+    cairo_t* cr = path.platformPath()->context();
+    cairo_save(cr);
+    cairo_transform(cr, &matrix);
+    std::unique_ptr<cairo_path_t, void(*)(cairo_path_t*)> pathCopy(cairo_copy_path(cr), [](cairo_path_t* path) {
+        cairo_path_destroy(path);
+    });
+    cairo_restore(cr);
+    cairo_append_path(ensurePlatformPath()->context(), pathCopy.get());
 }
 
 void Path::closeSubpath()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to