Add missing functions to SkNWayCanvas

R=reed@google.com
BUG=none

Author: enne@chromium.org

Review URL: https://codereview.chromium.org/65513003

git-svn-id: http://skia.googlecode.com/svn/trunk@12295 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
commit-bot@chromium.org 2013-11-14 19:02:41 +00:00
parent 9b9b04924f
commit be65a4c9d6
2 changed files with 35 additions and 9 deletions

View File

@ -38,12 +38,12 @@ public:
virtual bool clipPath(const SkPath&, SkRegion::Op, bool) SK_OVERRIDE; virtual bool clipPath(const SkPath&, SkRegion::Op, bool) SK_OVERRIDE;
virtual bool clipRegion(const SkRegion& deviceRgn, virtual bool clipRegion(const SkRegion& deviceRgn,
SkRegion::Op) SK_OVERRIDE; SkRegion::Op) SK_OVERRIDE;
virtual void clear(SkColor) SK_OVERRIDE;
virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE; virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE;
virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[], virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[],
const SkPaint&) SK_OVERRIDE; const SkPaint&) SK_OVERRIDE;
virtual void drawOval(const SkRect&, const SkPaint&) SK_OVERRIDE;
virtual void drawRect(const SkRect&, const SkPaint&) SK_OVERRIDE; virtual void drawRect(const SkRect&, const SkPaint&) SK_OVERRIDE;
virtual void drawOval(const SkRect&, const SkPaint&) SK_OVERRIDE;
virtual void drawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE; virtual void drawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE;
virtual void drawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE; virtual void drawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE;
virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top, virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top,
@ -53,6 +53,9 @@ public:
DrawBitmapRectFlags flags) SK_OVERRIDE; DrawBitmapRectFlags flags) SK_OVERRIDE;
virtual void drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& m, virtual void drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& m,
const SkPaint*) SK_OVERRIDE; const SkPaint*) SK_OVERRIDE;
virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
const SkRect& dst,
const SkPaint* paint = NULL) SK_OVERRIDE;
virtual void drawSprite(const SkBitmap& bitmap, int left, int top, virtual void drawSprite(const SkBitmap& bitmap, int left, int top,
const SkPaint*) SK_OVERRIDE; const SkPaint*) SK_OVERRIDE;
virtual void drawText(const void* text, size_t byteLength, SkScalar x, virtual void drawText(const void* text, size_t byteLength, SkScalar x,
@ -71,6 +74,7 @@ public:
const SkColor colors[], SkXfermode* xmode, const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int indexCount, const uint16_t indices[], int indexCount,
const SkPaint&) SK_OVERRIDE; const SkPaint&) SK_OVERRIDE;
virtual void drawData(const void* data, size_t length) SK_OVERRIDE;
virtual SkBounder* setBounder(SkBounder*) SK_OVERRIDE; virtual SkBounder* setBounder(SkBounder*) SK_OVERRIDE;
virtual SkDrawFilter* setDrawFilter(SkDrawFilter*) SK_OVERRIDE; virtual SkDrawFilter* setDrawFilter(SkDrawFilter*) SK_OVERRIDE;

View File

@ -168,6 +168,13 @@ bool SkNWayCanvas::clipRegion(const SkRegion& deviceRgn, SkRegion::Op op) {
return this->INHERITED::clipRegion(deviceRgn, op); return this->INHERITED::clipRegion(deviceRgn, op);
} }
void SkNWayCanvas::clear(SkColor color) {
Iter iter(fList);
while (iter.next()) {
iter->clear(color);
}
}
void SkNWayCanvas::drawPaint(const SkPaint& paint) { void SkNWayCanvas::drawPaint(const SkPaint& paint) {
Iter iter(fList); Iter iter(fList);
while (iter.next()) { while (iter.next()) {
@ -183,13 +190,6 @@ void SkNWayCanvas::drawPoints(PointMode mode, size_t count, const SkPoint pts[],
} }
} }
void SkNWayCanvas::drawOval(const SkRect& rect, const SkPaint& paint) {
Iter iter(fList);
while (iter.next()) {
iter->drawOval(rect, paint);
}
}
void SkNWayCanvas::drawRect(const SkRect& rect, const SkPaint& paint) { void SkNWayCanvas::drawRect(const SkRect& rect, const SkPaint& paint) {
Iter iter(fList); Iter iter(fList);
while (iter.next()) { while (iter.next()) {
@ -197,6 +197,13 @@ void SkNWayCanvas::drawRect(const SkRect& rect, const SkPaint& paint) {
} }
} }
void SkNWayCanvas::drawOval(const SkRect& rect, const SkPaint& paint) {
Iter iter(fList);
while (iter.next()) {
iter->drawOval(rect, paint);
}
}
void SkNWayCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) { void SkNWayCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) {
Iter iter(fList); Iter iter(fList);
while (iter.next()) { while (iter.next()) {
@ -236,6 +243,14 @@ void SkNWayCanvas::drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& m,
} }
} }
void SkNWayCanvas::drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
const SkRect& dst, const SkPaint* paint) {
Iter iter(fList);
while (iter.next()) {
iter->drawBitmapNine(bitmap, center, dst, paint);
}
}
void SkNWayCanvas::drawSprite(const SkBitmap& bitmap, int x, int y, void SkNWayCanvas::drawSprite(const SkBitmap& bitmap, int x, int y,
const SkPaint* paint) { const SkPaint* paint) {
Iter iter(fList); Iter iter(fList);
@ -297,6 +312,13 @@ void SkNWayCanvas::drawVertices(VertexMode vmode, int vertexCount,
} }
} }
void SkNWayCanvas::drawData(const void* data, size_t length) {
Iter iter(fList);
while (iter.next()) {
iter->drawData(data, length);
}
}
SkBounder* SkNWayCanvas::setBounder(SkBounder* bounder) { SkBounder* SkNWayCanvas::setBounder(SkBounder* bounder) {
Iter iter(fList); Iter iter(fList);
while (iter.next()) { while (iter.next()) {