summaryrefslogtreecommitdiff
path: root/gfx/2d/PathCG.h
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/2d/PathCG.h')
-rw-r--r--gfx/2d/PathCG.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/gfx/2d/PathCG.h b/gfx/2d/PathCG.h
index 660e91dc0..9598edb87 100644
--- a/gfx/2d/PathCG.h
+++ b/gfx/2d/PathCG.h
@@ -17,6 +17,7 @@ class PathCG;
class PathBuilderCG : public PathBuilder
{
public:
+ MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathBuilderCG)
// absorbs a reference of aPath
PathBuilderCG(CGMutablePathRef aPath, FillRule aFillRule)
: mFillRule(aFillRule)
@@ -24,7 +25,7 @@ public:
mCGPath = aPath;
}
- PathBuilderCG(FillRule aFillRule)
+ explicit PathBuilderCG(FillRule aFillRule)
: mFillRule(aFillRule)
{
mCGPath = CGPathCreateMutable();
@@ -46,8 +47,11 @@ public:
virtual TemporaryRef<Path> Finish();
+ virtual BackendType GetBackendType() const { return BackendType::COREGRAPHICS; }
+
private:
friend class PathCG;
+ friend class ScaledFontMac;
void EnsureActive(const Point &aPoint);
@@ -60,6 +64,7 @@ private:
class PathCG : public Path
{
public:
+ MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathCG)
PathCG(CGMutablePathRef aPath, FillRule aFillRule)
: mPath(aPath)
, mFillRule(aFillRule)
@@ -68,13 +73,13 @@ public:
}
virtual ~PathCG() { CGPathRelease(mPath); }
- // Paths will always return BACKEND_COREGRAPHICS, but note that they
- // are compatible with BACKEND_COREGRAPHICS_ACCELERATED backend.
- virtual BackendType GetBackendType() const { return BACKEND_COREGRAPHICS; }
+ // Paths will always return BackendType::COREGRAPHICS, but note that they
+ // are compatible with BackendType::COREGRAPHICS_ACCELERATED backend.
+ virtual BackendType GetBackendType() const { return BackendType::COREGRAPHICS; }
- virtual TemporaryRef<PathBuilder> CopyToBuilder(FillRule aFillRule = FILL_WINDING) const;
+ virtual TemporaryRef<PathBuilder> CopyToBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const;
virtual TemporaryRef<PathBuilder> TransformedCopyToBuilder(const Matrix &aTransform,
- FillRule aFillRule = FILL_WINDING) const;
+ FillRule aFillRule = FillRule::FILL_WINDING) const;
virtual bool ContainsPoint(const Point &aPoint, const Matrix &aTransform) const;
virtual bool StrokeContainsPoint(const StrokeOptions &aStrokeOptions,
@@ -84,6 +89,8 @@ public:
virtual Rect GetStrokedBounds(const StrokeOptions &aStrokeOptions,
const Matrix &aTransform = Matrix()) const;
+ virtual void StreamToSink(PathSink *aSink) const;
+
virtual FillRule GetFillRule() const { return mFillRule; }
CGMutablePathRef GetPath() const { return mPath; }
@@ -92,7 +99,6 @@ private:
friend class DrawTargetCG;
CGMutablePathRef mPath;
- bool mEndedActive;
Point mEndPoint;
FillRule mFillRule;
};