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 | */ |
Mike Reed | 148b7fd | 2018-12-18 17:38:18 -0500 | [diff] [blame] | 7 | |
Mike Reed | 121c2af | 2020-03-10 14:02:56 -0400 | [diff] [blame] | 8 | #include "include/core/SkShader.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 9 | #include "include/utils/SkNWayCanvas.h" |
| 10 | #include "src/core/SkCanvasPriv.h" |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 11 | |
Florin Malita | 439ace9 | 2016-12-02 12:05:41 -0500 | [diff] [blame] | 12 | SkNWayCanvas::SkNWayCanvas(int width, int height) : INHERITED(width, height) {} |
reed@google.com | 6ae24e0 | 2012-09-26 13:44:13 +0000 | [diff] [blame] | 13 | |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 14 | SkNWayCanvas::~SkNWayCanvas() { |
| 15 | this->removeAll(); |
| 16 | } |
| 17 | |
| 18 | void SkNWayCanvas::addCanvas(SkCanvas* canvas) { |
| 19 | if (canvas) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 20 | *fList.append() = canvas; |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | void SkNWayCanvas::removeCanvas(SkCanvas* canvas) { |
| 25 | int index = fList.find(canvas); |
| 26 | if (index >= 0) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 27 | fList.removeShuffle(index); |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | void SkNWayCanvas::removeAll() { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 32 | fList.reset(); |
| 33 | } |
| 34 | |
| 35 | /////////////////////////////////////////////////////////////////////////// |
| 36 | // These are forwarded to the N canvases we're referencing |
| 37 | |
| 38 | class SkNWayCanvas::Iter { |
| 39 | public: |
| 40 | Iter(const SkTDArray<SkCanvas*>& list) : fList(list) { |
| 41 | fIndex = 0; |
| 42 | } |
| 43 | bool next() { |
| 44 | if (fIndex < fList.count()) { |
| 45 | fCanvas = fList[fIndex++]; |
| 46 | return true; |
| 47 | } |
| 48 | return false; |
| 49 | } |
| 50 | SkCanvas* operator->() { return fCanvas; } |
Mike Reed | 148b7fd | 2018-12-18 17:38:18 -0500 | [diff] [blame] | 51 | SkCanvas* get() const { return fCanvas; } |
vandebo@chromium.org | 74b4619 | 2012-01-28 01:45:11 +0000 | [diff] [blame] | 52 | |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 53 | private: |
| 54 | const SkTDArray<SkCanvas*>& fList; |
| 55 | int fIndex; |
| 56 | SkCanvas* fCanvas; |
| 57 | }; |
| 58 | |
Florin Malita | 5f6102d | 2014-06-30 10:13:28 -0400 | [diff] [blame] | 59 | void SkNWayCanvas::willSave() { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 60 | Iter iter(fList); |
| 61 | while (iter.next()) { |
Florin Malita | 5f6102d | 2014-06-30 10:13:28 -0400 | [diff] [blame] | 62 | iter->save(); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 63 | } |
commit-bot@chromium.org | e54a23f | 2014-03-12 20:21:48 +0000 | [diff] [blame] | 64 | |
Florin Malita | 5f6102d | 2014-06-30 10:13:28 -0400 | [diff] [blame] | 65 | this->INHERITED::willSave(); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 66 | } |
| 67 | |
reed | 4960eee | 2015-12-18 07:09:18 -0800 | [diff] [blame] | 68 | SkCanvas::SaveLayerStrategy SkNWayCanvas::getSaveLayerStrategy(const SaveLayerRec& rec) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 69 | Iter iter(fList); |
| 70 | while (iter.next()) { |
reed | 4960eee | 2015-12-18 07:09:18 -0800 | [diff] [blame] | 71 | iter->saveLayer(rec); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 72 | } |
commit-bot@chromium.org | e54a23f | 2014-03-12 20:21:48 +0000 | [diff] [blame] | 73 | |
reed | 4960eee | 2015-12-18 07:09:18 -0800 | [diff] [blame] | 74 | this->INHERITED::getSaveLayerStrategy(rec); |
commit-bot@chromium.org | e54a23f | 2014-03-12 20:21:48 +0000 | [diff] [blame] | 75 | // No need for a layer. |
| 76 | return kNoLayer_SaveLayerStrategy; |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 77 | } |
| 78 | |
Mike Reed | 148b7fd | 2018-12-18 17:38:18 -0500 | [diff] [blame] | 79 | bool SkNWayCanvas::onDoSaveBehind(const SkRect* bounds) { |
| 80 | Iter iter(fList); |
| 81 | while (iter.next()) { |
| 82 | SkCanvasPriv::SaveBehind(iter.get(), bounds); |
| 83 | } |
| 84 | this->INHERITED::onDoSaveBehind(bounds); |
| 85 | return false; |
| 86 | } |
| 87 | |
commit-bot@chromium.org | e54a23f | 2014-03-12 20:21:48 +0000 | [diff] [blame] | 88 | void SkNWayCanvas::willRestore() { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 89 | Iter iter(fList); |
| 90 | while (iter.next()) { |
| 91 | iter->restore(); |
| 92 | } |
commit-bot@chromium.org | e54a23f | 2014-03-12 20:21:48 +0000 | [diff] [blame] | 93 | this->INHERITED::willRestore(); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 94 | } |
| 95 | |
Brian Osman | 548de74 | 2020-04-24 12:02:25 -0400 | [diff] [blame] | 96 | void SkNWayCanvas::onMarkCTM(const char* name) { |
Mike Reed | 7fe6ee3 | 2020-04-09 12:35:09 -0400 | [diff] [blame] | 97 | Iter iter(fList); |
| 98 | while (iter.next()) { |
Brian Osman | 548de74 | 2020-04-24 12:02:25 -0400 | [diff] [blame] | 99 | iter->markCTM(name); |
Mike Reed | 7fe6ee3 | 2020-04-09 12:35:09 -0400 | [diff] [blame] | 100 | } |
Brian Osman | 548de74 | 2020-04-24 12:02:25 -0400 | [diff] [blame] | 101 | this->INHERITED::onMarkCTM(name); |
Mike Reed | 7fe6ee3 | 2020-04-09 12:35:09 -0400 | [diff] [blame] | 102 | } |
| 103 | |
Mike Reed | a735ad9 | 2020-04-06 21:32:43 -0400 | [diff] [blame] | 104 | void SkNWayCanvas::didConcat44(const SkM44& m) { |
| 105 | Iter iter(fList); |
| 106 | while (iter.next()) { |
| 107 | iter->concat(m); |
| 108 | } |
| 109 | } |
Mike Reed | f6d70a8 | 2020-01-10 15:56:32 -0500 | [diff] [blame] | 110 | |
Mike Reed | 420a9ba | 2020-11-25 13:37:30 -0500 | [diff] [blame] | 111 | void SkNWayCanvas::didSetM44(const SkM44& matrix) { |
| 112 | Iter iter(fList); |
| 113 | while (iter.next()) { |
| 114 | iter->setMatrix(matrix); |
| 115 | } |
| 116 | } |
| 117 | |
Mike Reed | f6d70a8 | 2020-01-10 15:56:32 -0500 | [diff] [blame] | 118 | void SkNWayCanvas::didTranslate(SkScalar x, SkScalar y) { |
| 119 | Iter iter(fList); |
| 120 | while (iter.next()) { |
| 121 | iter->translate(x, y); |
| 122 | } |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 123 | } |
| 124 | |
Mike Reed | a3a704a | 2020-01-10 17:21:40 -0500 | [diff] [blame] | 125 | void SkNWayCanvas::didScale(SkScalar x, SkScalar y) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 126 | Iter iter(fList); |
| 127 | while (iter.next()) { |
Mike Reed | a3a704a | 2020-01-10 17:21:40 -0500 | [diff] [blame] | 128 | iter->scale(x, y); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 129 | } |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 130 | } |
| 131 | |
Mike Reed | c1f7774 | 2016-12-09 09:00:50 -0500 | [diff] [blame] | 132 | void SkNWayCanvas::onClipRect(const SkRect& rect, SkClipOp op, ClipEdgeStyle edgeStyle) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 133 | Iter iter(fList); |
| 134 | while (iter.next()) { |
robertphillips@google.com | 8f90a89 | 2014-02-28 18:19:39 +0000 | [diff] [blame] | 135 | iter->clipRect(rect, op, kSoft_ClipEdgeStyle == edgeStyle); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 136 | } |
robertphillips@google.com | 8f90a89 | 2014-02-28 18:19:39 +0000 | [diff] [blame] | 137 | this->INHERITED::onClipRect(rect, op, edgeStyle); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 138 | } |
| 139 | |
Mike Reed | c1f7774 | 2016-12-09 09:00:50 -0500 | [diff] [blame] | 140 | void SkNWayCanvas::onClipRRect(const SkRRect& rrect, SkClipOp op, ClipEdgeStyle edgeStyle) { |
reed@google.com | 4ed0fb7 | 2012-12-12 20:48:18 +0000 | [diff] [blame] | 141 | Iter iter(fList); |
| 142 | while (iter.next()) { |
robertphillips@google.com | 8f90a89 | 2014-02-28 18:19:39 +0000 | [diff] [blame] | 143 | iter->clipRRect(rrect, op, kSoft_ClipEdgeStyle == edgeStyle); |
reed@google.com | 4ed0fb7 | 2012-12-12 20:48:18 +0000 | [diff] [blame] | 144 | } |
robertphillips@google.com | 8f90a89 | 2014-02-28 18:19:39 +0000 | [diff] [blame] | 145 | this->INHERITED::onClipRRect(rrect, op, edgeStyle); |
reed@google.com | 4ed0fb7 | 2012-12-12 20:48:18 +0000 | [diff] [blame] | 146 | } |
| 147 | |
Mike Reed | c1f7774 | 2016-12-09 09:00:50 -0500 | [diff] [blame] | 148 | void SkNWayCanvas::onClipPath(const SkPath& path, SkClipOp op, ClipEdgeStyle edgeStyle) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 149 | Iter iter(fList); |
| 150 | while (iter.next()) { |
robertphillips@google.com | 8f90a89 | 2014-02-28 18:19:39 +0000 | [diff] [blame] | 151 | iter->clipPath(path, op, kSoft_ClipEdgeStyle == edgeStyle); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 152 | } |
robertphillips@google.com | 8f90a89 | 2014-02-28 18:19:39 +0000 | [diff] [blame] | 153 | this->INHERITED::onClipPath(path, op, edgeStyle); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 154 | } |
| 155 | |
Mike Reed | 121c2af | 2020-03-10 14:02:56 -0400 | [diff] [blame] | 156 | void SkNWayCanvas::onClipShader(sk_sp<SkShader> sh, SkClipOp op) { |
| 157 | Iter iter(fList); |
| 158 | while (iter.next()) { |
| 159 | iter->clipShader(sh, op); |
| 160 | } |
| 161 | this->INHERITED::onClipShader(std::move(sh), op); |
| 162 | } |
| 163 | |
Mike Reed | c1f7774 | 2016-12-09 09:00:50 -0500 | [diff] [blame] | 164 | void SkNWayCanvas::onClipRegion(const SkRegion& deviceRgn, SkClipOp op) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 165 | Iter iter(fList); |
| 166 | while (iter.next()) { |
| 167 | iter->clipRegion(deviceRgn, op); |
| 168 | } |
robertphillips@google.com | 8f90a89 | 2014-02-28 18:19:39 +0000 | [diff] [blame] | 169 | this->INHERITED::onClipRegion(deviceRgn, op); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 170 | } |
| 171 | |
Michael Ludwig | cfd204a | 2021-07-23 11:48:34 -0400 | [diff] [blame] | 172 | void SkNWayCanvas::onResetClip() { |
| 173 | Iter iter(fList); |
| 174 | while (iter.next()) { |
| 175 | SkCanvasPriv::ResetClip(iter.get()); |
| 176 | } |
| 177 | this->INHERITED::onResetClip(); |
| 178 | } |
| 179 | |
reed | 41af966 | 2015-01-05 07:49:08 -0800 | [diff] [blame] | 180 | void SkNWayCanvas::onDrawPaint(const SkPaint& paint) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 181 | Iter iter(fList); |
| 182 | while (iter.next()) { |
| 183 | iter->drawPaint(paint); |
| 184 | } |
| 185 | } |
| 186 | |
Mike Reed | d567408 | 2019-04-19 15:00:47 -0400 | [diff] [blame] | 187 | void SkNWayCanvas::onDrawBehind(const SkPaint& paint) { |
| 188 | Iter iter(fList); |
| 189 | while (iter.next()) { |
| 190 | SkCanvasPriv::DrawBehind(iter.get(), paint); |
| 191 | } |
| 192 | } |
| 193 | |
reed | 41af966 | 2015-01-05 07:49:08 -0800 | [diff] [blame] | 194 | void SkNWayCanvas::onDrawPoints(PointMode mode, size_t count, const SkPoint pts[], |
| 195 | const SkPaint& paint) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 196 | Iter iter(fList); |
| 197 | while (iter.next()) { |
| 198 | iter->drawPoints(mode, count, pts, paint); |
| 199 | } |
| 200 | } |
| 201 | |
reed | 41af966 | 2015-01-05 07:49:08 -0800 | [diff] [blame] | 202 | void SkNWayCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 203 | Iter iter(fList); |
| 204 | while (iter.next()) { |
| 205 | iter->drawRect(rect, paint); |
| 206 | } |
| 207 | } |
| 208 | |
Brian Osman | 3adc122 | 2018-03-08 14:52:20 -0500 | [diff] [blame] | 209 | void SkNWayCanvas::onDrawRegion(const SkRegion& region, const SkPaint& paint) { |
| 210 | Iter iter(fList); |
| 211 | while (iter.next()) { |
| 212 | iter->drawRegion(region, paint); |
| 213 | } |
| 214 | } |
| 215 | |
reed | 41af966 | 2015-01-05 07:49:08 -0800 | [diff] [blame] | 216 | void SkNWayCanvas::onDrawOval(const SkRect& rect, const SkPaint& paint) { |
commit-bot@chromium.org | be65a4c | 2013-11-14 19:02:41 +0000 | [diff] [blame] | 217 | Iter iter(fList); |
| 218 | while (iter.next()) { |
| 219 | iter->drawOval(rect, paint); |
| 220 | } |
| 221 | } |
| 222 | |
bsalomon | ac3aa24 | 2016-08-19 11:25:19 -0700 | [diff] [blame] | 223 | void SkNWayCanvas::onDrawArc(const SkRect& rect, SkScalar startAngle, SkScalar sweepAngle, |
| 224 | bool useCenter, const SkPaint& paint) { |
| 225 | Iter iter(fList); |
| 226 | while (iter.next()) { |
| 227 | iter->drawArc(rect, startAngle, sweepAngle, useCenter, paint); |
| 228 | } |
| 229 | } |
| 230 | |
reed | 41af966 | 2015-01-05 07:49:08 -0800 | [diff] [blame] | 231 | void SkNWayCanvas::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) { |
reed@google.com | 4ed0fb7 | 2012-12-12 20:48:18 +0000 | [diff] [blame] | 232 | Iter iter(fList); |
| 233 | while (iter.next()) { |
| 234 | iter->drawRRect(rrect, paint); |
| 235 | } |
| 236 | } |
| 237 | |
reed | a5517e2 | 2015-07-14 10:54:12 -0700 | [diff] [blame] | 238 | 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] | 239 | Iter iter(fList); |
| 240 | while (iter.next()) { |
| 241 | iter->drawDRRect(outer, inner, paint); |
| 242 | } |
| 243 | } |
| 244 | |
reed | 41af966 | 2015-01-05 07:49:08 -0800 | [diff] [blame] | 245 | void SkNWayCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 246 | Iter iter(fList); |
| 247 | while (iter.next()) { |
| 248 | iter->drawPath(path, paint); |
| 249 | } |
| 250 | } |
| 251 | |
Mike Reed | 4f23dec | 2020-12-30 14:22:42 +0000 | [diff] [blame] | 252 | void SkNWayCanvas::onDrawImage2(const SkImage* image, SkScalar left, SkScalar top, |
| 253 | const SkSamplingOptions& sampling, const SkPaint* paint) { |
| 254 | Iter iter(fList); |
| 255 | while (iter.next()) { |
| 256 | iter->drawImage(image, left, top, sampling, paint); |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | void SkNWayCanvas::onDrawImageRect2(const SkImage* image, const SkRect& src, const SkRect& dst, |
| 261 | const SkSamplingOptions& sampling, const SkPaint* paint, |
| 262 | SrcRectConstraint constraint) { |
| 263 | Iter iter(fList); |
| 264 | while (iter.next()) { |
| 265 | iter->drawImageRect(image, src, dst, sampling, paint, constraint); |
| 266 | } |
| 267 | } |
| 268 | |
| 269 | void SkNWayCanvas::onDrawImageLattice2(const SkImage* image, const Lattice& lattice, |
| 270 | const SkRect& dst, SkFilterMode filter, |
| 271 | const SkPaint* paint) { |
| 272 | Iter iter(fList); |
| 273 | while (iter.next()) { |
| 274 | iter->drawImageLattice(image, lattice, dst, filter, paint); |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | void SkNWayCanvas::onDrawAtlas2(const SkImage* image, const SkRSXform xform[], const SkRect tex[], |
| 279 | const SkColor colors[], int count, SkBlendMode bmode, |
| 280 | const SkSamplingOptions& sampling, const SkRect* cull, |
| 281 | const SkPaint* paint) { |
| 282 | Iter iter(fList); |
| 283 | while (iter.next()) { |
| 284 | iter->drawAtlas(image, xform, tex, colors, count, bmode, sampling, cull, paint); |
| 285 | } |
| 286 | } |
Brian Osman | 3adc122 | 2018-03-08 14:52:20 -0500 | [diff] [blame] | 287 | |
Mike Reed | 35c894e | 2021-04-16 10:27:01 -0400 | [diff] [blame] | 288 | void SkNWayCanvas::onDrawGlyphRunList(const SkGlyphRunList& list, const SkPaint &paint) { |
| 289 | Iter iter(fList); |
| 290 | while (iter.next()) { |
| 291 | iter->onDrawGlyphRunList(list, paint); |
| 292 | } |
| 293 | } |
| 294 | |
fmalita | b742517 | 2014-08-26 07:56:44 -0700 | [diff] [blame] | 295 | void SkNWayCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, |
| 296 | const SkPaint &paint) { |
| 297 | Iter iter(fList); |
| 298 | while (iter.next()) { |
| 299 | iter->drawTextBlob(blob, x, y, paint); |
| 300 | } |
| 301 | } |
| 302 | |
reed | d5fa1a4 | 2014-08-09 11:08:05 -0700 | [diff] [blame] | 303 | void SkNWayCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matrix, |
| 304 | const SkPaint* paint) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 305 | Iter iter(fList); |
| 306 | while (iter.next()) { |
reed | d5fa1a4 | 2014-08-09 11:08:05 -0700 | [diff] [blame] | 307 | iter->drawPicture(picture, matrix, paint); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 308 | } |
| 309 | } |
| 310 | |
Florin Malita | adaeaed | 2017-09-21 15:28:29 -0400 | [diff] [blame] | 311 | void SkNWayCanvas::onDrawDrawable(SkDrawable* drawable, const SkMatrix* matrix) { |
| 312 | Iter iter(fList); |
| 313 | while (iter.next()) { |
| 314 | iter->drawDrawable(drawable, matrix); |
| 315 | } |
| 316 | } |
| 317 | |
Mike Reed | a2cf8ae | 2020-03-02 17:08:01 -0500 | [diff] [blame] | 318 | void SkNWayCanvas::onDrawVerticesObject(const SkVertices* vertices, |
Mike Reed | a2cf8ae | 2020-03-02 17:08:01 -0500 | [diff] [blame] | 319 | SkBlendMode bmode, const SkPaint& paint) { |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 320 | Iter iter(fList); |
| 321 | while (iter.next()) { |
Mike Reed | 5caf935 | 2020-03-02 14:57:09 -0500 | [diff] [blame] | 322 | iter->drawVertices(vertices, bmode, paint); |
reed@android.com | 6c924ad | 2009-03-31 03:48:49 +0000 | [diff] [blame] | 323 | } |
| 324 | } |
| 325 | |
dandov | b3c9d1c | 2014-08-12 08:34:29 -0700 | [diff] [blame] | 326 | void SkNWayCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], |
Mike Reed | faba371 | 2016-11-03 14:45:31 -0400 | [diff] [blame] | 327 | const SkPoint texCoords[4], SkBlendMode bmode, |
dandov | b3c9d1c | 2014-08-12 08:34:29 -0700 | [diff] [blame] | 328 | const SkPaint& paint) { |
dandov | 963137b | 2014-08-07 07:49:53 -0700 | [diff] [blame] | 329 | Iter iter(fList); |
| 330 | while (iter.next()) { |
Mike Reed | faba371 | 2016-11-03 14:45:31 -0400 | [diff] [blame] | 331 | iter->drawPatch(cubics, colors, texCoords, bmode, paint); |
dandov | 963137b | 2014-08-07 07:49:53 -0700 | [diff] [blame] | 332 | } |
| 333 | } |
| 334 | |
Mike Reed | 4204da2 | 2017-05-17 08:53:36 -0400 | [diff] [blame] | 335 | void SkNWayCanvas::onDrawShadowRec(const SkPath& path, const SkDrawShadowRec& rec) { |
| 336 | Iter iter(fList); |
| 337 | while (iter.next()) { |
| 338 | iter->private_draw_shadow_rec(path, rec); |
| 339 | } |
| 340 | } |
| 341 | |
reed | f70b531 | 2016-03-04 16:36:20 -0800 | [diff] [blame] | 342 | void SkNWayCanvas::onDrawAnnotation(const SkRect& rect, const char key[], SkData* data) { |
| 343 | Iter iter(fList); |
| 344 | while (iter.next()) { |
| 345 | iter->drawAnnotation(rect, key, data); |
| 346 | } |
| 347 | } |
| 348 | |
Michael Ludwig | 390f0cc | 2019-03-19 09:16:38 -0400 | [diff] [blame] | 349 | void SkNWayCanvas::onDrawEdgeAAQuad(const SkRect& rect, const SkPoint clip[4], |
Michael Ludwig | a595f86 | 2019-08-27 15:25:49 -0400 | [diff] [blame] | 350 | QuadAAFlags aa, const SkColor4f& color, SkBlendMode mode) { |
Michael Ludwig | 390f0cc | 2019-03-19 09:16:38 -0400 | [diff] [blame] | 351 | Iter iter(fList); |
| 352 | while (iter.next()) { |
| 353 | iter->experimental_DrawEdgeAAQuad(rect, clip, aa, color, mode); |
| 354 | } |
| 355 | } |
| 356 | |
Mike Reed | 4f50934 | 2021-01-05 12:03:47 -0500 | [diff] [blame] | 357 | void SkNWayCanvas::onDrawEdgeAAImageSet2(const ImageSetEntry set[], int count, |
| 358 | const SkPoint dstClips[], const SkMatrix preViewMatrices[], |
| 359 | const SkSamplingOptions& sampling, const SkPaint* paint, |
| 360 | SrcRectConstraint constraint) { |
Michael Ludwig | 390f0cc | 2019-03-19 09:16:38 -0400 | [diff] [blame] | 361 | Iter iter(fList); |
| 362 | while (iter.next()) { |
| 363 | iter->experimental_DrawEdgeAAImageSet( |
Mike Reed | 4f50934 | 2021-01-05 12:03:47 -0500 | [diff] [blame] | 364 | set, count, dstClips, preViewMatrices, sampling, paint, constraint); |
Michael Ludwig | 390f0cc | 2019-03-19 09:16:38 -0400 | [diff] [blame] | 365 | } |
| 366 | } |
| 367 | |
Florin Malita | 1ba5b6b | 2017-10-12 11:08:46 -0400 | [diff] [blame] | 368 | void SkNWayCanvas::onFlush() { |
| 369 | Iter iter(fList); |
| 370 | while (iter.next()) { |
| 371 | iter->flush(); |
| 372 | } |
| 373 | } |