aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2018-03-08 14:52:20 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-08 20:13:41 +0000
commit3adc12213b2d1efbe417476517ff3381af17a311 (patch)
treeba9af5e434a667ffd5c788d9b6b32f5e5187eb66 /src
parenta3457b8452a24c04a77a5ab32fc6464e005c76a1 (diff)
Fill in some missing virtuals from canvas subclasses
Bug: skia: Change-Id: If7306fa6c5a1619952e1159e6ebca8f04b4d9c8e Reviewed-on: https://skia-review.googlesource.com/113262 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'src')
-rw-r--r--src/utils/SkNWayCanvas.cpp40
-rw-r--r--src/utils/SkPaintFilterCanvas.cpp34
2 files changed, 73 insertions, 1 deletions
diff --git a/src/utils/SkNWayCanvas.cpp b/src/utils/SkNWayCanvas.cpp
index c612c7d7e1..c9f9768e7c 100644
--- a/src/utils/SkNWayCanvas.cpp
+++ b/src/utils/SkNWayCanvas.cpp
@@ -150,6 +150,13 @@ void SkNWayCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) {
}
}
+void SkNWayCanvas::onDrawRegion(const SkRegion& region, const SkPaint& paint) {
+ Iter iter(fList);
+ while (iter.next()) {
+ iter->drawRegion(region, paint);
+ }
+}
+
void SkNWayCanvas::onDrawOval(const SkRect& rect, const SkPaint& paint) {
Iter iter(fList);
while (iter.next()) {
@@ -210,6 +217,14 @@ void SkNWayCanvas::onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& cente
}
}
+void SkNWayCanvas::onDrawBitmapLattice(const SkBitmap& bitmap, const Lattice& lattice,
+ const SkRect& dst, const SkPaint* paint) {
+ Iter iter(fList);
+ while (iter.next()) {
+ iter->drawBitmapLattice(bitmap, lattice, dst, paint);
+ }
+}
+
void SkNWayCanvas::onDrawImage(const SkImage* image, SkScalar left, SkScalar top,
const SkPaint* paint) {
Iter iter(fList);
@@ -226,6 +241,22 @@ void SkNWayCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, cons
}
}
+void SkNWayCanvas::onDrawImageNine(const SkImage* image, const SkIRect& center, const SkRect& dst,
+ const SkPaint* paint) {
+ Iter iter(fList);
+ while (iter.next()) {
+ iter->drawImageNine(image, center, dst, paint);
+ }
+}
+
+void SkNWayCanvas::onDrawImageLattice(const SkImage* image, const Lattice& lattice,
+ const SkRect& dst, const SkPaint* paint) {
+ Iter iter(fList);
+ while (iter.next()) {
+ iter->drawImageLattice(image, lattice, dst, paint);
+ }
+}
+
void SkNWayCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
const SkPaint& paint) {
Iter iter(fList);
@@ -306,6 +337,15 @@ void SkNWayCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4]
}
}
+void SkNWayCanvas::onDrawAtlas(const SkImage* image, const SkRSXform xform[], const SkRect tex[],
+ const SkColor colors[], int count, SkBlendMode bmode,
+ const SkRect* cull, const SkPaint* paint) {
+ Iter iter(fList);
+ while (iter.next()) {
+ iter->drawAtlas(image, xform, tex, colors, count, bmode, cull, paint);
+ }
+}
+
void SkNWayCanvas::onDrawShadowRec(const SkPath& path, const SkDrawShadowRec& rec) {
Iter iter(fList);
while (iter.next()) {
diff --git a/src/utils/SkPaintFilterCanvas.cpp b/src/utils/SkPaintFilterCanvas.cpp
index 668ebe37a9..37a7d44bd5 100644
--- a/src/utils/SkPaintFilterCanvas.cpp
+++ b/src/utils/SkPaintFilterCanvas.cpp
@@ -78,6 +78,13 @@ void SkPaintFilterCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inne
}
}
+void SkPaintFilterCanvas::onDrawRegion(const SkRegion& region, const SkPaint& paint) {
+ AutoPaintFilter apf(this, kPath_Type, paint);
+ if (apf.shouldDraw()) {
+ this->INHERITED::onDrawRegion(region, *apf.paint());
+ }
+}
+
void SkPaintFilterCanvas::onDrawOval(const SkRect& rect, const SkPaint& paint) {
AutoPaintFilter apf(this, kOval_Type, paint);
if (apf.shouldDraw()) {
@@ -124,6 +131,14 @@ void SkPaintFilterCanvas::onDrawBitmapNine(const SkBitmap& bm, const SkIRect& ce
}
}
+void SkPaintFilterCanvas::onDrawBitmapLattice(const SkBitmap& bitmap, const Lattice& lattice,
+ const SkRect& dst, const SkPaint* paint) {
+ AutoPaintFilter apf(this, kBitmap_Type, paint);
+ if (apf.shouldDraw()) {
+ this->INHERITED::onDrawBitmapLattice(bitmap, lattice, dst, apf.paint());
+ }
+}
+
void SkPaintFilterCanvas::onDrawImage(const SkImage* image, SkScalar left, SkScalar top,
const SkPaint* paint) {
AutoPaintFilter apf(this, kBitmap_Type, paint);
@@ -142,13 +157,21 @@ void SkPaintFilterCanvas::onDrawImageRect(const SkImage* image, const SkRect* sr
}
void SkPaintFilterCanvas::onDrawImageNine(const SkImage* image, const SkIRect& center,
- const SkRect& dst, const SkPaint* paint) {
+ const SkRect& dst, const SkPaint* paint) {
AutoPaintFilter apf(this, kBitmap_Type, paint);
if (apf.shouldDraw()) {
this->INHERITED::onDrawImageNine(image, center, dst, apf.paint());
}
}
+void SkPaintFilterCanvas::onDrawImageLattice(const SkImage* image, const Lattice& lattice,
+ const SkRect& dst, const SkPaint* paint) {
+ AutoPaintFilter apf(this, kBitmap_Type, paint);
+ if (apf.shouldDraw()) {
+ this->INHERITED::onDrawImageLattice(image, lattice, dst, apf.paint());
+ }
+}
+
void SkPaintFilterCanvas::onDrawVerticesObject(const SkVertices* vertices, SkBlendMode bmode,
const SkPaint& paint) {
AutoPaintFilter apf(this, kVertices_Type, paint);
@@ -233,6 +256,15 @@ void SkPaintFilterCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkS
}
}
+void SkPaintFilterCanvas::onDrawAtlas(const SkImage* image, const SkRSXform xform[],
+ const SkRect tex[], const SkColor colors[], int count,
+ SkBlendMode bmode, const SkRect* cull, const SkPaint* paint) {
+ AutoPaintFilter apf(this, kBitmap_Type, paint);
+ if (apf.shouldDraw()) {
+ this->INHERITED::onDrawAtlas(image, xform, tex, colors, count, bmode, cull, apf.paint());
+ }
+}
+
sk_sp<SkSurface> SkPaintFilterCanvas::onNewSurface(const SkImageInfo& info,
const SkSurfaceProps& props) {
return proxy()->makeSurface(info, &props);