+2009-07-14 Dmitry Titov <dimich@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27266
+ Add hasCurrentPoint() to WebCore::Path.
+ This fixes Skia-based Chromium regression caused by the fix for
+ https://bugs.webkit.org/show_bug.cgi?id=27187.
+ For Skia, the new method always returns 'true', pending actual implementation.
+ This means Chromium still will differ from Gecko behavior, but at least its Canvas
+ will not be completely broken.
+
+ Existing Canvas Layout Tests should pass in Chromium after this change.
+
+ * html/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::lineTo): insteand of Path::isEmpty() test for hasCurrentPoint().
+ (WebCore::CanvasRenderingContext2D::quadraticCurveTo): ditto.
+ (WebCore::CanvasRenderingContext2D::bezierCurveTo): ditto.
+
+ * platform/graphics/Path.h:
+ * platform/graphics/cairo/PathCairo.cpp:
+ (WebCore::Path::hasCurrentPoint):
+ * platform/graphics/cg/PathCG.cpp:
+ (WebCore::Path::isEmpty):
+ (WebCore::Path::hasCurrentPoint):
+ * platform/graphics/qt/PathQt.cpp:
+ (WebCore::Path::hasCurrentPoint):
+ * platform/graphics/skia/PathSkia.cpp:
+ (WebCore::Path::hasCurrentPoint):
+ * platform/graphics/wx/PathWx.cpp:
+ (WebCore::Path::hasCurrentPoint):
+ All these files add a Path::hasCurrentPoint() for various platforms.
+
2009-07-14 Nate Chapin <japhet@chromium.org>
Reviewed by Sam Weinig.
return;
if (!state().m_invertibleCTM)
return;
- if (m_path.isEmpty())
+ if (!m_path.hasCurrentPoint())
m_path.moveTo(FloatPoint(x, y));
m_path.addLineTo(FloatPoint(x, y));
}
return;
if (!state().m_invertibleCTM)
return;
- if (m_path.isEmpty())
+ if (!m_path.hasCurrentPoint())
m_path.moveTo(FloatPoint(cpx, cpy));
m_path.addQuadCurveTo(FloatPoint(cpx, cpy), FloatPoint(x, y));
}
return;
if (!state().m_invertibleCTM)
return;
- if (m_path.isEmpty())
+ if (!m_path.hasCurrentPoint())
m_path.moveTo(FloatPoint(cp1x, cp1y));
m_path.addBezierCurveTo(FloatPoint(cp1x, cp1y), FloatPoint(cp2x, cp2y), FloatPoint(x, y));
}
void clear();
bool isEmpty() const;
+ // Gets the current point of the current path, which is conceptually the final point reached by the path so far.
+ // Note the Path can be empty (isEmpty() == true) and still have a current point.
+ bool hasCurrentPoint() const;
void moveTo(const FloatPoint&);
void addLineTo(const FloatPoint&);