Skip to content

Commit

Permalink
Canvas: Remove some unused virtuals, and prepare for signature change (
Browse files Browse the repository at this point in the history
…flutter#17135)

* Canvas: Remove some unused virtuals, and prepare for signature change

* Better vertices fix

* Add empty placeholders for old signature
  • Loading branch information
brianosman authored Mar 13, 2020
1 parent 8a6d99f commit cf2424b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 54 deletions.
16 changes: 0 additions & 16 deletions shell/common/canvas_spy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -139,20 +139,6 @@ void DidDrawCanvas::onDrawBitmapRect(const SkBitmap& bitmap,
did_draw_ = true;
}

void DidDrawCanvas::onDrawBitmapNine(const SkBitmap& bitmap,
const SkIRect& center,
const SkRect& dst,
const SkPaint* paint) {
did_draw_ = true;
}

void DidDrawCanvas::onDrawBitmapLattice(const SkBitmap& bitmap,
const Lattice& lattice,
const SkRect& dst,
const SkPaint* paint) {
did_draw_ = true;
}

void DidDrawCanvas::onDrawImage(const SkImage* image,
SkScalar left,
SkScalar top,
Expand Down Expand Up @@ -201,8 +187,6 @@ void DidDrawCanvas::onDrawDrawable(SkDrawable* drawable,
}

void DidDrawCanvas::onDrawVerticesObject(const SkVertices* vertices,
const SkVertices::Bone bones[],
int boneCount,
SkBlendMode bmode,
const SkPaint& paint) {
MarkDrawIfNonTransparentPaint(paint);
Expand Down
21 changes: 7 additions & 14 deletions shell/common/canvas_spy.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,6 @@ class DidDrawCanvas final : public SkCanvasVirtualEnforcer<SkNoDrawCanvas> {
const SkPaint*,
SrcRectConstraint) override;

// |SkCanvasVirtualEnforcer<SkNoDrawCanvas>|
void onDrawBitmapLattice(const SkBitmap&,
const Lattice&,
const SkRect&,
const SkPaint*) override;

// |SkCanvasVirtualEnforcer<SkNoDrawCanvas>|
void onDrawImageLattice(const SkImage*,
const Lattice&,
Expand All @@ -172,15 +166,14 @@ class DidDrawCanvas final : public SkCanvasVirtualEnforcer<SkNoDrawCanvas> {
const SkPaint*) override;

// |SkCanvasVirtualEnforcer<SkNoDrawCanvas>|
void onDrawBitmapNine(const SkBitmap&,
const SkIRect& center,
const SkRect& dst,
const SkPaint*) override;

// |SkCanvasVirtualEnforcer<SkNoDrawCanvas>|
#ifdef SK_SUPPORT_LEGACY_DRAWVERTS_VIRTUAL
void onDrawVerticesObject(const SkVertices*,
const SkVertices::Bone[],
int,
SkBlendMode,
const SkPaint&) override {}
#endif
void onDrawVerticesObject(const SkVertices*,
const SkVertices::Bone bones[],
int boneCount,
SkBlendMode,
const SkPaint&) override;

Expand Down
16 changes: 0 additions & 16 deletions testing/mock_canvas.cc
Original file line number Diff line number Diff line change
Expand Up @@ -262,30 +262,14 @@ void MockCanvas::onDrawImageNine(const SkImage*,
FML_DCHECK(false);
}

void MockCanvas::onDrawBitmapNine(const SkBitmap&,
const SkIRect&,
const SkRect&,
const SkPaint*) {
FML_DCHECK(false);
}

void MockCanvas::onDrawImageLattice(const SkImage*,
const Lattice&,
const SkRect&,
const SkPaint*) {
FML_DCHECK(false);
}

void MockCanvas::onDrawBitmapLattice(const SkBitmap&,
const Lattice&,
const SkRect&,
const SkPaint*) {
FML_DCHECK(false);
}

void MockCanvas::onDrawVerticesObject(const SkVertices*,
const SkVertices::Bone[],
int,
SkBlendMode,
const SkPaint&) {
FML_DCHECK(false);
Expand Down
13 changes: 5 additions & 8 deletions testing/mock_canvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,21 +217,18 @@ class MockCanvas : public SkCanvasVirtualEnforcer<SkCanvas> {
SkScalar x,
SkScalar y,
const SkPaint* paint) override;
void onDrawBitmapNine(const SkBitmap&,
const SkIRect&,
const SkRect&,
const SkPaint*) override;
void onDrawImageLattice(const SkImage*,
const Lattice&,
const SkRect&,
const SkPaint*) override;
void onDrawBitmapLattice(const SkBitmap&,
const Lattice&,
const SkRect&,
const SkPaint*) override;
#ifdef SK_SUPPORT_LEGACY_DRAWVERTS_VIRTUAL
void onDrawVerticesObject(const SkVertices*,
const SkVertices::Bone[],
int,
SkBlendMode,
const SkPaint&) override {}
#endif
void onDrawVerticesObject(const SkVertices*,
SkBlendMode,
const SkPaint&) override;
void onDrawAtlas(const SkImage*,
Expand Down

0 comments on commit cf2424b

Please sign in to comment.