Beispiel #1
0
bool Path::contains(const FloatPoint& point, WindRule rule) const {
  SkScalar x = WebCoreFloatToSkScalar(point.x());
  SkScalar y = WebCoreFloatToSkScalar(point.y());
  SkPath::FillType fillType = WebCoreWindRuleToSkFillType(rule);
  if (m_path.getFillType() != fillType) {
    SkPath tmp(m_path);
    tmp.setFillType(fillType);
    return tmp.contains(x, y);
  }
  return m_path.contains(x, y);
}
Beispiel #2
0
void Path::setWindRule(const WindRule rule) {
  m_path.setFillType(WebCoreWindRuleToSkFillType(rule));
}
static SkPath::FillType fillRuleFromStyle(const PaintInfo& paintInfo, const SVGComputedStyle& svgStyle)
{
    return WebCoreWindRuleToSkFillType(paintInfo.isRenderingClipPathAsMaskImage() ? svgStyle.clipRule() : svgStyle.fillRule());
}