comparison src/graph_engine_skia.cpp @ 514:663d361eb3b8 Android_Skia

Set perspective of 3x3 matrix when translate MB matrix to SkMatrix. perspective values are used to calculate a z-aix value to map a point from 3D space to 2D canvas.
author Thinker K.F. Li <thinker@branda.to>
date Tue, 01 Dec 2009 22:55:27 +0800
parents 6394a1e33b2f
children b42d69ab8857 586e50f82c1f
comparison
equal deleted inserted replaced
513:6394a1e33b2f 514:663d361eb3b8
106 (sk).setSkewX(CO_AIX_2_SKSCALAR((mb)[1])); \ 106 (sk).setSkewX(CO_AIX_2_SKSCALAR((mb)[1])); \
107 (sk).setTranslateX(CO_AIX_2_SKSCALAR((mb)[2])); \ 107 (sk).setTranslateX(CO_AIX_2_SKSCALAR((mb)[2])); \
108 (sk).setSkewY(CO_AIX_2_SKSCALAR((mb)[3])); \ 108 (sk).setSkewY(CO_AIX_2_SKSCALAR((mb)[3])); \
109 (sk).setScaleY(CO_AIX_2_SKSCALAR((mb)[4])); \ 109 (sk).setScaleY(CO_AIX_2_SKSCALAR((mb)[4])); \
110 (sk).setTranslateY(CO_AIX_2_SKSCALAR((mb)[5])); \ 110 (sk).setTranslateY(CO_AIX_2_SKSCALAR((mb)[5])); \
111 (sk).setPerspX(0); \
112 (sk).setPerspY(0); \
113 (sk).set(SkMatrix::kMPersp2, 1); \
111 } 114 }
112 #define SKMATRIX_2_MB_MATRIX(mb, sk) { \ 115 #define SKMATRIX_2_MB_MATRIX(mb, sk) { \
113 (mb)[0] = SKSCALAR_2_CO_AIX((sk).getScaleX()); \ 116 (mb)[0] = SKSCALAR_2_CO_AIX((sk).getScaleX()); \
114 (mb)[1] = SKSCALAR_2_CO_AIX((sk).getSkewX()); \ 117 (mb)[1] = SKSCALAR_2_CO_AIX((sk).getSkewX()); \
115 (mb)[2] = SKSCALAR_2_CO_AIX((sk).getTranslateX()); \ 118 (mb)[2] = SKSCALAR_2_CO_AIX((sk).getTranslateX()); \