Title: [187621] trunk/Source/WebCore
- Revision
- 187621
- Author
- simon.fra...@apple.com
- Date
- 2015-07-30 16:41:54 -0700 (Thu, 30 Jul 2015)
Log Message
Make Path::apply() take a function reference
https://bugs.webkit.org/show_bug.cgi?id=147472
Reviewed by Anders Carlsson.
Path::apply() should take a const reference to a std::function.
* platform/graphics/Path.h:
* platform/graphics/cairo/PathCairo.cpp:
* platform/graphics/cg/PathCG.cpp:
(WebCore::CGPathApplierToPathApplier):
(WebCore::Path::apply):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (187620 => 187621)
--- trunk/Source/WebCore/ChangeLog 2015-07-30 23:38:23 UTC (rev 187620)
+++ trunk/Source/WebCore/ChangeLog 2015-07-30 23:41:54 UTC (rev 187621)
@@ -1,3 +1,18 @@
+2015-07-30 Simon Fraser <simon.fra...@apple.com>
+
+ Make Path::apply() take a function reference
+ https://bugs.webkit.org/show_bug.cgi?id=147472
+
+ Reviewed by Anders Carlsson.
+
+ Path::apply() should take a const reference to a std::function.
+
+ * platform/graphics/Path.h:
+ * platform/graphics/cairo/PathCairo.cpp:
+ * platform/graphics/cg/PathCG.cpp:
+ (WebCore::CGPathApplierToPathApplier):
+ (WebCore::Path::apply):
+
2015-07-30 Anders Carlsson <ander...@apple.com>
Assertion failure when a plug-in loads a resource that redirects somewhere
Modified: trunk/Source/WebCore/platform/graphics/Path.h (187620 => 187621)
--- trunk/Source/WebCore/platform/graphics/Path.h 2015-07-30 23:38:23 UTC (rev 187620)
+++ trunk/Source/WebCore/platform/graphics/Path.h 2015-07-30 23:41:54 UTC (rev 187621)
@@ -155,7 +155,7 @@
// ensurePlatformPath() will allocate a PlatformPath if it has not yet been and will never return null.
WEBCORE_EXPORT PlatformPathPtr ensurePlatformPath();
- WEBCORE_EXPORT void apply(PathApplierFunction) const;
+ WEBCORE_EXPORT void apply(const PathApplierFunction&) const;
void transform(const AffineTransform&);
void addBeziersForRoundedRect(const FloatRect&, const FloatSize& topLeftRadius, const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const FloatSize& bottomRightRadius);
Modified: trunk/Source/WebCore/platform/graphics/cairo/PathCairo.cpp (187620 => 187621)
--- trunk/Source/WebCore/platform/graphics/cairo/PathCairo.cpp 2015-07-30 23:38:23 UTC (rev 187620)
+++ trunk/Source/WebCore/platform/graphics/cairo/PathCairo.cpp 2015-07-30 23:41:54 UTC (rev 187621)
@@ -390,7 +390,7 @@
return cairo_in_stroke(cr, point.x(), point.y());
}
-void Path::apply(PathApplierFunction function) const
+void Path::apply(const PathApplierFunction& function) const
{
if (isNull())
return;
Modified: trunk/Source/WebCore/platform/graphics/cg/PathCG.cpp (187620 => 187621)
--- trunk/Source/WebCore/platform/graphics/cg/PathCG.cpp 2015-07-30 23:38:23 UTC (rev 187620)
+++ trunk/Source/WebCore/platform/graphics/cg/PathCG.cpp 2015-07-30 23:41:54 UTC (rev 187621)
@@ -375,9 +375,9 @@
return CGPathGetCurrentPoint(m_path);
}
-static void CGPathApplierToPathApplier(void *info, const CGPathElement* element)
+static void CGPathApplierToPathApplier(void* info, const CGPathElement* element)
{
- PathApplierFunction function = *(PathApplierFunction*)info;
+ const PathApplierFunction& function = *(PathApplierFunction*)info;
FloatPoint points[3];
PathElement pelement;
pelement.type = (PathElementType)element->type;
@@ -403,12 +403,12 @@
function(pelement);
}
-void Path::apply(PathApplierFunction function) const
+void Path::apply(const PathApplierFunction& function) const
{
if (isNull())
return;
- CGPathApply(m_path, &function, CGPathApplierToPathApplier);
+ CGPathApply(m_path, (void*)&function, CGPathApplierToPathApplier);
}
}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes