SkMatrix m; m.setIdentity(); // m is now the identity matrix m.setIDiv(4); // m is now scaled down by a factor of 4
SkMatrix m; m.setScale(2, 2); // m is now scaled up by a factor of 2 m.setIDiv(2); // m is now scaled back down by a factor of 2In this example, we create a new SkMatrix object, scale it up using setScale(), and then immediately scale it back down by dividing it by 2 using setIDiv(). SkMatrix and its methods are part of the Skia package library, which is used in many applications and platforms, including Google Chrome, Firefox, and Android.