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>
This commit is contained in:
Brian Osman 2018-03-08 14:52:20 -05:00 committed by Skia Commit-Bot
parent a3457b8452
commit 3adc12213b
5 changed files with 90 additions and 1 deletions

View File

@ -58,6 +58,7 @@ protected:
void onDrawPaint(const SkPaint&) override;
void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPaint&) override;
void onDrawRect(const SkRect&, const SkPaint&) override;
void onDrawRegion(const SkRegion&, const SkPaint&) override;
void onDrawOval(const SkRect&, const SkPaint&) override;
void onDrawArc(const SkRect&, SkScalar, SkScalar, bool, const SkPaint&) override;
void onDrawRRect(const SkRRect&, const SkPaint&) override;
@ -68,9 +69,17 @@ protected:
void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint*) override;
void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst,
const SkPaint*, SrcRectConstraint) override;
void onDrawBitmapLattice(const SkBitmap&, const Lattice&, const SkRect&,
const SkPaint*) override;
void onDrawImageLattice(const SkImage*, const Lattice&, const SkRect&,
const SkPaint*) override;
void onDrawImageNine(const SkImage*, const SkIRect& center, const SkRect& dst,
const SkPaint*) override;
void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst,
const SkPaint*) override;
void onDrawVerticesObject(const SkVertices*, SkBlendMode, const SkPaint&) override;
void onDrawAtlas(const SkImage*, const SkRSXform[], const SkRect[], const SkColor[],
int, SkBlendMode, const SkRect*, const SkPaint*) override;
void onDrawShadowRec(const SkPath&, const SkDrawShadowRec&) override;
void onClipRect(const SkRect&, SkClipOp, ClipEdgeStyle) override;

View File

@ -74,6 +74,7 @@ protected:
void onDrawVerticesObject(const SkVertices*, SkBlendMode, const SkPaint&) override {}
void onDrawAtlas(const SkImage*, const SkRSXform[], const SkRect[], const SkColor[],
int, SkBlendMode, const SkRect*, const SkPaint*) override {}
void onDrawShadowRec(const SkPath&, const SkDrawShadowRec&) override {}
private:
typedef SkCanvas INHERITED;

View File

@ -69,6 +69,7 @@ protected:
void onDrawRect(const SkRect&, const SkPaint&) override;
void onDrawRRect(const SkRRect&, const SkPaint&) override;
void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) override;
void onDrawRegion(const SkRegion&, const SkPaint&) override;
void onDrawOval(const SkRect&, const SkPaint&) override;
void onDrawArc(const SkRect&, SkScalar, SkScalar, bool, const SkPaint&) override;
void onDrawPath(const SkPath&, const SkPaint&) override;
@ -77,11 +78,15 @@ protected:
SrcRectConstraint) override;
void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst,
const SkPaint*) override;
void onDrawBitmapLattice(const SkBitmap&, const Lattice&, const SkRect&,
const SkPaint*) override;
void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint*) override;
void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst,
const SkPaint*, SrcRectConstraint) override;
void onDrawImageNine(const SkImage*, const SkIRect& center, const SkRect& dst,
const SkPaint*) override;
void onDrawImageLattice(const SkImage*, const Lattice&, const SkRect&,
const SkPaint*) override;
void onDrawVerticesObject(const SkVertices*, SkBlendMode, const SkPaint&) override;
void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
const SkPoint texCoords[4], SkBlendMode,
@ -101,6 +106,8 @@ protected:
const SkRect* cull, const SkPaint& paint) override;
void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
const SkPaint& paint) override;
void onDrawAtlas(const SkImage*, const SkRSXform[], const SkRect[], const SkColor[],
int, SkBlendMode, const SkRect*, const SkPaint*) override;
// Forwarded to the wrapped canvas.
sk_sp<SkSurface> onNewSurface(const SkImageInfo&, const SkSurfaceProps&) override;

View File

@ -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()) {

View File

@ -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);