Source/WebCore/platform/graphics/skia/ImageSkia.cpp
static void TransformDimensions(const SkMatrix& matrix, float srcWidth, float srcHeight, float* destWidth, float* destHeight) {
    // Transform 3 points to see how long each side of the bitmap will be.
    SkPoint src_points[3];  // (0, 0), (width, 0), (0, height).
    src_points[0].set(0, 0);
    src_points[1].set(SkFloatToScalar(srcWidth), 0);
    src_points[2].set(0, SkFloatToScalar(srcHeight));

    // Now measure the length of the two transformed vectors relative to the
    // transformed origin to see how big the bitmap will be. Note: for skews,
    // this isn't the best thing, but we don't have skews.
    SkPoint dest_points[3];
    matrix.mapPoints(dest_points, src_points, 3);
    *destWidth = SkScalarToFloat((dest_points[1] - dest_points[0]).length());
    *destHeight = SkScalarToFloat((dest_points[2] - dest_points[0]).length());
}
// Transforms the given dimensions with the given matrix. Used to see how big
// images will be once transformed.
Transforms the given dimensions with the given matrix. Used to see how big
images will be once transformed.
Transforms the given dimensions with the given matrix . Used to see how big images will be once transformed .
static void TransformDimensions(const SkMatrix& matrix, float srcWidth, float srcHeight, float* destWidth, float* destHeight) {
    SkPoint src_points[3];  
    src_points[0].set(0, 0);
    src_points[1].set(SkFloatToScalar(srcWidth), 0);
    src_points[2].set(0, SkFloatToScalar(srcHeight));
    SkPoint dest_points[3];
    matrix.mapPoints(dest_points, src_points, 3);
    *destWidth = SkScalarToFloat((dest_points[1] - dest_points[0]).length());
    *destHeight = SkScalarToFloat((dest_points[2] - dest_points[0]).length());
}
static void TransformDimensions ( const SkMatrix & matrix , float srcWidth , float srcHeight , float * destWidth , float * destHeight ) { SkPoint src_points [ 3 ] ; src_points [ 0 ] . set ( 0 , 0 ) ; src_points [ 1 ] . set ( SkFloatToScalar ( srcWidth ) , 0 ) ; src_points [ 2 ] . set ( 0 , SkFloatToScalar ( srcHeight ) ) ; SkPoint dest_points [ 3 ] ; matrix . mapPoints ( dest_points , src_points , 3 ) ; * destWidth = SkScalarToFloat ( ( dest_points [ 1 ] - dest_points [ 0 ] ) . length ( ) ) ; * destHeight = SkScalarToFloat ( ( dest_points [ 2 ] - dest_points [ 0 ] ) . length ( ) ) ; }
Transforms the given dimensions with the given matrix.
Transforms the given dimensions with the given matrix .
// Transform 3 points to see how long each side of the bitmap will be. // (0, 0), (width, 0), (0, height). // Now measure the length of the two transformed vectors relative to the // transformed origin to see how big the bitmap will be. Note: for skews, // this isn't the best thing, but we don't have skews.