Revert "Revert "forward concat44 in nway canvas""

This reverts commit 3723fb7e85.

Fix: don't call the inherited methods on canvas

bug: skia: 9768
Change-Id: Ifb913bd30452ba8389399f709d40c7b58d6157d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263776
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
This commit is contained in:
Mike Reed 2020-01-10 15:56:32 -05:00 committed by Skia Commit-Bot
parent 3723fb7e85
commit f6d70a8e3f
3 changed files with 18 additions and 6 deletions

View File

@ -30,7 +30,9 @@ protected:
bool onDoSaveBehind(const SkRect*) override;
void willRestore() override;
void didConcat44(const SkScalar[16]) override;
void didConcat(const SkMatrix&) override;
void didTranslate(SkScalar x, SkScalar y) override;
void didSetMatrix(const SkMatrix&) override;
void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) override;

View File

@ -547,7 +547,7 @@ class HalfPlaneView3 : public SampleCameraView {
}
void onDrawContent(SkCanvas* canvas) override {
SkMatrix mx = this->get44({0, 0, 400, 400});
SkMatrix44 mx = this->get44({0, 0, 400, 400});
SkPaint paint;
paint.setColor({0.75, 0.75, 0.75, 1});
@ -612,12 +612,10 @@ class HalfPlaneCoons : public SampleCameraView {
}
void onDrawContent(SkCanvas* canvas) override {
SkMatrix mx = this->get44({0, 0, 300, 300});
SkPaint paint;
canvas->save();
canvas->concat(mx);
canvas->concat(this->get44({0, 0, 300, 300}));
const SkPoint* tex = nullptr;
const SkColor* col = nullptr;

View File

@ -92,12 +92,25 @@ void SkNWayCanvas::willRestore() {
this->INHERITED::willRestore();
}
void SkNWayCanvas::didConcat44(const SkScalar m[16]) {
Iter iter(fList);
while (iter.next()) {
iter->concat44(m);
}
}
void SkNWayCanvas::didConcat(const SkMatrix& matrix) {
Iter iter(fList);
while (iter.next()) {
iter->concat(matrix);
}
this->INHERITED::didConcat(matrix);
}
void SkNWayCanvas::didTranslate(SkScalar x, SkScalar y) {
Iter iter(fList);
while (iter.next()) {
iter->translate(x, y);
}
}
void SkNWayCanvas::didSetMatrix(const SkMatrix& matrix) {
@ -105,7 +118,6 @@ void SkNWayCanvas::didSetMatrix(const SkMatrix& matrix) {
while (iter.next()) {
iter->setMatrix(matrix);
}
this->INHERITED::didSetMatrix(matrix);
}
void SkNWayCanvas::onClipRect(const SkRect& rect, SkClipOp op, ClipEdgeStyle edgeStyle) {