void GraphicsContext::setCTM(const AffineTransform& transform)
{
- if (paintingDisabled())
- return;
-
- GC2CANVAS(this)->setMatrix(transform);
+ // The SkPicture mode of Skia does not support SkCanvas::setMatrix(), so we
+ // can not simply use that method here. We could calculate the transform
+ // required to achieve the desired matrix and use SkCanvas::concat(), but
+ // there's currently no need for this.
+ ASSERT_NOT_REACHED();
}
///////////////////////////////////////////////////////////////////////////////
width *= scalingFactor;
decorationOrigin.scale(scalingFactor, scalingFactor);
+#if PLATFORM(ANDROID)
+ // Android does not support GraphicsContext::setCTM().
+ AffineTransform scaleTransform;
+ scaleTransform.scale(1 / scalingFactor);
+ context->concatCTM(scaleTransform);
+#else
AffineTransform newTransform = context->getCTM();
newTransform.scale(1 / scalingFactor);
normalizeTransform(newTransform);
context->setCTM(newTransform);
+#endif
}
decorationOrigin.move(0, -scaledFontMetrics.floatAscent() + positionOffsetForDecoration(decoration, scaledFontMetrics, thickness));
AffineTransform originalTransform;
if (scalingFactor != 1) {
+#if PLATFORM(ANDROID)
+ // Android does not support GraphicsContext::setCTM().
+ context->save();
+ AffineTransform scaleTransform;
+ scaleTransform.scale(1 / scalingFactor);
+ context->concatCTM(scaleTransform);
+#else
originalTransform = context->getCTM();
AffineTransform newTransform = originalTransform;
normalizeTransform(newTransform);
context->setCTM(newTransform);
+#endif
}
scaledFont.drawText(context, textRun, textOrigin + extraOffset, startPosition, endPosition);
if (scalingFactor != 1)
+#if PLATFORM(ANDROID)
+ // Android does not support GraphicsContext::setCTM().
+ context->restore();
+#else
context->setCTM(originalTransform);
+#endif
restoreGraphicsContextAfterTextPainting(context, textRun);