3 * Copyright 2011 Google Inc.
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
9 #ifndef SkNWayCanvas_DEFINED
10 #define SkNWayCanvas_DEFINED
14 class SK_API SkNWayCanvas : public SkCanvas {
16 SkNWayCanvas(int width, int height);
17 virtual ~SkNWayCanvas();
19 virtual void addCanvas(SkCanvas*);
20 virtual void removeCanvas(SkCanvas*);
21 virtual void removeAll();
23 ///////////////////////////////////////////////////////////////////////////
24 // These are forwarded to the N canvases we're referencing
26 SkDrawFilter* setDrawFilter(SkDrawFilter*) SK_OVERRIDE;
28 void beginCommentGroup(const char* description) SK_OVERRIDE;
29 void addComment(const char* kywd, const char* value) SK_OVERRIDE;
30 void endCommentGroup() SK_OVERRIDE;
33 SkTDArray<SkCanvas*> fList;
35 void willSave() SK_OVERRIDE;
36 SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveFlags) SK_OVERRIDE;
37 void willRestore() SK_OVERRIDE;
39 void didConcat(const SkMatrix&) SK_OVERRIDE;
40 void didSetMatrix(const SkMatrix&) SK_OVERRIDE;
42 void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK_OVERRIDE;
43 virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
44 const SkPaint&) SK_OVERRIDE;
45 virtual void onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
46 const SkPaint&) SK_OVERRIDE;
47 virtual void onDrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
48 SkScalar constY, const SkPaint&) SK_OVERRIDE;
49 virtual void onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
50 const SkMatrix* matrix, const SkPaint&) SK_OVERRIDE;
51 virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
52 const SkPaint& paint) SK_OVERRIDE;
53 virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
54 const SkPoint texCoords[4], SkXfermode* xmode,
55 const SkPaint& paint) SK_OVERRIDE;
57 void onDrawPaint(const SkPaint&) SK_OVERRIDE;
58 void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPaint&) SK_OVERRIDE;
59 void onDrawRect(const SkRect&, const SkPaint&) SK_OVERRIDE;
60 void onDrawOval(const SkRect&, const SkPaint&) SK_OVERRIDE;
61 void onDrawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE;
62 void onDrawPath(const SkPath&, const SkPaint&) SK_OVERRIDE;
63 void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPaint*) SK_OVERRIDE;
64 void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst, const SkPaint*,
65 DrawBitmapRectFlags flags) SK_OVERRIDE;
66 void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint*) SK_OVERRIDE;
67 void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst,
68 const SkPaint*) SK_OVERRIDE;
69 void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst,
70 const SkPaint*) SK_OVERRIDE;
71 void onDrawSprite(const SkBitmap&, int left, int top, const SkPaint*) SK_OVERRIDE;
72 void onDrawVertices(VertexMode vmode, int vertexCount,
73 const SkPoint vertices[], const SkPoint texs[],
74 const SkColor colors[], SkXfermode* xmode,
75 const uint16_t indices[], int indexCount,
76 const SkPaint&) SK_OVERRIDE;
78 void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
79 void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
80 void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
81 void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE;
83 void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) SK_OVERRIDE;
88 typedef SkCanvas INHERITED;