private void setSnapshotTransformInTransaction(Matrix matrix, float alpha) { if (mSurface != null) { matrix.getValues(mTmpFloats); mSurface.setPosition(mTmpFloats[Matrix.MTRANS_X], mTmpFloats[Matrix.MTRANS_Y]); mSurface.setMatrix( mTmpFloats[Matrix.MSCALE_X], mTmpFloats[Matrix.MSKEW_Y], mTmpFloats[Matrix.MSKEW_X], mTmpFloats[Matrix.MSCALE_Y]); mSurface.setAlpha(alpha); if (DEBUG_TRANSFORMS) { float[] srcPnts = new float[] {0, 0, mWidth, mHeight}; float[] dstPnts = new float[4]; matrix.mapPoints(dstPnts, srcPnts); /** M:Change the tag to WindowManager */ Slog.i( WindowManagerService.TAG, "Original : (" + srcPnts[0] + "," + srcPnts[1] + ")-(" + srcPnts[2] + "," + srcPnts[3] + ")"); Slog.i( WindowManagerService.TAG, "Transformed: (" + dstPnts[0] + "," + dstPnts[1] + ")-(" + dstPnts[2] + "," + dstPnts[3] + ")"); } } }
void setSnapshotTransform(Matrix matrix, float alpha) { if (mSurface != null) { matrix.getValues(mTmpFloats); mSurface.setPosition(mTmpFloats[Matrix.MTRANS_X], mTmpFloats[Matrix.MTRANS_Y]); mSurface.setMatrix( mTmpFloats[Matrix.MSCALE_X], mTmpFloats[Matrix.MSKEW_Y], mTmpFloats[Matrix.MSKEW_X], mTmpFloats[Matrix.MSCALE_Y]); mSurface.setAlpha(alpha); if (DEBUG) { float[] srcPnts = new float[] {0, 0, mWidth, mHeight}; float[] dstPnts = new float[4]; matrix.mapPoints(dstPnts, srcPnts); Slog.i( TAG, "Original : (" + srcPnts[0] + "," + srcPnts[1] + ")-(" + srcPnts[2] + "," + srcPnts[3] + ")"); Slog.i( TAG, "Transformed: (" + dstPnts[0] + "," + dstPnts[1] + ")-(" + dstPnts[2] + "," + dstPnts[3] + ")"); } } }