Rename SkDevice::ctm() to localToDevice()
This helps differentiate the SkCanvas' total CTM
(canvas transform matrix), from the device-specific transform matrix
that maps draws from local to device space.
Bug: 9545
Change-Id: I67f40d9b1bc92377bf0520fbc9245f1058e179e6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249424
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Reed <reed@google.com>
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index b31ee31..90335e8 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1028,11 +1028,11 @@
// Manually setting the device's CTM requires accounting for the device's origin.
// TODO (michaelludwig) - This could be simpler if the dst device had its origin configured
- // before filtering the backdrop device, and if SkAutoDeviceCTMRestore had a way to accept
+ // before filtering the backdrop device, and if SkAutoDeviceTransformRestore had a way to accept
// a global CTM instead of a device CTM.
SkMatrix dstCTM = toRoot;
dstCTM.postTranslate(-dstOrigin.x(), -dstOrigin.y());
- SkAutoDeviceCTMRestore acr(dst, dstCTM);
+ SkAutoDeviceTransformRestore adr(dst, dstCTM);
// And because devices don't have a special-image draw function that supports arbitrary
// matrices, we are abusing the asImage() functionality here...
@@ -2434,7 +2434,7 @@
const SkPaint& pnt = draw.paint();
if (special) {
SkPoint pt;
- iter.fDevice->ctm().mapXY(x, y, &pt);
+ iter.fDevice->localToDevice().mapXY(x, y, &pt);
iter.fDevice->drawSpecial(special.get(),
SkScalarRoundToInt(pt.fX),
SkScalarRoundToInt(pt.fY), pnt,
@@ -2512,7 +2512,7 @@
const SkPaint& pnt = draw.paint();
if (special) {
SkPoint pt;
- iter.fDevice->ctm().mapXY(x, y, &pt);
+ iter.fDevice->localToDevice().mapXY(x, y, &pt);
iter.fDevice->drawSpecial(special.get(),
SkScalarRoundToInt(pt.fX),
SkScalarRoundToInt(pt.fY), pnt,
@@ -3003,7 +3003,7 @@
}
const SkMatrix& SkCanvas::LayerIter::matrix() const {
- return fImpl->fDevice->ctm();
+ return fImpl->fDevice->localToDevice();
}
const SkPaint& SkCanvas::LayerIter::paint() const {