aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/xps/SkXPSDevice.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/xps/SkXPSDevice.h')
-rw-r--r--src/xps/SkXPSDevice.h120
1 files changed, 38 insertions, 82 deletions
diff --git a/src/xps/SkXPSDevice.h b/src/xps/SkXPSDevice.h
index 0ad9939509..a03b2932ca 100644
--- a/src/xps/SkXPSDevice.h
+++ b/src/xps/SkXPSDevice.h
@@ -16,9 +16,10 @@
#include <XpsObjectModel.h>
#include "SkAutoCoInitialize.h"
-#include "SkBitmapDevice.h"
#include "SkBitSet.h"
+#include "SkBitmapDevice.h"
#include "SkCanvas.h"
+#include "SkClipStackDevice.h"
#include "SkColor.h"
#include "SkPaint.h"
#include "SkPath.h"
@@ -35,7 +36,7 @@
The drawing context for the XPS backend.
*/
-class SkXPSDevice : public SkBaseDevice {
+class SkXPSDevice : public SkClipStackDevice {
public:
SK_API SkXPSDevice(SkISize);
SK_API virtual ~SkXPSDevice();
@@ -73,79 +74,39 @@ public:
bool endPortfolio();
protected:
- void drawPaint(const SkDraw&, const SkPaint& paint) override;
-
- void drawPoints(
- const SkDraw&,
- SkCanvas::PointMode mode,
- size_t count, const SkPoint[],
- const SkPaint& paint) override;
-
- void drawRect(
- const SkDraw&,
- const SkRect& r,
- const SkPaint& paint) override;
-
- void drawRRect(
- const SkDraw&,
- const SkRRect&,
- const SkPaint& paint) override;
-
- void drawPath(
- const SkDraw&,
- const SkPath& platonicPath,
- const SkPaint& paint,
- const SkMatrix* prePathMatrix,
- bool pathIsMutable) override;
-
- void drawBitmap(
- const SkDraw&,
- const SkBitmap& bitmap,
- const SkMatrix& matrix,
- const SkPaint& paint) override;
-
- void drawSprite(
- const SkDraw&,
- const SkBitmap& bitmap,
- int x, int y,
- const SkPaint& paint) override;
-
- void drawText(
- const SkDraw&,
- const void* text, size_t len,
- SkScalar x, SkScalar y,
- const SkPaint& paint) override;
-
- void drawPosText(
- const SkDraw&,
- const void* text, size_t len,
- const SkScalar pos[], int scalarsPerPos,
- const SkPoint& offset, const SkPaint& paint) override;
-
- void drawVertices(
- const SkDraw&,
- SkCanvas::VertexMode,
- int vertexCount, const SkPoint verts[],
- const SkPoint texs[], const SkColor colors[],
- SkBlendMode,
- const uint16_t indices[], int indexCount,
- const SkPaint& paint) override;
-
- void drawDevice(
- const SkDraw&,
- SkBaseDevice* device,
- int x, int y,
- const SkPaint& paint) override;
-
- void drawOval(const SkDraw&, const SkRect&, const SkPaint&) override;
-
- void drawBitmapRect(const SkDraw&,
- const SkBitmap&,
- const SkRect*,
- const SkRect&,
- const SkPaint&,
+ void drawPaint(const SkPaint& paint) override;
+ void drawPoints(SkCanvas::PointMode mode, size_t count,
+ const SkPoint[], const SkPaint& paint) override;
+ void drawRect(const SkRect& r,
+ const SkPaint& paint) override;
+ void drawOval(const SkRect& oval,
+ const SkPaint& paint) override;
+ void drawRRect(const SkRRect& rr,
+ const SkPaint& paint) override;
+ void drawPath(const SkPath& path,
+ const SkPaint& paint,
+ const SkMatrix* prePathMatrix = NULL,
+ bool pathIsMutable = false) override;
+ void drawBitmap(const SkBitmap& bitmap,
+ const SkMatrix& matrix, const SkPaint& paint) override;
+ void drawSprite(const SkBitmap& bitmap,
+ int x, int y, const SkPaint& paint) override;
+ void drawBitmapRect(const SkBitmap&,
+ const SkRect* srcOrNull, const SkRect& dst,
+ const SkPaint& paint,
SkCanvas::SrcRectConstraint) override;
-
+ void drawText(const void* text, size_t len,
+ SkScalar x, SkScalar y, const SkPaint& paint) override;
+ void drawPosText(const void* text, size_t len,
+ const SkScalar pos[], int scalarsPerPos,
+ const SkPoint& offset, const SkPaint& paint) override;
+ void drawVertices(SkCanvas::VertexMode, int vertexCount,
+ const SkPoint verts[], const SkPoint texs[],
+ const SkColor colors[], SkBlendMode,
+ const uint16_t indices[], int indexCount,
+ const SkPaint& paint) override;
+ void drawDevice(SkBaseDevice*, int x, int y,
+ const SkPaint&) override;
private:
class TypefaceUse : ::SkNoncopyable {
@@ -198,7 +159,6 @@ private:
IXpsOMImageResource** image);
void internalDrawRect(
- const SkDraw&,
const SkRect& r,
bool transformRect,
const SkPaint& paint);
@@ -257,7 +217,6 @@ private:
TypefaceUse** fontResource);
HRESULT AddGlyphs(
- const SkDraw& d,
IXpsOMObjectFactory* xpsFactory,
IXpsOMCanvas* canvas,
TypefaceUse* font,
@@ -289,16 +248,14 @@ private:
const SkColor color,
IXpsOMVisualCollection* visuals);
- HRESULT clip(
- IXpsOMVisual* xpsVisual,
- const SkDraw& d);
+ HRESULT clip(IXpsOMVisual* xpsVisual);
+
HRESULT clipToPath(
IXpsOMVisual* xpsVisual,
const SkPath& clipPath,
XPS_FILL_RULE fillRule);
HRESULT drawInverseWindingPath(
- const SkDraw& d,
const SkPath& devicePath,
IXpsOMPath* xpsPath);
@@ -315,7 +272,6 @@ private:
const SkIRect& clip, SkIRect* clipIRect);
HRESULT applyMask(
- const SkDraw& d,
const SkMask& mask,
const SkVector& ppuScale,
IXpsOMPath* shadedPath);
@@ -326,7 +282,7 @@ private:
SkXPSDevice(const SkXPSDevice&);
void operator=(const SkXPSDevice&);
- typedef SkBaseDevice INHERITED;
+ typedef SkClipStackDevice INHERITED;
};
#endif // SK_BUILD_FOR_WIN