SkNWayCanvas.cpp revision 1cab2921ab279367f8206cdadc9259d12e603548
11cab2921ab279367f8206cdadc9259d12e603548Derek Sollenberger 21cab2921ab279367f8206cdadc9259d12e603548Derek Sollenberger/* 31cab2921ab279367f8206cdadc9259d12e603548Derek Sollenberger * Copyright 2011 Google Inc. 41cab2921ab279367f8206cdadc9259d12e603548Derek Sollenberger * 51cab2921ab279367f8206cdadc9259d12e603548Derek Sollenberger * Use of this source code is governed by a BSD-style license that can be 61cab2921ab279367f8206cdadc9259d12e603548Derek Sollenberger * found in the LICENSE file. 71cab2921ab279367f8206cdadc9259d12e603548Derek Sollenberger */ 87cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed#include "SkNWayCanvas.h" 97cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 107cc0a6ac7b817b217dd614cba96fc533b32d505dMike ReedSkNWayCanvas::SkNWayCanvas() {} 117cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 127cc0a6ac7b817b217dd614cba96fc533b32d505dMike ReedSkNWayCanvas::~SkNWayCanvas() { 137cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed this->removeAll(); 147cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 157cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 167cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedvoid SkNWayCanvas::addCanvas(SkCanvas* canvas) { 177cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed if (canvas) { 187cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed canvas->ref(); 197cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed *fList.append() = canvas; 207cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 217cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 227cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 237cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedvoid SkNWayCanvas::removeCanvas(SkCanvas* canvas) { 247cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed int index = fList.find(canvas); 257cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed if (index >= 0) { 267cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed canvas->unref(); 277cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed fList.removeShuffle(index); 287cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 297cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 307cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 317cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedvoid SkNWayCanvas::removeAll() { 327cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed fList.unrefAll(); 337cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed fList.reset(); 347cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 357cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 367cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed/////////////////////////////////////////////////////////////////////////// 377cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed// These are forwarded to the N canvases we're referencing 387cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 397cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedclass SkNWayCanvas::Iter { 407cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedpublic: 417cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter(const SkTDArray<SkCanvas*>& list) : fList(list) { 427cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed fIndex = 0; 437cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 447cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed bool next() { 457cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed if (fIndex < fList.count()) { 467cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed fCanvas = fList[fIndex++]; 477cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed return true; 487cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 497cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed return false; 507cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 517cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed SkCanvas* operator->() { return fCanvas; } 527cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 537cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedprivate: 547cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed const SkTDArray<SkCanvas*>& fList; 557cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed int fIndex; 567cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed SkCanvas* fCanvas; 577cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed}; 587cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 597cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedint SkNWayCanvas::save(SaveFlags flags) { 607cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 617cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 627cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed iter->save(flags); 637cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 647cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed return this->INHERITED::save(flags); 657cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 667cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 677cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedint SkNWayCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint, 687cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed SaveFlags flags) { 697cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 707cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 717cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed iter->saveLayer(bounds, paint, flags); 727cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 737cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed return this->INHERITED::saveLayer(bounds, paint, flags); 747cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 757cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 767cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedvoid SkNWayCanvas::restore() { 777cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 787cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 797cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed iter->restore(); 807cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 817cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed this->INHERITED::restore(); 827cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 837cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 847cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedbool SkNWayCanvas::translate(SkScalar dx, SkScalar dy) { 857cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 867cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 877cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed iter->translate(dx, dy); 887cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 897cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed return this->INHERITED::translate(dx, dy); 907cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 917cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 927cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedbool SkNWayCanvas::scale(SkScalar sx, SkScalar sy) { 937cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 947cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 957cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed iter->scale(sx, sy); 967cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 977cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed return this->INHERITED::scale(sx, sy); 987cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 997cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 1007cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedbool SkNWayCanvas::rotate(SkScalar degrees) { 1017cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 1027cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 1037cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed iter->rotate(degrees); 1047cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 1057cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed return this->INHERITED::rotate(degrees); 1067cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 1077cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 1087cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedbool SkNWayCanvas::skew(SkScalar sx, SkScalar sy) { 1097cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 1107cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 1117cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed iter->skew(sx, sy); 1127cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 1137cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed return this->INHERITED::skew(sx, sy); 1147cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 1157cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 1167cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedbool SkNWayCanvas::concat(const SkMatrix& matrix) { 1177cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 1187cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 1197cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed iter->concat(matrix); 1207cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 1217cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed return this->INHERITED::concat(matrix); 1227cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 1237cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 1247cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedvoid SkNWayCanvas::setMatrix(const SkMatrix& matrix) { 1257cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 1267cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 1277cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed iter->setMatrix(matrix); 1287cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 1297cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed this->INHERITED::setMatrix(matrix); 1307cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 1317cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 1321cab2921ab279367f8206cdadc9259d12e603548Derek Sollenbergerbool SkNWayCanvas::clipRect(const SkRect& rect, SkRegion::Op op, bool doAA) { 1337cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 1347cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 1351cab2921ab279367f8206cdadc9259d12e603548Derek Sollenberger iter->clipRect(rect, op, doAA); 1367cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 1371cab2921ab279367f8206cdadc9259d12e603548Derek Sollenberger return this->INHERITED::clipRect(rect, op, doAA); 1387cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 1397cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 1401cab2921ab279367f8206cdadc9259d12e603548Derek Sollenbergerbool SkNWayCanvas::clipPath(const SkPath& path, SkRegion::Op op, bool doAA) { 1417cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 1427cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 1431cab2921ab279367f8206cdadc9259d12e603548Derek Sollenberger iter->clipPath(path, op, doAA); 1447cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 1451cab2921ab279367f8206cdadc9259d12e603548Derek Sollenberger return this->INHERITED::clipPath(path, op, doAA); 1467cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 1477cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 1487cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedbool SkNWayCanvas::clipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { 1497cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 1507cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 1517cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed iter->clipRegion(deviceRgn, op); 1527cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 1537cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed return this->INHERITED::clipRegion(deviceRgn, op); 1547cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 1557cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 1567cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedvoid SkNWayCanvas::drawPaint(const SkPaint& paint) { 1577cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 1587cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 1597cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed iter->drawPaint(paint); 1607cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 1617cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 1627cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 1637cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedvoid SkNWayCanvas::drawPoints(PointMode mode, size_t count, const SkPoint pts[], 1647cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed const SkPaint& paint) { 1657cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 1667cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 1677cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed iter->drawPoints(mode, count, pts, paint); 1687cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 1697cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 1707cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 1717cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedvoid SkNWayCanvas::drawRect(const SkRect& rect, const SkPaint& paint) { 1727cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 1737cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 1747cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed iter->drawRect(rect, paint); 1757cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 1767cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 1777cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 1787cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedvoid SkNWayCanvas::drawPath(const SkPath& path, const SkPaint& paint) { 1797cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 1807cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 1817cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed iter->drawPath(path, paint); 1827cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 1837cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 1847cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 1857cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedvoid SkNWayCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y, 1867cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed const SkPaint* paint) { 1877cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 1887cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 1897cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed iter->drawBitmap(bitmap, x, y, paint); 1907cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 1917cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 1927cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 1937cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedvoid SkNWayCanvas::drawBitmapRect(const SkBitmap& bitmap, const SkIRect* src, 1947cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed const SkRect& dst, const SkPaint* paint) { 1957cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 1967cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 1977cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed iter->drawBitmapRect(bitmap, src, dst, paint); 1987cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 1997cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 2007cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 2017cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedvoid SkNWayCanvas::drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& m, 2027cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed const SkPaint* paint) { 2037cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 2047cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 2057cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed iter->drawBitmapMatrix(bitmap, m, paint); 2067cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 2077cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 2087cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 2097cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedvoid SkNWayCanvas::drawSprite(const SkBitmap& bitmap, int x, int y, 2107cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed const SkPaint* paint) { 2117cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 2127cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 2137cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed iter->drawSprite(bitmap, x, y, paint); 2147cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 2157cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 2167cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 2177cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedvoid SkNWayCanvas::drawText(const void* text, size_t byteLength, SkScalar x, 2187cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed SkScalar y, const SkPaint& paint) { 2197cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 2207cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 2217cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed iter->drawText(text, byteLength, x, y, paint); 2227cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 2237cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 2247cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 2257cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedvoid SkNWayCanvas::drawPosText(const void* text, size_t byteLength, 2267cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed const SkPoint pos[], const SkPaint& paint) { 2277cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 2287cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 2297cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed iter->drawPosText(text, byteLength, pos, paint); 2307cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 2317cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 2327cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 2337cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedvoid SkNWayCanvas::drawPosTextH(const void* text, size_t byteLength, 2347cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed const SkScalar xpos[], SkScalar constY, 2357cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed const SkPaint& paint) { 2367cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 2377cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 2387cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed iter->drawPosTextH(text, byteLength, xpos, constY, paint); 2397cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 2407cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 2417cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 2427cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedvoid SkNWayCanvas::drawTextOnPath(const void* text, size_t byteLength, 2437cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed const SkPath& path, const SkMatrix* matrix, 2447cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed const SkPaint& paint) { 2457cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 2467cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 2477cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed iter->drawTextOnPath(text, byteLength, path, matrix, paint); 2487cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 2497cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 2507cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 2517cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedvoid SkNWayCanvas::drawPicture(SkPicture& picture) { 2527cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 2537cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 2547cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed iter->drawPicture(picture); 2557cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 2567cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 2577cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 2587cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reedvoid SkNWayCanvas::drawVertices(VertexMode vmode, int vertexCount, 2597cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed const SkPoint vertices[], const SkPoint texs[], 2607cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed const SkColor colors[], SkXfermode* xmode, 2617cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed const uint16_t indices[], int indexCount, 2627cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed const SkPaint& paint) { 2637cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 2647cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 2657cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed iter->drawVertices(vmode, vertexCount, vertices, texs, colors, xmode, 2667cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed indices, indexCount, paint); 2677cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 2687cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 2697cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 2707cc0a6ac7b817b217dd614cba96fc533b32d505dMike ReedSkBounder* SkNWayCanvas::setBounder(SkBounder* bounder) { 2717cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 2727cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 2737cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed iter->setBounder(bounder); 2747cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 2757cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed return this->INHERITED::setBounder(bounder); 2767cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 2777cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 2787cc0a6ac7b817b217dd614cba96fc533b32d505dMike ReedSkDrawFilter* SkNWayCanvas::setDrawFilter(SkDrawFilter* filter) { 2797cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed Iter iter(fList); 2807cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed while (iter.next()) { 2817cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed iter->setDrawFilter(filter); 2827cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed } 2837cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed return this->INHERITED::setDrawFilter(filter); 2847cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed} 2857cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 2867cc0a6ac7b817b217dd614cba96fc533b32d505dMike Reed 287