summaryrefslogtreecommitdiff
path: root/gfx/2d/PathD2D.h
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/2d/PathD2D.h')
-rw-r--r--gfx/2d/PathD2D.h24
1 files changed, 18 insertions, 6 deletions
diff --git a/gfx/2d/PathD2D.h b/gfx/2d/PathD2D.h
index 9b72b6cdb..3afd82783 100644
--- a/gfx/2d/PathD2D.h
+++ b/gfx/2d/PathD2D.h
@@ -6,8 +6,9 @@
#ifndef MOZILLA_GFX_PATHD2D_H_
#define MOZILLA_GFX_PATHD2D_H_
+#include <d2d1.h>
+
#include "2D.h"
-#include "moz-d2d1-1.h"
namespace mozilla {
namespace gfx {
@@ -17,11 +18,13 @@ class PathD2D;
class PathBuilderD2D : public PathBuilder
{
public:
- PathBuilderD2D(ID2D1GeometrySink *aSink, ID2D1PathGeometry *aGeom, FillRule aFillRule)
+ MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathBuilderD2D)
+ PathBuilderD2D(ID2D1GeometrySink *aSink, ID2D1PathGeometry *aGeom, FillRule aFillRule, BackendType aBackendType)
: mSink(aSink)
, mGeometry(aGeom)
, mFigureActive(false)
, mFillRule(aFillRule)
+ , mBackendType(aBackendType)
{
}
virtual ~PathBuilderD2D();
@@ -40,6 +43,8 @@ public:
virtual TemporaryRef<Path> Finish();
+ virtual BackendType GetBackendType() const { return mBackendType; }
+
ID2D1GeometrySink *GetSink() { return mSink; }
private:
@@ -54,24 +59,27 @@ private:
Point mCurrentPoint;
Point mBeginPoint;
FillRule mFillRule;
+ BackendType mBackendType;
};
class PathD2D : public Path
{
public:
+ MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathD2D)
PathD2D(ID2D1PathGeometry *aGeometry, bool aEndedActive,
- const Point &aEndPoint, FillRule aFillRule)
+ const Point &aEndPoint, FillRule aFillRule, BackendType aBackendType)
: mGeometry(aGeometry)
, mEndedActive(aEndedActive)
, mEndPoint(aEndPoint)
, mFillRule(aFillRule)
+ , mBackendType(aBackendType)
{}
- virtual BackendType GetBackendType() const { return BACKEND_DIRECT2D; }
+ virtual BackendType GetBackendType() const { return mBackendType; }
- 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;
@@ -84,17 +92,21 @@ public:
virtual Rect GetStrokedBounds(const StrokeOptions &aStrokeOptions,
const Matrix &aTransform = Matrix()) const;
+ virtual void StreamToSink(PathSink *aSink) const;
+
virtual FillRule GetFillRule() const { return mFillRule; }
ID2D1Geometry *GetGeometry() { return mGeometry; }
private:
friend class DrawTargetD2D;
+ friend class DrawTargetD2D1;
mutable RefPtr<ID2D1PathGeometry> mGeometry;
bool mEndedActive;
Point mEndPoint;
FillRule mFillRule;
+ BackendType mBackendType;
};
}