epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2011 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 7 | #include "SkNWayCanvas.h" |
| 8 | |
Florin Malita | 439ace9 | 2016-12-02 12:05:41 -0500 | [diff] [blame] | 9 | SkNWayCanvas::SkNWayCanvas(int width, int height) : INHERITED(width, height) {} |
reed@google.com | 6ae24e0 | 2012-09-26 13:44:13 +0000 | [diff] [blame] | 10 | |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 11 | SkNWayCanvas::~SkNWayCanvas() { |
| 12 | this->removeAll(); |
| 13 | } |
| 14 | |
| 15 | void SkNWayCanvas::addCanvas(SkCanvas* canvas) { |
| 16 | if (canvas) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 17 | *fList.append() = canvas; |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | void SkNWayCanvas::removeCanvas(SkCanvas* canvas) { |
| 22 | int index = fList.find(canvas); |
| 23 | if (index >= 0) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 24 | fList.removeShuffle(index); |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | void SkNWayCanvas::removeAll() { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 29 | fList.reset(); |
| 30 | } |
| 31 | |
| 32 | /////////////////////////////////////////////////////////////////////////// |
| 33 | // These are forwarded to the N canvases we're referencing |
| 34 | |
| 35 | class SkNWayCanvas::Iter { |
| 36 | public: |
| 37 | Iter(const SkTDArray<SkCanvas*>& list) : fList(list) { |
| 38 | fIndex = 0; |
| 39 | } |
| 40 | bool next() { |
| 41 | if (fIndex < fList.count()) { |
| 42 | fCanvas = fList[fIndex++]; |
| 43 | return true; |
| 44 | } |
| 45 | return false; |
| 46 | } |
| 47 | SkCanvas* operator->() { return fCanvas; } |
vandebo@chromium.org | 74b4619 | 2012-01-28 01:45:11 +0000 | [diff] [blame] | 48 | |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 49 | private: |
| 50 | const SkTDArray<SkCanvas*>& fList; |
| 51 | int fIndex; |
| 52 | SkCanvas* fCanvas; |
| 53 | }; |
| 54 | |
Florin Malita | 5f6102d | 2014-06-30 10:13:28 -0400 | [diff] [blame] | 55 | void SkNWayCanvas::willSave() { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 56 | Iter iter(fList); |
| 57 | while (iter.next()) { |
Florin Malita | 5f6102d | 2014-06-30 10:13:28 -0400 | [diff] [blame] | 58 | iter->save(); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 59 | } |
commit-bot@chromium.org | e54a23f | 2014-03-12 20:21:48 +0000 | [diff] [blame] | 60 | |
Florin Malita | 5f6102d | 2014-06-30 10:13:28 -0400 | [diff] [blame] | 61 | this->INHERITED::willSave(); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 62 | } |
| 63 | |
reed | 4960eee | 2015-12-18 07:09:18 -0800 | [diff] [blame] | 64 | SkCanvas::SaveLayerStrategy SkNWayCanvas::getSaveLayerStrategy(const SaveLayerRec& rec) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 65 | Iter iter(fList); |
| 66 | while (iter.next()) { |
reed | 4960eee | 2015-12-18 07:09:18 -0800 | [diff] [blame] | 67 | iter->saveLayer(rec); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 68 | } |
commit-bot@chromium.org | e54a23f | 2014-03-12 20:21:48 +0000 | [diff] [blame] | 69 | |
reed | 4960eee | 2015-12-18 07:09:18 -0800 | [diff] [blame] | 70 | this->INHERITED::getSaveLayerStrategy(rec); |
commit-bot@chromium.org | e54a23f | 2014-03-12 20:21:48 +0000 | [diff] [blame] | 71 | // No need for a layer. |
| 72 | return kNoLayer_SaveLayerStrategy; |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 73 | } |
| 74 | |
commit-bot@chromium.org | e54a23f | 2014-03-12 20:21:48 +0000 | [diff] [blame] | 75 | void SkNWayCanvas::willRestore() { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 76 | Iter iter(fList); |
| 77 | while (iter.next()) { |
| 78 | iter->restore(); |
| 79 | } |
commit-bot@chromium.org | e54a23f | 2014-03-12 20:21:48 +0000 | [diff] [blame] | 80 | this->INHERITED::willRestore(); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 81 | } |
| 82 | |
commit-bot@chromium.org | 44c48d0 | 2014-03-13 20:03:58 +0000 | [diff] [blame] | 83 | void SkNWayCanvas::didConcat(const SkMatrix& matrix) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 84 | Iter iter(fList); |
| 85 | while (iter.next()) { |
| 86 | iter->concat(matrix); |
| 87 | } |
commit-bot@chromium.org | 44c48d0 | 2014-03-13 20:03:58 +0000 | [diff] [blame] | 88 | this->INHERITED::didConcat(matrix); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 89 | } |
| 90 | |
commit-bot@chromium.org | 44c48d0 | 2014-03-13 20:03:58 +0000 | [diff] [blame] | 91 | void SkNWayCanvas::didSetMatrix(const SkMatrix& matrix) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 92 | Iter iter(fList); |
| 93 | while (iter.next()) { |
| 94 | iter->setMatrix(matrix); |
| 95 | } |
commit-bot@chromium.org | 44c48d0 | 2014-03-13 20:03:58 +0000 | [diff] [blame] | 96 | this->INHERITED::didSetMatrix(matrix); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 97 | } |
| 98 | |
Mike Reed | c1f7774 | 2016-12-09 09:00:50 -0500 | [diff] [blame] | 99 | void SkNWayCanvas::onClipRect(const SkRect& rect, SkClipOp op, ClipEdgeStyle edgeStyle) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 100 | Iter iter(fList); |
| 101 | while (iter.next()) { |
robertphillips@google.com | 8f90a89 | 2014-02-28 18:19:39 +0000 | [diff] [blame] | 102 | iter->clipRect(rect, op, kSoft_ClipEdgeStyle == edgeStyle); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 103 | } |
robertphillips@google.com | 8f90a89 | 2014-02-28 18:19:39 +0000 | [diff] [blame] | 104 | this->INHERITED::onClipRect(rect, op, edgeStyle); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 105 | } |
| 106 | |
Mike Reed | c1f7774 | 2016-12-09 09:00:50 -0500 | [diff] [blame] | 107 | void SkNWayCanvas::onClipRRect(const SkRRect& rrect, SkClipOp op, ClipEdgeStyle edgeStyle) { |
reed@google.com | 4ed0fb7 | 2012-12-12 20:48:18 +0000 | [diff] [blame] | 108 | Iter iter(fList); |
| 109 | while (iter.next()) { |
robertphillips@google.com | 8f90a89 | 2014-02-28 18:19:39 +0000 | [diff] [blame] | 110 | iter->clipRRect(rrect, op, kSoft_ClipEdgeStyle == edgeStyle); |
reed@google.com | 4ed0fb7 | 2012-12-12 20:48:18 +0000 | [diff] [blame] | 111 | } |
robertphillips@google.com | 8f90a89 | 2014-02-28 18:19:39 +0000 | [diff] [blame] | 112 | this->INHERITED::onClipRRect(rrect, op, edgeStyle); |
reed@google.com | 4ed0fb7 | 2012-12-12 20:48:18 +0000 | [diff] [blame] | 113 | } |
| 114 | |
Mike Reed | c1f7774 | 2016-12-09 09:00:50 -0500 | [diff] [blame] | 115 | void SkNWayCanvas::onClipPath(const SkPath& path, SkClipOp op, ClipEdgeStyle edgeStyle) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 116 | Iter iter(fList); |
| 117 | while (iter.next()) { |
robertphillips@google.com | 8f90a89 | 2014-02-28 18:19:39 +0000 | [diff] [blame] | 118 | iter->clipPath(path, op, kSoft_ClipEdgeStyle == edgeStyle); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 119 | } |
robertphillips@google.com | 8f90a89 | 2014-02-28 18:19:39 +0000 | [diff] [blame] | 120 | this->INHERITED::onClipPath(path, op, edgeStyle); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 121 | } |
| 122 | |
Mike Reed | c1f7774 | 2016-12-09 09:00:50 -0500 | [diff] [blame] | 123 | void SkNWayCanvas::onClipRegion(const SkRegion& deviceRgn, SkClipOp op) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 124 | Iter iter(fList); |
| 125 | while (iter.next()) { |
| 126 | iter->clipRegion(deviceRgn, op); |
| 127 | } |
robertphillips@google.com | 8f90a89 | 2014-02-28 18:19:39 +0000 | [diff] [blame] | 128 | this->INHERITED::onClipRegion(deviceRgn, op); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 129 | } |
| 130 | |
reed | 41af966 | 2015-01-05 07:49:08 -0800 | [diff] [blame] | 131 | void SkNWayCanvas::onDrawPaint(const SkPaint& paint) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 132 | Iter iter(fList); |
| 133 | while (iter.next()) { |
| 134 | iter->drawPaint(paint); |
| 135 | } |
| 136 | } |
| 137 | |
reed | 41af966 | 2015-01-05 07:49:08 -0800 | [diff] [blame] | 138 | void SkNWayCanvas::onDrawPoints(PointMode mode, size_t count, const SkPoint pts[], |
| 139 | const SkPaint& paint) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 140 | Iter iter(fList); |
| 141 | while (iter.next()) { |
| 142 | iter->drawPoints(mode, count, pts, paint); |
| 143 | } |
| 144 | } |
| 145 | |
reed | 41af966 | 2015-01-05 07:49:08 -0800 | [diff] [blame] | 146 | void SkNWayCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 147 | Iter iter(fList); |
| 148 | while (iter.next()) { |
| 149 | iter->drawRect(rect, paint); |
| 150 | } |
| 151 | } |
| 152 | |
Brian Osman | 3adc122 | 2018-03-08 14:52:20 -0500 | [diff] [blame] | 153 | void SkNWayCanvas::onDrawRegion(const SkRegion& region, const SkPaint& paint) { |
| 154 | Iter iter(fList); |
| 155 | while (iter.next()) { |
| 156 | iter->drawRegion(region, paint); |
| 157 | } |
| 158 | } |
| 159 | |
reed | 41af966 | 2015-01-05 07:49:08 -0800 | [diff] [blame] | 160 | void SkNWayCanvas::onDrawOval(const SkRect& rect, const SkPaint& paint) { |
commit-bot@chromium.org | be65a4c | 2013-11-14 19:02:41 +0000 | [diff] [blame] | 161 | Iter iter(fList); |
| 162 | while (iter.next()) { |
| 163 | iter->drawOval(rect, paint); |
| 164 | } |
| 165 | } |
| 166 | |
bsalomon | ac3aa24 | 2016-08-19 11:25:19 -0700 | [diff] [blame] | 167 | void SkNWayCanvas::onDrawArc(const SkRect& rect, SkScalar startAngle, SkScalar sweepAngle, |
| 168 | bool useCenter, const SkPaint& paint) { |
| 169 | Iter iter(fList); |
| 170 | while (iter.next()) { |
| 171 | iter->drawArc(rect, startAngle, sweepAngle, useCenter, paint); |
| 172 | } |
| 173 | } |
| 174 | |
reed | 41af966 | 2015-01-05 07:49:08 -0800 | [diff] [blame] | 175 | void SkNWayCanvas::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) { |
reed@google.com | 4ed0fb7 | 2012-12-12 20:48:18 +0000 | [diff] [blame] | 176 | Iter iter(fList); |
| 177 | while (iter.next()) { |
| 178 | iter->drawRRect(rrect, paint); |
| 179 | } |
| 180 | } |
| 181 | |
reed | a5517e2 | 2015-07-14 10:54:12 -0700 | [diff] [blame] | 182 | void SkNWayCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, const SkPaint& paint) { |
commit-bot@chromium.org | ab58273 | 2014-02-21 12:20:45 +0000 | [diff] [blame] | 183 | Iter iter(fList); |
| 184 | while (iter.next()) { |
| 185 | iter->drawDRRect(outer, inner, paint); |
| 186 | } |
| 187 | } |
| 188 | |
reed | 41af966 | 2015-01-05 07:49:08 -0800 | [diff] [blame] | 189 | void SkNWayCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 190 | Iter iter(fList); |
| 191 | while (iter.next()) { |
| 192 | iter->drawPath(path, paint); |
| 193 | } |
| 194 | } |
| 195 | |
reed | 41af966 | 2015-01-05 07:49:08 -0800 | [diff] [blame] | 196 | void SkNWayCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y, |
| 197 | const SkPaint* paint) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 198 | Iter iter(fList); |
| 199 | while (iter.next()) { |
| 200 | iter->drawBitmap(bitmap, x, y, paint); |
| 201 | } |
| 202 | } |
| 203 | |
reed | 41af966 | 2015-01-05 07:49:08 -0800 | [diff] [blame] | 204 | void SkNWayCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst, |
reed | 562fe47 | 2015-07-28 07:35:14 -0700 | [diff] [blame] | 205 | const SkPaint* paint, SrcRectConstraint constraint) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 206 | Iter iter(fList); |
| 207 | while (iter.next()) { |
reed | e47829b | 2015-08-06 10:02:53 -0700 | [diff] [blame] | 208 | iter->legacy_drawBitmapRect(bitmap, src, dst, paint, (SrcRectConstraint)constraint); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 209 | } |
| 210 | } |
| 211 | |
reed | 41af966 | 2015-01-05 07:49:08 -0800 | [diff] [blame] | 212 | void SkNWayCanvas::onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, |
| 213 | const SkRect& dst, const SkPaint* paint) { |
commit-bot@chromium.org | be65a4c | 2013-11-14 19:02:41 +0000 | [diff] [blame] | 214 | Iter iter(fList); |
| 215 | while (iter.next()) { |
| 216 | iter->drawBitmapNine(bitmap, center, dst, paint); |
| 217 | } |
| 218 | } |
| 219 | |
Brian Osman | 3adc122 | 2018-03-08 14:52:20 -0500 | [diff] [blame] | 220 | void SkNWayCanvas::onDrawBitmapLattice(const SkBitmap& bitmap, const Lattice& lattice, |
| 221 | const SkRect& dst, const SkPaint* paint) { |
| 222 | Iter iter(fList); |
| 223 | while (iter.next()) { |
| 224 | iter->drawBitmapLattice(bitmap, lattice, dst, paint); |
| 225 | } |
| 226 | } |
| 227 | |
reed | 41af966 | 2015-01-05 07:49:08 -0800 | [diff] [blame] | 228 | void SkNWayCanvas::onDrawImage(const SkImage* image, SkScalar left, SkScalar top, |
| 229 | const SkPaint* paint) { |
piotaixr | b7bac3d | 2014-09-29 08:56:19 -0700 | [diff] [blame] | 230 | Iter iter(fList); |
| 231 | while (iter.next()) { |
| 232 | iter->drawImage(image, left, top, paint); |
| 233 | } |
| 234 | } |
| 235 | |
reed | 41af966 | 2015-01-05 07:49:08 -0800 | [diff] [blame] | 236 | void SkNWayCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst, |
reed | 562fe47 | 2015-07-28 07:35:14 -0700 | [diff] [blame] | 237 | const SkPaint* paint, SrcRectConstraint constraint) { |
piotaixr | b7bac3d | 2014-09-29 08:56:19 -0700 | [diff] [blame] | 238 | Iter iter(fList); |
| 239 | while (iter.next()) { |
reed | e47829b | 2015-08-06 10:02:53 -0700 | [diff] [blame] | 240 | iter->legacy_drawImageRect(image, src, dst, paint, constraint); |
piotaixr | b7bac3d | 2014-09-29 08:56:19 -0700 | [diff] [blame] | 241 | } |
| 242 | } |
| 243 | |
Brian Osman | 3adc122 | 2018-03-08 14:52:20 -0500 | [diff] [blame] | 244 | void SkNWayCanvas::onDrawImageNine(const SkImage* image, const SkIRect& center, const SkRect& dst, |
| 245 | const SkPaint* paint) { |
| 246 | Iter iter(fList); |
| 247 | while (iter.next()) { |
| 248 | iter->drawImageNine(image, center, dst, paint); |
| 249 | } |
| 250 | } |
| 251 | |
| 252 | void SkNWayCanvas::onDrawImageLattice(const SkImage* image, const Lattice& lattice, |
| 253 | const SkRect& dst, const SkPaint* paint) { |
| 254 | Iter iter(fList); |
| 255 | while (iter.next()) { |
| 256 | iter->drawImageLattice(image, lattice, dst, paint); |
| 257 | } |
| 258 | } |
| 259 | |
reed@google.com | e0d9ce8 | 2014-04-23 04:00:17 +0000 | [diff] [blame] | 260 | void SkNWayCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y, |
| 261 | const SkPaint& paint) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 262 | Iter iter(fList); |
| 263 | while (iter.next()) { |
| 264 | iter->drawText(text, byteLength, x, y, paint); |
| 265 | } |
| 266 | } |
| 267 | |
reed@google.com | e0d9ce8 | 2014-04-23 04:00:17 +0000 | [diff] [blame] | 268 | void SkNWayCanvas::onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[], |
| 269 | const SkPaint& paint) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 270 | Iter iter(fList); |
| 271 | while (iter.next()) { |
| 272 | iter->drawPosText(text, byteLength, pos, paint); |
| 273 | } |
| 274 | } |
| 275 | |
reed@google.com | e0d9ce8 | 2014-04-23 04:00:17 +0000 | [diff] [blame] | 276 | void SkNWayCanvas::onDrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[], |
| 277 | SkScalar constY, const SkPaint& paint) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 278 | Iter iter(fList); |
| 279 | while (iter.next()) { |
| 280 | iter->drawPosTextH(text, byteLength, xpos, constY, paint); |
| 281 | } |
| 282 | } |
| 283 | |
reed@google.com | e0d9ce8 | 2014-04-23 04:00:17 +0000 | [diff] [blame] | 284 | void SkNWayCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path, |
| 285 | const SkMatrix* matrix, const SkPaint& paint) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 286 | Iter iter(fList); |
| 287 | while (iter.next()) { |
| 288 | iter->drawTextOnPath(text, byteLength, path, matrix, paint); |
| 289 | } |
| 290 | } |
| 291 | |
reed | 45561a0 | 2016-07-07 12:47:17 -0700 | [diff] [blame] | 292 | void SkNWayCanvas::onDrawTextRSXform(const void* text, size_t byteLength, const SkRSXform xform[], |
| 293 | const SkRect* cull, const SkPaint& paint) { |
| 294 | Iter iter(fList); |
| 295 | while (iter.next()) { |
| 296 | iter->drawTextRSXform(text, byteLength, xform, cull, paint); |
| 297 | } |
| 298 | } |
| 299 | |
fmalita | b742517 | 2014-08-26 07:56:44 -0700 | [diff] [blame] | 300 | void SkNWayCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, |
| 301 | const SkPaint &paint) { |
| 302 | Iter iter(fList); |
| 303 | while (iter.next()) { |
| 304 | iter->drawTextBlob(blob, x, y, paint); |
| 305 | } |
| 306 | } |
| 307 | |
reed | d5fa1a4 | 2014-08-09 11:08:05 -0700 | [diff] [blame] | 308 | void SkNWayCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matrix, |
| 309 | const SkPaint* paint) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 310 | Iter iter(fList); |
| 311 | while (iter.next()) { |
reed | d5fa1a4 | 2014-08-09 11:08:05 -0700 | [diff] [blame] | 312 | iter->drawPicture(picture, matrix, paint); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 313 | } |
| 314 | } |
| 315 | |
Florin Malita | adaeaed | 2017-09-21 15:28:29 -0400 | [diff] [blame] | 316 | void SkNWayCanvas::onDrawDrawable(SkDrawable* drawable, const SkMatrix* matrix) { |
| 317 | Iter iter(fList); |
| 318 | while (iter.next()) { |
| 319 | iter->drawDrawable(drawable, matrix); |
| 320 | } |
| 321 | } |
| 322 | |
Ruiqi Mao | f510149 | 2018-06-29 14:32:21 -0400 | [diff] [blame] | 323 | void SkNWayCanvas::onDrawVerticesObject(const SkVertices* vertices, const SkMatrix* bones, |
| 324 | int boneCount, SkBlendMode bmode, const SkPaint& paint) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 325 | Iter iter(fList); |
| 326 | while (iter.next()) { |
Ruiqi Mao | f510149 | 2018-06-29 14:32:21 -0400 | [diff] [blame] | 327 | iter->drawVertices(vertices, bones, boneCount, bmode, paint); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 328 | } |
| 329 | } |
| 330 | |
dandov | b3c9d1c | 2014-08-12 08:34:29 -0700 | [diff] [blame] | 331 | void SkNWayCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], |
Mike Reed | faba371 | 2016-11-03 14:45:31 -0400 | [diff] [blame] | 332 | const SkPoint texCoords[4], SkBlendMode bmode, |
dandov | b3c9d1c | 2014-08-12 08:34:29 -0700 | [diff] [blame] | 333 | const SkPaint& paint) { |
dandov | 963137b | 2014-08-07 07:49:53 -0700 | [diff] [blame] | 334 | Iter iter(fList); |
| 335 | while (iter.next()) { |
Mike Reed | faba371 | 2016-11-03 14:45:31 -0400 | [diff] [blame] | 336 | iter->drawPatch(cubics, colors, texCoords, bmode, paint); |
dandov | 963137b | 2014-08-07 07:49:53 -0700 | [diff] [blame] | 337 | } |
| 338 | } |
| 339 | |
Brian Osman | 3adc122 | 2018-03-08 14:52:20 -0500 | [diff] [blame] | 340 | void SkNWayCanvas::onDrawAtlas(const SkImage* image, const SkRSXform xform[], const SkRect tex[], |
| 341 | const SkColor colors[], int count, SkBlendMode bmode, |
| 342 | const SkRect* cull, const SkPaint* paint) { |
| 343 | Iter iter(fList); |
| 344 | while (iter.next()) { |
| 345 | iter->drawAtlas(image, xform, tex, colors, count, bmode, cull, paint); |
| 346 | } |
| 347 | } |
| 348 | |
Mike Reed | 4204da2 | 2017-05-17 08:53:36 -0400 | [diff] [blame] | 349 | void SkNWayCanvas::onDrawShadowRec(const SkPath& path, const SkDrawShadowRec& rec) { |
| 350 | Iter iter(fList); |
| 351 | while (iter.next()) { |
| 352 | iter->private_draw_shadow_rec(path, rec); |
| 353 | } |
| 354 | } |
| 355 | |
reed | f70b531 | 2016-03-04 16:36:20 -0800 | [diff] [blame] | 356 | void SkNWayCanvas::onDrawAnnotation(const SkRect& rect, const char key[], SkData* data) { |
| 357 | Iter iter(fList); |
| 358 | while (iter.next()) { |
| 359 | iter->drawAnnotation(rect, key, data); |
| 360 | } |
| 361 | } |
| 362 | |
Florin Malita | 1ba5b6b | 2017-10-12 11:08:46 -0400 | [diff] [blame] | 363 | void SkNWayCanvas::onFlush() { |
| 364 | Iter iter(fList); |
| 365 | while (iter.next()) { |
| 366 | iter->flush(); |
| 367 | } |
| 368 | } |