Diff
Modified: trunk/Source/WebCore/ChangeLog (187491 => 187492)
--- trunk/Source/WebCore/ChangeLog 2015-07-28 18:20:50 UTC (rev 187491)
+++ trunk/Source/WebCore/ChangeLog 2015-07-28 18:22:00 UTC (rev 187492)
@@ -1,3 +1,31 @@
+2015-07-27 Simon Fraser <[email protected]>
+
+ PathApplierFunction should take a reference to a PathElement
+ https://bugs.webkit.org/show_bug.cgi?id=147337
+
+ Reviewed by Dan Bates.
+
+ Convert PathApplierFunction to take a const PathElement&, since it can never be null.
+
+ * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
+ (ConvertPathToScreenSpaceFunction):
+ * inspector/InspectorOverlay.cpp:
+ (WebCore::appendPathSegment):
+ * platform/graphics/Path.cpp:
+ (WebCore::pathLengthApplierFunction):
+ * platform/graphics/Path.h:
+ * platform/graphics/PathTraversalState.h:
+ (WebCore::PathTraversalState::processPathElement):
+ * platform/graphics/cg/PathCG.cpp:
+ (WebCore::CGPathApplierToPathApplier):
+ * rendering/svg/SVGMarkerData.h:
+ (WebCore::SVGMarkerData::updateFromPathElement):
+ (WebCore::SVGMarkerData::updateMarkerDataForPathElement):
+ * rendering/svg/SVGSubpathData.h:
+ (WebCore::SVGSubpathData::updateFromPathElement):
+ * svg/SVGPathUtilities.cpp:
+ (WebCore::pathIteratorForBuildingString):
+
2015-07-28 Jer Noble <[email protected]>
[iOS] Notify fullscreen controller in UIProcess whether external playback is allowed
Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm (187491 => 187492)
--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm 2015-07-28 18:20:50 UTC (rev 187491)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm 2015-07-28 18:22:00 UTC (rev 187492)
@@ -247,36 +247,36 @@
CGMutablePathRef path;
};
-static void ConvertPathToScreenSpaceFunction(void* info, const PathElement* element)
+static void ConvertPathToScreenSpaceFunction(void* info, const PathElement& element)
{
PathConversionInfo* conversion = (PathConversionInfo*)info;
WebAccessibilityObjectWrapperBase *wrapper = conversion->wrapper;
CGMutablePathRef newPath = conversion->path;
- switch (element->type) {
+ switch (element.type) {
case PathElementMoveToPoint:
{
- CGPoint newPoint = [wrapper convertPointToScreenSpace:element->points[0]];
+ CGPoint newPoint = [wrapper convertPointToScreenSpace:element.points[0]];
CGPathMoveToPoint(newPath, nil, newPoint.x, newPoint.y);
break;
}
case PathElementAddLineToPoint:
{
- CGPoint newPoint = [wrapper convertPointToScreenSpace:element->points[0]];
+ CGPoint newPoint = [wrapper convertPointToScreenSpace:element.points[0]];
CGPathAddLineToPoint(newPath, nil, newPoint.x, newPoint.y);
break;
}
case PathElementAddQuadCurveToPoint:
{
- CGPoint newPoint1 = [wrapper convertPointToScreenSpace:element->points[0]];
- CGPoint newPoint2 = [wrapper convertPointToScreenSpace:element->points[1]];
+ CGPoint newPoint1 = [wrapper convertPointToScreenSpace:element.points[0]];
+ CGPoint newPoint2 = [wrapper convertPointToScreenSpace:element.points[1]];
CGPathAddQuadCurveToPoint(newPath, nil, newPoint1.x, newPoint1.y, newPoint2.x, newPoint2.y);
break;
}
case PathElementAddCurveToPoint:
{
- CGPoint newPoint1 = [wrapper convertPointToScreenSpace:element->points[0]];
- CGPoint newPoint2 = [wrapper convertPointToScreenSpace:element->points[1]];
- CGPoint newPoint3 = [wrapper convertPointToScreenSpace:element->points[2]];
+ CGPoint newPoint1 = [wrapper convertPointToScreenSpace:element.points[0]];
+ CGPoint newPoint2 = [wrapper convertPointToScreenSpace:element.points[1]];
+ CGPoint newPoint3 = [wrapper convertPointToScreenSpace:element.points[2]];
CGPathAddCurveToPoint(newPath, nil, newPoint1.x, newPoint1.y, newPoint2.x, newPoint2.y, newPoint3.x, newPoint3.y);
break;
}
Modified: trunk/Source/WebCore/inspector/InspectorOverlay.cpp (187491 => 187492)
--- trunk/Source/WebCore/inspector/InspectorOverlay.cpp 2015-07-28 18:20:50 UTC (rev 187491)
+++ trunk/Source/WebCore/inspector/InspectorOverlay.cpp 2015-07-28 18:22:00 UTC (rev 187492)
@@ -609,26 +609,26 @@
}
// Used as a functor for Shape::apply, which has not been cleaned up to use modern C++.
-static void appendPathSegment(void* info, const PathElement* pathElement)
+static void appendPathSegment(void* info, const PathElement& pathElement)
{
PathApplyInfo& pathApplyInfo = *static_cast<PathApplyInfo*>(info);
FloatPoint point;
- switch (pathElement->type) {
+ switch (pathElement.type) {
// The points member will contain 1 value.
case PathElementMoveToPoint:
- appendPathCommandAndPoints(pathApplyInfo, ASCIILiteral("M"), pathElement->points, 1);
+ appendPathCommandAndPoints(pathApplyInfo, ASCIILiteral("M"), pathElement.points, 1);
break;
// The points member will contain 1 value.
case PathElementAddLineToPoint:
- appendPathCommandAndPoints(pathApplyInfo, ASCIILiteral("L"), pathElement->points, 1);
+ appendPathCommandAndPoints(pathApplyInfo, ASCIILiteral("L"), pathElement.points, 1);
break;
// The points member will contain 3 values.
case PathElementAddCurveToPoint:
- appendPathCommandAndPoints(pathApplyInfo, ASCIILiteral("C"), pathElement->points, 3);
+ appendPathCommandAndPoints(pathApplyInfo, ASCIILiteral("C"), pathElement.points, 3);
break;
// The points member will contain 2 values.
case PathElementAddQuadCurveToPoint:
- appendPathCommandAndPoints(pathApplyInfo, ASCIILiteral("Q"), pathElement->points, 2);
+ appendPathCommandAndPoints(pathApplyInfo, ASCIILiteral("Q"), pathElement.points, 2);
break;
// The points member will contain no values.
case PathElementCloseSubpath:
Modified: trunk/Source/WebCore/platform/graphics/Path.cpp (187491 => 187492)
--- trunk/Source/WebCore/platform/graphics/Path.cpp 2015-07-28 18:20:50 UTC (rev 187491)
+++ trunk/Source/WebCore/platform/graphics/Path.cpp 2015-07-28 18:22:00 UTC (rev 187492)
@@ -39,7 +39,7 @@
namespace WebCore {
-static void pathLengthApplierFunction(void* info, const PathElement* element)
+static void pathLengthApplierFunction(void* info, const PathElement& element)
{
PathTraversalState& traversalState = *static_cast<PathTraversalState*>(info);
traversalState.processPathElement(element);
Modified: trunk/Source/WebCore/platform/graphics/Path.h (187491 => 187492)
--- trunk/Source/WebCore/platform/graphics/Path.h 2015-07-28 18:20:50 UTC (rev 187491)
+++ trunk/Source/WebCore/platform/graphics/Path.h 2015-07-28 18:22:00 UTC (rev 187492)
@@ -80,7 +80,7 @@
FloatPoint* points;
};
- typedef void (*PathApplierFunction)(void* info, const PathElement*);
+ typedef void (*PathApplierFunction)(void* info, const PathElement&);
class Path {
WTF_MAKE_FAST_ALLOCATED;
Modified: trunk/Source/WebCore/platform/graphics/PathTraversalState.h (187491 => 187492)
--- trunk/Source/WebCore/platform/graphics/PathTraversalState.h 2015-07-28 18:20:50 UTC (rev 187491)
+++ trunk/Source/WebCore/platform/graphics/PathTraversalState.h 2015-07-28 18:22:00 UTC (rev 187492)
@@ -44,7 +44,7 @@
public:
bool processPathElement(PathElementType, const FloatPoint*);
- bool processPathElement(const PathElement* element) { return processPathElement(element->type, element->points); }
+ bool processPathElement(const PathElement& element) { return processPathElement(element.type, element.points); }
Action action() const { return m_action; }
void setAction(Action action) { m_action = action; }
Modified: trunk/Source/WebCore/platform/graphics/cairo/FontCairo.cpp (187491 => 187492)
--- trunk/Source/WebCore/platform/graphics/cairo/FontCairo.cpp 2015-07-28 18:20:50 UTC (rev 187491)
+++ trunk/Source/WebCore/platform/graphics/cairo/FontCairo.cpp 2015-07-28 18:22:00 UTC (rev 187492)
@@ -174,27 +174,27 @@
// pseudo-contour and the vertical center of the underline found in GlyphIterationState::centerOfLine.
// It keeps track of the leftmost and rightmost intersection in GlyphIterationState::minX and
// GlyphIterationState::maxX.
-static void findPathIntersections(void* stateAsVoidPointer, const PathElement* element)
+static void findPathIntersections(void* stateAsVoidPointer, const PathElement& element)
{
auto& state = *static_cast<GlyphIterationState*>(stateAsVoidPointer);
bool doIntersection = false;
FloatPoint point = FloatPoint();
- switch (element->type) {
+ switch (element.type) {
case PathElementMoveToPoint:
- state.startingPoint = element->points[0];
- state.currentPoint = element->points[0];
+ state.startingPoint = element.points[0];
+ state.currentPoint = element.points[0];
break;
case PathElementAddLineToPoint:
doIntersection = true;
- point = element->points[0];
+ point = element.points[0];
break;
case PathElementAddQuadCurveToPoint:
doIntersection = true;
- point = element->points[1];
+ point = element.points[1];
break;
case PathElementAddCurveToPoint:
doIntersection = true;
- point = element->points[2];
+ point = element.points[2];
break;
case PathElementCloseSubpath:
doIntersection = true;
Modified: trunk/Source/WebCore/platform/graphics/cg/PathCG.cpp (187491 => 187492)
--- trunk/Source/WebCore/platform/graphics/cg/PathCG.cpp 2015-07-28 18:20:50 UTC (rev 187491)
+++ trunk/Source/WebCore/platform/graphics/cg/PathCG.cpp 2015-07-28 18:22:00 UTC (rev 187492)
@@ -380,7 +380,7 @@
PathApplierFunction function;
};
-static void CGPathApplierToPathApplier(void *info, const CGPathElement *element)
+static void CGPathApplierToPathApplier(void *info, const CGPathElement* element)
{
PathApplierInfo* pinfo = (PathApplierInfo*)info;
FloatPoint points[3];
@@ -405,7 +405,7 @@
case kCGPathElementCloseSubpath:
break;
}
- pinfo->function(pinfo->info, &pelement);
+ pinfo->function(pinfo->info, pelement);
}
void Path::apply(void* info, PathApplierFunction function) const
Modified: trunk/Source/WebCore/rendering/svg/SVGMarkerData.h (187491 => 187492)
--- trunk/Source/WebCore/rendering/svg/SVGMarkerData.h 2015-07-28 18:20:50 UTC (rev 187491)
+++ trunk/Source/WebCore/rendering/svg/SVGMarkerData.h 2015-07-28 18:22:00 UTC (rev 187492)
@@ -54,12 +54,12 @@
{
}
- static void updateFromPathElement(void* info, const PathElement* element)
+ static void updateFromPathElement(void* info, const PathElement& element)
{
SVGMarkerData* markerData = static_cast<SVGMarkerData*>(info);
// First update the outslope for the previous element.
- markerData->updateOutslope(element->points[0]);
+ markerData->updateOutslope(element.points[0]);
// Record the marker for the previous element.
if (markerData->m_elementIndex > 0) {
@@ -109,11 +109,11 @@
m_outslopePoints[1] = point;
}
- void updateMarkerDataForPathElement(const PathElement* element)
+ void updateMarkerDataForPathElement(const PathElement& element)
{
- FloatPoint* points = element->points;
+ FloatPoint* points = element.points;
- switch (element->type) {
+ switch (element.type) {
case PathElementAddQuadCurveToPoint:
// FIXME: https://bugs.webkit.org/show_bug.cgi?id=33115 (PathElementAddQuadCurveToPoint not handled for <marker>)
m_origin = points[1];
Modified: trunk/Source/WebCore/rendering/svg/SVGSubpathData.h (187491 => 187492)
--- trunk/Source/WebCore/rendering/svg/SVGSubpathData.h 2015-07-28 18:20:50 UTC (rev 187491)
+++ trunk/Source/WebCore/rendering/svg/SVGSubpathData.h 2015-07-28 18:22:00 UTC (rev 187492)
@@ -36,35 +36,35 @@
m_movePoint.set(0, 0);
}
- static void updateFromPathElement(void* info, const PathElement* element)
+ static void updateFromPathElement(void* info, const PathElement& element)
{
SVGSubpathData* subpathFinder = static_cast<SVGSubpathData*>(info);
- switch (element->type) {
+ switch (element.type) {
case PathElementMoveToPoint:
if (subpathFinder->m_pathIsZeroLength && !subpathFinder->m_haveSeenMoveOnly)
subpathFinder->m_zeroLengthSubpathLocations.append(subpathFinder->m_lastPoint);
- subpathFinder->m_lastPoint = subpathFinder->m_movePoint = element->points[0];
+ subpathFinder->m_lastPoint = subpathFinder->m_movePoint = element.points[0];
subpathFinder->m_haveSeenMoveOnly = true;
subpathFinder->m_pathIsZeroLength = true;
break;
case PathElementAddLineToPoint:
- if (subpathFinder->m_lastPoint != element->points[0]) {
+ if (subpathFinder->m_lastPoint != element.points[0]) {
subpathFinder->m_pathIsZeroLength = false;
- subpathFinder->m_lastPoint = element->points[0];
+ subpathFinder->m_lastPoint = element.points[0];
}
subpathFinder->m_haveSeenMoveOnly = false;
break;
case PathElementAddQuadCurveToPoint:
- if (subpathFinder->m_lastPoint != element->points[0] || element->points[0] != element->points[1]) {
+ if (subpathFinder->m_lastPoint != element.points[0] || element.points[0] != element.points[1]) {
subpathFinder->m_pathIsZeroLength = false;
- subpathFinder->m_lastPoint = element->points[1];
+ subpathFinder->m_lastPoint = element.points[1];
}
subpathFinder->m_haveSeenMoveOnly = false;
break;
case PathElementAddCurveToPoint:
- if (subpathFinder->m_lastPoint != element->points[0] || element->points[0] != element->points[1] || element->points[1] != element->points[2]) {
+ if (subpathFinder->m_lastPoint != element.points[0] || element.points[0] != element.points[1] || element.points[1] != element.points[2]) {
subpathFinder->m_pathIsZeroLength = false;
- subpathFinder->m_lastPoint = element->points[2];
+ subpathFinder->m_lastPoint = element.points[2];
}
subpathFinder->m_haveSeenMoveOnly = false;
break;
Modified: trunk/Source/WebCore/svg/SVGPathUtilities.cpp (187491 => 187492)
--- trunk/Source/WebCore/svg/SVGPathUtilities.cpp 2015-07-28 18:20:50 UTC (rev 187491)
+++ trunk/Source/WebCore/svg/SVGPathUtilities.cpp 2015-07-28 18:22:00 UTC (rev 187492)
@@ -331,22 +331,22 @@
return ok;
}
-static void pathIteratorForBuildingString(void* info, const PathElement* pathElement)
+static void pathIteratorForBuildingString(void* info, const PathElement& pathElement)
{
SVGPathConsumer* consumer = static_cast<SVGPathConsumer*>(info);
- switch (pathElement->type) {
+ switch (pathElement.type) {
case PathElementMoveToPoint:
- consumer->moveTo(pathElement->points[0], false, AbsoluteCoordinates);
+ consumer->moveTo(pathElement.points[0], false, AbsoluteCoordinates);
break;
case PathElementAddLineToPoint:
- consumer->lineTo(pathElement->points[0], AbsoluteCoordinates);
+ consumer->lineTo(pathElement.points[0], AbsoluteCoordinates);
break;
case PathElementAddQuadCurveToPoint:
- consumer->curveToQuadratic(pathElement->points[0], pathElement->points[1], AbsoluteCoordinates);
+ consumer->curveToQuadratic(pathElement.points[0], pathElement.points[1], AbsoluteCoordinates);
break;
case PathElementAddCurveToPoint:
- consumer->curveToCubic(pathElement->points[0], pathElement->points[1], pathElement->points[2], AbsoluteCoordinates);
+ consumer->curveToCubic(pathElement.points[0], pathElement.points[1], pathElement.points[2], AbsoluteCoordinates);
break;
case PathElementCloseSubpath:
consumer->closePath();
Modified: trunk/Source/WebKit2/ChangeLog (187491 => 187492)
--- trunk/Source/WebKit2/ChangeLog 2015-07-28 18:20:50 UTC (rev 187491)
+++ trunk/Source/WebKit2/ChangeLog 2015-07-28 18:22:00 UTC (rev 187492)
@@ -1,3 +1,16 @@
+2015-07-27 Simon Fraser <[email protected]>
+
+ PathApplierFunction should take a reference to a PathElement
+ https://bugs.webkit.org/show_bug.cgi?id=147337
+
+ Reviewed by Dan Bates.
+
+ Convert PathApplierFunction to take a const PathElement&, since it can never be null.
+
+ * Shared/WebCoreArgumentCoders.cpp:
+ (IPC::pathPointCountApplierFunction):
+ (IPC::pathEncodeApplierFunction):
+
2015-07-28 Jer Noble <[email protected]>
[iOS] Notify fullscreen controller in UIProcess whether external playback is allowed
Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp (187491 => 187492)
--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp 2015-07-28 18:20:50 UTC (rev 187491)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp 2015-07-28 18:22:00 UTC (rev 187492)
@@ -373,33 +373,33 @@
return SimpleArgumentCoder<IntSize>::decode(decoder, intSize);
}
-static void pathPointCountApplierFunction(void* info, const PathElement*)
+static void pathPointCountApplierFunction(void* info, const PathElement&)
{
uint64_t* pointCount = static_cast<uint64_t*>(info);
++*pointCount;
}
-static void pathEncodeApplierFunction(void* info, const PathElement* element)
+static void pathEncodeApplierFunction(void* info, const PathElement& element)
{
ArgumentEncoder& encoder = *static_cast<ArgumentEncoder*>(info);
- encoder.encodeEnum(element->type);
+ encoder.encodeEnum(element.type);
- switch (element->type) {
+ switch (element.type) {
case PathElementMoveToPoint: // The points member will contain 1 value.
- encoder << element->points[0];
+ encoder << element.points[0];
break;
case PathElementAddLineToPoint: // The points member will contain 1 value.
- encoder << element->points[0];
+ encoder << element.points[0];
break;
case PathElementAddQuadCurveToPoint: // The points member will contain 2 values.
- encoder << element->points[0];
- encoder << element->points[1];
+ encoder << element.points[0];
+ encoder << element.points[1];
break;
case PathElementAddCurveToPoint: // The points member will contain 3 values.
- encoder << element->points[0];
- encoder << element->points[1];
- encoder << element->points[2];
+ encoder << element.points[0];
+ encoder << element.points[1];
+ encoder << element.points[2];
break;
case PathElementCloseSubpath: // The points member will contain no values.
break;