summaryrefslogtreecommitdiff
path: root/src/lib/evas/include/evas_3d_utils.h
diff options
context:
space:
mode:
authorOleksandr Shcherbina <o.shcherbina@samsung.com>2015-05-13 15:32:10 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-05-13 16:20:22 +0200
commitfc4f755c28ef70709a38a910edb750e11c0ddd9f (patch)
treea0e8c8bc08214a609891d473c1e71274c89090b6 /src/lib/evas/include/evas_3d_utils.h
parentf6a39ab571253e25df5e4d59b551fe167f87f3ed (diff)
evas: fix coverity CID 1297159 and CID 1297158.
Reviewers: Hermet, b.devichev, cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2494 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/evas/include/evas_3d_utils.h')
-rw-r--r--src/lib/evas/include/evas_3d_utils.h33
1 files changed, 13 insertions, 20 deletions
diff --git a/src/lib/evas/include/evas_3d_utils.h b/src/lib/evas/include/evas_3d_utils.h
index 87bf70867d..828348df77 100644
--- a/src/lib/evas/include/evas_3d_utils.h
+++ b/src/lib/evas/include/evas_3d_utils.h
@@ -1151,33 +1151,26 @@ evas_mat3_invserse(Evas_Mat3 *out, const Evas_Mat3 *mat)
1151} 1151}
1152 1152
1153static inline void 1153static inline void
1154evas_mat3_set_position_transform(Evas_Mat3 *out, const Evas_Real p_x, const Evas_Real p_y) 1154evas_mat3_set_position_transform(Evas_Mat3 *out, const Evas_Real p_x,
1155{ 1155 const Evas_Real p_y)
1156 Evas_Real *d = &out->m[0]; 1156{
1157 memset(d, 0x00, sizeof(Evas_Mat3)); 1157 evas_mat3_identity_set(out);
1158 d[0] = 1; 1158 out->m[2] = p_x;
1159 d[2] = p_x; 1159 out->m[5] = p_y;
1160 d[4] = 1; 1160 if ((fabs(p_x) > FLT_EPSILON) ||
1161 d[5] = p_y; 1161 (fabs(p_y) > FLT_EPSILON))
1162 d[8] = 1;
1163 if (p_x || p_y)
1164 out->flags = 0; 1162 out->flags = 0;
1165 else
1166 out->flags = EVAS_MATRIX_IS_IDENTITY;
1167} 1163}
1168 1164
1169static inline void 1165static inline void
1170evas_mat3_set_scale_transform(Evas_Mat3 *out, Evas_Real s_x, Evas_Real s_y) 1166evas_mat3_set_scale_transform(Evas_Mat3 *out, Evas_Real s_x, Evas_Real s_y)
1171{ 1167{
1172 Evas_Real *d = &out->m[0]; 1168 evas_mat3_identity_set(out);
1173 memset(d, 0x00, sizeof(Evas_Mat3)); 1169 out->m[0] = s_x;
1174 d[0] = s_x; 1170 out->m[4] = s_y;
1175 d[4] = s_y; 1171 if ((fabs(s_x - 1.0) > FLT_EPSILON) ||
1176 d[8] = 1; 1172 (fabs(s_y - 1.0) > FLT_EPSILON))
1177 if (s_x != 1.0 || s_y != 1.0)
1178 out->flags = 0; 1173 out->flags = 0;
1179 else
1180 out->flags = EVAS_MATRIX_IS_IDENTITY;
1181} 1174}
1182 1175
1183/* 2x2 matrix */ 1176/* 2x2 matrix */