Revert "move onto new factories for SkMatrix"
This reverts commit 046c2b7d90ba3be4eba95d7a6d3948142e9f1ae5.
Reason for revert: need to update/guard flutter
Original change's description:
> move onto new factories for SkMatrix
>
> Just rename, no functional changes expected.
>
> Change-Id: Id77ab1cf6b1cab35087a7c56000750912cf47383
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290831
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
TBR=fmalita@chromium.org,reed@google.com
Change-Id: Ic74f177128913374b8c60b4df88f04cf72fbacb3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291359
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/samplecode/Sample3D.cpp b/samplecode/Sample3D.cpp
index e54fc9f..1b86f33 100644
--- a/samplecode/Sample3D.cpp
+++ b/samplecode/Sample3D.cpp
@@ -363,9 +363,9 @@
void onOnceBeforeDraw() override {
fRR = SkRRect::MakeRectXY({20, 20, 380, 380}, 50, 50);
auto img = GetResourceAsImage("images/brickwork-texture.jpg");
- fImgShader = img->makeShader(SkMatrix::Scale(2, 2));
+ fImgShader = img->makeShader(SkMatrix::MakeScale(2, 2));
img = GetResourceAsImage("images/brickwork_normal-map.jpg");
- fBmpShader = img->makeShader(SkMatrix::Scale(2, 2));
+ fBmpShader = img->makeShader(SkMatrix::MakeScale(2, 2));
const char code[] = R"(
in shader color_map;
diff --git a/samplecode/SampleBackdropBounds.cpp b/samplecode/SampleBackdropBounds.cpp
index 67ac714..d16d0b9 100644
--- a/samplecode/SampleBackdropBounds.cpp
+++ b/samplecode/SampleBackdropBounds.cpp
@@ -76,7 +76,7 @@
toGlobal = SkMatrix::I();
layerMatrix = ctm;
} else if (ctm.decomposeScale(&scale, &toGlobal)) {
- layerMatrix = SkMatrix::Scale(scale.fWidth, scale.fHeight);
+ layerMatrix = SkMatrix::MakeScale(scale.fWidth, scale.fHeight);
} else {
toGlobal = ctm;
layerMatrix = SkMatrix::I();
diff --git a/samplecode/SampleClip.cpp b/samplecode/SampleClip.cpp
index 014d034..74af4ae 100644
--- a/samplecode/SampleClip.cpp
+++ b/samplecode/SampleClip.cpp
@@ -505,7 +505,7 @@
void onOnceBeforeDraw() override {
fPath = make_path();
fShader = GetResourceAsImage("images/mandrill_128.png")
- ->makeShader(SkMatrix::Scale(3, 3));
+ ->makeShader(SkMatrix::MakeScale(3, 3));
}
bool onChar(SkUnichar uni) override {
diff --git a/samplecode/SampleCowboy.cpp b/samplecode/SampleCowboy.cpp
index 4925508..6ba3177 100644
--- a/samplecode/SampleCowboy.cpp
+++ b/samplecode/SampleCowboy.cpp
@@ -61,12 +61,12 @@
void onDrawContent(SkCanvas* canvas) override {
if (fDom) {
- canvas->setMatrix(SkMatrix::Scale(3, 3));
+ canvas->setMatrix(SkMatrix::MakeScale(3));
canvas->clipRect(SkRect::MakeLTRB(0, 0, 400, 400));
switch (fState) {
case kZoomIn:
fDelta += 0.2f;
- canvas->scale(fDelta, fDelta);
+ canvas->concat(SkMatrix::MakeScale(fDelta));
break;
case kScroll:
if (fAnimationLoop > kAnimationIterations/2) {
@@ -74,12 +74,12 @@
} else {
fDelta -= 80.f;
}
- canvas->scale(fDelta, fDelta);
+ canvas->concat(SkMatrix::MakeScale(fDelta));
canvas->translate(fDelta, 0);
break;
case kZoomOut:
fDelta += 0.2f;
- canvas->scale(fDelta, fDelta);
+ canvas->concat(SkMatrix::MakeScale(fDelta));
break;
}
diff --git a/samplecode/SampleFatBits.cpp b/samplecode/SampleFatBits.cpp
index 7f1ef61..f1dcd29 100644
--- a/samplecode/SampleFatBits.cpp
+++ b/samplecode/SampleFatBits.cpp
@@ -382,7 +382,7 @@
fPts[0].set(1, 1);
fPts[1].set(5, 4);
fPts[2].set(2, 6);
- SkMatrix::Scale(fZoom, fZoom).mapPoints(fPts, 3);
+ SkMatrix::MakeScale(SkIntToScalar(fZoom)).mapPoints(fPts, 3);
fIsRect = false;
}
diff --git a/samplecode/SamplePathText.cpp b/samplecode/SamplePathText.cpp
index d9fb7c0..a8b65e3 100644
--- a/samplecode/SamplePathText.cpp
+++ b/samplecode/SamplePathText.cpp
@@ -67,7 +67,7 @@
void onDrawContent(SkCanvas* canvas) override {
if (fDoClip) {
SkPath deviceSpaceClipPath = fClipPath;
- deviceSpaceClipPath.transform(SkMatrix::Scale(this->width(), this->height()));
+ deviceSpaceClipPath.transform(SkMatrix::MakeScale(this->width(), this->height()));
canvas->save();
canvas->clipPath(deviceSpaceClipPath, SkClipOp::kDifference, true);
canvas->clear(SK_ColorBLACK);
diff --git a/samplecode/SampleTessellatedWedge.cpp b/samplecode/SampleTessellatedWedge.cpp
index a46adce..66b73ba 100644
--- a/samplecode/SampleTessellatedWedge.cpp
+++ b/samplecode/SampleTessellatedWedge.cpp
@@ -32,8 +32,8 @@
float theta = 2*3.1415926535897932384626433832785 * i / numSides;
fPath.lineTo(std::cos(theta), std::sin(theta));
}
- fPath.transform(SkMatrix::Scale(200, 200));
- fPath.transform(SkMatrix::Translate(300, 300));
+ fPath.transform(SkMatrix::MakeScale(200, 200));
+ fPath.transform(SkMatrix::MakeTrans(300, 300));
#else
fPath.moveTo(100, 200);
fPath.cubicTo(100, 100, 400, 100, 400, 200);
@@ -120,7 +120,7 @@
SkPathPriv::UpdatePathPoint(path, fPtIdx, pt + fCurr - fPrev);
} else {
path->transform(
- SkMatrix::Translate(fCurr.x() - fPrev.x(), fCurr.y() - fPrev.y()), path);
+ SkMatrix::MakeTrans(fCurr.x() - fPrev.x(), fCurr.y() - fPrev.y()), path);
}
}