bool Path::strokeContains(StrokeStyleApplier* applier, const FloatPoint& point) const { ASSERT(applier); CGContextRef context = scratchContext(); CGContextSaveGState(context); CGContextBeginPath(context); CGContextAddPath(context, platformPath()); GraphicsContext gc(context); applier->strokeStyle(&gc); bool hitSuccess = CGContextPathContainsPoint(context, point, kCGPathStroke); CGContextRestoreGState(context); return hitSuccess; }
bool RenderPath::strokeContains(const FloatPoint& point, bool requiresStroke) const { if (path().isEmpty()) return false; if (requiresStroke && !SVGPaintServer::strokePaintServer(style(), this)) return false; CGMutablePathRef cgPath = path().platformPath(); CGContextRef context = scratchContext(); CGContextSaveGState(context); CGContextBeginPath(context); CGContextAddPath(context, cgPath); GraphicsContext gc(context); applyStrokeStyleToContext(&gc, style(), this); bool hitSuccess = CGContextPathContainsPoint(context, point, kCGPathStroke); CGContextRestoreGState(context); return hitSuccess; }
bool CGContextPathContainsPoint_wrap(CGContextRef c, float x, float y, uint32 mode) { return CGContextPathContainsPoint(c, CGPointMake(x, y), (CGPathDrawingMode)mode); }