| Index: ui/gfx/transform.cc
|
| diff --git a/ui/gfx/transform.cc b/ui/gfx/transform.cc
|
| index 7fe5174e750444225b748a34a67bb61fdea19c82..c13ae1d65f7565c678a185d43252312edb7ee742 100644
|
| --- a/ui/gfx/transform.cc
|
| +++ b/ui/gfx/transform.cc
|
| @@ -40,6 +40,12 @@ inline bool ApproximatelyOne(SkMScalar x, SkMScalar tolerance) {
|
| return std::abs(x - SkDoubleToMScalar(1.0)) <= tolerance;
|
| }
|
|
|
| +static float Round(float f) {
|
| + if (f == 0.f)
|
| + return f;
|
| + return (f > 0.f) ? std::floor(f + 0.5f) : std::ceil(f - 0.5f);
|
| +}
|
| +
|
| } // namespace
|
|
|
| Transform::Transform(SkMScalar col1row1,
|
| @@ -493,6 +499,12 @@ bool Transform::Blend(const Transform& from, double progress) {
|
| return true;
|
| }
|
|
|
| +void Transform::RoundTranslationComponents() {
|
| + matrix_.set(0, 3, Round(matrix_.get(0, 3)));
|
| + matrix_.set(1, 3, Round(matrix_.get(1, 3)));
|
| +}
|
| +
|
| +
|
| void Transform::TransformPointInternal(const SkMatrix44& xform,
|
| Point3F* point) const {
|
| if (xform.isIdentity())
|
|
|