onDrawImageNine is no longer used

nine-patch draws now route through onDrawImageLattice, and canvas no
longer ever calls onDrawImageNine.

Test: make

Change-Id: Ie1d5b0c72690a4986e97efa1feeb736ef704a079
This commit is contained in:
Mike Reed
2021-01-03 20:57:35 -05:00
parent 86e3bd8a07
commit 4efe0bed46
6 changed files with 1 additions and 42 deletions

View File

@@ -40,7 +40,6 @@ X(DrawAnnotation)
X(DrawDrawable)
X(DrawPicture)
X(DrawImage)
X(DrawImageNine)
X(DrawImageRect)
X(DrawImageLattice)
X(DrawTextBlob)

View File

@@ -319,23 +319,6 @@ struct DrawImage final : Op {
BitmapPalette palette;
void draw(SkCanvas* c, const SkMatrix&) const { c->drawImage(image.get(), x, y, &paint); }
};
struct DrawImageNine final : Op {
static const auto kType = Type::DrawImageNine;
DrawImageNine(sk_sp<const SkImage>&& image, const SkIRect& center, const SkRect& dst,
const SkPaint* paint)
: image(std::move(image)), center(center), dst(dst) {
if (paint) {
this->paint = *paint;
}
}
sk_sp<const SkImage> image;
SkIRect center;
SkRect dst;
SkPaint paint;
void draw(SkCanvas* c, const SkMatrix&) const {
c->drawImageNine(image.get(), center, dst, &paint);
}
};
struct DrawImageRect final : Op {
static const auto kType = Type::DrawImageRect;
DrawImageRect(sk_sp<const SkImage>&& image, const SkRect* src, const SkRect& dst,
@@ -633,10 +616,6 @@ void DisplayListData::drawImage(sk_sp<const SkImage> image, SkScalar x, SkScalar
const SkPaint* paint, BitmapPalette palette) {
this->push<DrawImage>(0, std::move(image), x, y, paint, palette);
}
void DisplayListData::drawImageNine(sk_sp<const SkImage> image, const SkIRect& center,
const SkRect& dst, const SkPaint* paint) {
this->push<DrawImageNine>(0, std::move(image), center, dst, paint);
}
void DisplayListData::drawImageRect(sk_sp<const SkImage> image, const SkRect* src,
const SkRect& dst, const SkPaint* paint,
SkCanvas::SrcRectConstraint constraint, BitmapPalette palette) {
@@ -944,10 +923,6 @@ void RecordingCanvas::onDrawImage(const SkImage* img, SkScalar x, SkScalar y,
const SkPaint* paint) {
fDL->drawImage(sk_ref_sp(img), x, y, paint, BitmapPalette::Unknown);
}
void RecordingCanvas::onDrawImageNine(const SkImage* img, const SkIRect& center, const SkRect& dst,
const SkPaint* paint) {
fDL->drawImageNine(sk_ref_sp(img), center, dst, paint);
}
void RecordingCanvas::onDrawImageRect(const SkImage* img, const SkRect* src, const SkRect& dst,
const SkPaint* paint, SrcRectConstraint constraint) {
fDL->drawImageRect(sk_ref_sp(img), src, dst, paint, constraint, BitmapPalette::Unknown);

View File

@@ -188,7 +188,6 @@ public:
void onDrawImage(const SkImage*, SkScalar, SkScalar, const SkPaint*) override;
void onDrawImageLattice(const SkImage*, const Lattice&, const SkRect&, const SkPaint*) override;
void onDrawImageNine(const SkImage*, const SkIRect&, const SkRect&, const SkPaint*) override;
void onDrawImageRect(const SkImage*, const SkRect*, const SkRect&, const SkPaint*,
SrcRectConstraint) override;

View File

@@ -90,11 +90,6 @@ protected:
mOutput << mIdent << "drawImage" << std::endl;
}
void onDrawImageNine(const SkImage*, const SkIRect& center, const SkRect& dst,
const SkPaint*) override {
mOutput << mIdent << "drawImageNine" << std::endl;
}
void onDrawImageRect(const SkImage*, const SkRect*, const SkRect&, const SkPaint*,
SrcRectConstraint) override {
mOutput << mIdent << "drawImageRect" << std::endl;

View File

@@ -119,12 +119,6 @@ public:
drawImageRectCount++;
}
int drawImageNineCount = 0;
void onDrawImageNine(const SkImage* image, const SkIRect& center, const SkRect& dst,
const SkPaint* paint) override {
drawImageNineCount++;
}
int drawImageLatticeCount = 0;
void onDrawImageLattice(const SkImage* image, const SkCanvas::Lattice& lattice,
const SkRect& dst, const SkPaint* paint) override {
@@ -171,4 +165,4 @@ private:
} /* namespace test */
} /* namespace uirenderer */
} /* namespace android */
} /* namespace android */

View File

@@ -74,9 +74,6 @@ public:
SrcRectConstraint) {
ADD_FAILURE() << "onDrawImageRect not expected in this test";
}
void onDrawImageNine(const SkImage*, const SkIRect& center, const SkRect& dst, const SkPaint*) {
ADD_FAILURE() << "onDrawImageNine not expected in this test";
}
void onDrawImageLattice(const SkImage*, const Lattice& lattice, const SkRect& dst,
const SkPaint*) {
ADD_FAILURE() << "onDrawImageLattice not expected in this test";