summaryrefslogtreecommitdiff
path: root/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp')
-rw-r--r--Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp b/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
index 4d781a94c..befadb940 100644
--- a/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
+++ b/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
@@ -732,7 +732,7 @@ static inline bool calculateDrawingMode(const GraphicsContextState& state, CGPat
void GraphicsContext::drawPath(const Path& path)
{
- if (paintingDisabled())
+ if (paintingDisabled() || path.isEmpty())
return;
CGContextRef context = platformContext();
@@ -769,7 +769,7 @@ static inline void fillPathWithFillRule(CGContextRef context, WindRule fillRule)
void GraphicsContext::fillPath(const Path& path)
{
- if (paintingDisabled())
+ if (paintingDisabled() || path.isEmpty())
return;
CGContextRef context = platformContext();
@@ -824,7 +824,7 @@ void GraphicsContext::fillPath(const Path& path)
void GraphicsContext::strokePath(const Path& path)
{
- if (paintingDisabled())
+ if (paintingDisabled() || path.isEmpty())
return;
CGContextRef context = platformContext();
@@ -1085,6 +1085,8 @@ void GraphicsContext::clipPath(const Path& path, WindRule clipRule)
if (paintingDisabled())
return;
+ // Why does clipping to an empty path do nothing?
+ // Why is this different from GraphicsContext::clip(const Path&).
if (path.isEmpty())
return;
@@ -1362,7 +1364,8 @@ void GraphicsContext::clipOut(const Path& path)
CGContextBeginPath(platformContext());
CGContextAddRect(platformContext(), CGContextGetClipBoundingBox(platformContext()));
- CGContextAddPath(platformContext(), path.platformPath());
+ if (!path.isEmpty())
+ CGContextAddPath(platformContext(), path.platformPath());
CGContextEOClip(platformContext());
}