reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 1 | |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2011 Google Inc. |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
| 7 | */ |
| 8 | |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 9 | #ifndef SkNWayCanvas_DEFINED |
| 10 | #define SkNWayCanvas_DEFINED |
| 11 | |
| 12 | #include "SkCanvas.h" |
| 13 | |
commit-bot@chromium.org | e1a81d2 | 2013-07-15 22:49:37 +0000 | [diff] [blame] | 14 | class SK_API SkNWayCanvas : public SkCanvas { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 15 | public: |
djsollen@google.com | f0a062b | 2012-05-01 16:50:25 +0000 | [diff] [blame] | 16 | SkNWayCanvas(int width, int height); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 17 | virtual ~SkNWayCanvas(); |
vandebo@chromium.org | 74b4619 | 2012-01-28 01:45:11 +0000 | [diff] [blame] | 18 | |
djsollen@google.com | 339e79f | 2013-09-04 17:16:00 +0000 | [diff] [blame] | 19 | virtual void addCanvas(SkCanvas*); |
| 20 | virtual void removeCanvas(SkCanvas*); |
| 21 | virtual void removeAll(); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 22 | |
| 23 | /////////////////////////////////////////////////////////////////////////// |
| 24 | // These are forwarded to the N canvases we're referencing |
| 25 | |
reed@google.com | 43d7484 | 2011-12-07 14:46:39 +0000 | [diff] [blame] | 26 | virtual int save(SaveFlags) SK_OVERRIDE; |
| 27 | virtual int saveLayer(const SkRect* bounds, const SkPaint*, |
| 28 | SaveFlags) SK_OVERRIDE; |
| 29 | virtual void restore() SK_OVERRIDE; |
| 30 | virtual bool translate(SkScalar dx, SkScalar dy) SK_OVERRIDE; |
| 31 | virtual bool scale(SkScalar sx, SkScalar sy) SK_OVERRIDE; |
| 32 | virtual bool rotate(SkScalar degrees) SK_OVERRIDE; |
| 33 | virtual bool skew(SkScalar sx, SkScalar sy) SK_OVERRIDE; |
| 34 | virtual bool concat(const SkMatrix& matrix) SK_OVERRIDE; |
| 35 | virtual void setMatrix(const SkMatrix& matrix) SK_OVERRIDE; |
commit-bot@chromium.org | be65a4c | 2013-11-14 19:02:41 +0000 | [diff] [blame] | 36 | virtual void clear(SkColor) SK_OVERRIDE; |
reed@google.com | 43d7484 | 2011-12-07 14:46:39 +0000 | [diff] [blame] | 37 | virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE; |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 38 | virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[], |
reed@google.com | 43d7484 | 2011-12-07 14:46:39 +0000 | [diff] [blame] | 39 | const SkPaint&) SK_OVERRIDE; |
bsalomon@google.com | 7ce564c | 2013-10-22 16:54:15 +0000 | [diff] [blame] | 40 | virtual void drawRect(const SkRect&, const SkPaint&) SK_OVERRIDE; |
commit-bot@chromium.org | be65a4c | 2013-11-14 19:02:41 +0000 | [diff] [blame] | 41 | virtual void drawOval(const SkRect&, const SkPaint&) SK_OVERRIDE; |
reed@google.com | 4ed0fb7 | 2012-12-12 20:48:18 +0000 | [diff] [blame] | 42 | virtual void drawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE; |
bsalomon@google.com | 7ce564c | 2013-10-22 16:54:15 +0000 | [diff] [blame] | 43 | virtual void drawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE; |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 44 | virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top, |
reed@google.com | 43d7484 | 2011-12-07 14:46:39 +0000 | [diff] [blame] | 45 | const SkPaint*) SK_OVERRIDE; |
reed@google.com | 7112173 | 2012-09-18 15:14:33 +0000 | [diff] [blame] | 46 | virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, |
commit-bot@chromium.org | eed779d | 2013-08-16 10:24:37 +0000 | [diff] [blame] | 47 | const SkRect& dst, const SkPaint* paint, |
| 48 | DrawBitmapRectFlags flags) SK_OVERRIDE; |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 49 | virtual void drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& m, |
reed@google.com | 43d7484 | 2011-12-07 14:46:39 +0000 | [diff] [blame] | 50 | const SkPaint*) SK_OVERRIDE; |
commit-bot@chromium.org | be65a4c | 2013-11-14 19:02:41 +0000 | [diff] [blame] | 51 | virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, |
| 52 | const SkRect& dst, |
| 53 | const SkPaint* paint = NULL) SK_OVERRIDE; |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 54 | virtual void drawSprite(const SkBitmap& bitmap, int left, int top, |
reed@google.com | 43d7484 | 2011-12-07 14:46:39 +0000 | [diff] [blame] | 55 | const SkPaint*) SK_OVERRIDE; |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 56 | virtual void drawText(const void* text, size_t byteLength, SkScalar x, |
reed@google.com | 43d7484 | 2011-12-07 14:46:39 +0000 | [diff] [blame] | 57 | SkScalar y, const SkPaint&) SK_OVERRIDE; |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 58 | virtual void drawPosText(const void* text, size_t byteLength, |
reed@google.com | 43d7484 | 2011-12-07 14:46:39 +0000 | [diff] [blame] | 59 | const SkPoint pos[], const SkPaint&) SK_OVERRIDE; |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 60 | virtual void drawPosTextH(const void* text, size_t byteLength, |
| 61 | const SkScalar xpos[], SkScalar constY, |
reed@google.com | 43d7484 | 2011-12-07 14:46:39 +0000 | [diff] [blame] | 62 | const SkPaint&) SK_OVERRIDE; |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 63 | virtual void drawTextOnPath(const void* text, size_t byteLength, |
| 64 | const SkPath& path, const SkMatrix* matrix, |
reed@google.com | 43d7484 | 2011-12-07 14:46:39 +0000 | [diff] [blame] | 65 | const SkPaint&) SK_OVERRIDE; |
| 66 | virtual void drawPicture(SkPicture&) SK_OVERRIDE; |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 67 | virtual void drawVertices(VertexMode vmode, int vertexCount, |
| 68 | const SkPoint vertices[], const SkPoint texs[], |
| 69 | const SkColor colors[], SkXfermode* xmode, |
| 70 | const uint16_t indices[], int indexCount, |
reed@google.com | 43d7484 | 2011-12-07 14:46:39 +0000 | [diff] [blame] | 71 | const SkPaint&) SK_OVERRIDE; |
commit-bot@chromium.org | be65a4c | 2013-11-14 19:02:41 +0000 | [diff] [blame] | 72 | virtual void drawData(const void* data, size_t length) SK_OVERRIDE; |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 73 | |
reed@google.com | 43d7484 | 2011-12-07 14:46:39 +0000 | [diff] [blame] | 74 | virtual SkBounder* setBounder(SkBounder*) SK_OVERRIDE; |
| 75 | virtual SkDrawFilter* setDrawFilter(SkDrawFilter*) SK_OVERRIDE; |
vandebo@chromium.org | 74b4619 | 2012-01-28 01:45:11 +0000 | [diff] [blame] | 76 | |
commit-bot@chromium.org | 14cec91 | 2013-07-20 15:03:26 +0000 | [diff] [blame] | 77 | virtual void beginCommentGroup(const char* description) SK_OVERRIDE; |
| 78 | virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE; |
| 79 | virtual void endCommentGroup() SK_OVERRIDE; |
| 80 | |
djsollen@google.com | 339e79f | 2013-09-04 17:16:00 +0000 | [diff] [blame] | 81 | protected: |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 82 | SkTDArray<SkCanvas*> fList; |
vandebo@chromium.org | 74b4619 | 2012-01-28 01:45:11 +0000 | [diff] [blame] | 83 | |
commit-bot@chromium.org | ab58273 | 2014-02-21 12:20:45 +0000 | [diff] [blame] | 84 | virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK_OVERRIDE; |
| 85 | |
robertphillips@google.com | 392c9be | 2014-02-28 14:35:45 +0000 | [diff] [blame^] | 86 | virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE; |
| 87 | virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE; |
| 88 | virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE; |
| 89 | virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE; |
| 90 | |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 91 | class Iter; |
| 92 | |
djsollen@google.com | 339e79f | 2013-09-04 17:16:00 +0000 | [diff] [blame] | 93 | private: |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 94 | typedef SkCanvas INHERITED; |
| 95 | }; |
| 96 | |
| 97 | |
| 98 | #endif |