[cogl] Remove padding from eulers and quaternions
- From: Robert Bragg <rbragg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl] Remove padding from eulers and quaternions
- Date: Tue, 15 Oct 2013 13:41:28 +0000 (UTC)
commit 88018b90361215ec33fa317a2c3caf54beffbffa
Author: Robert Bragg <robert linux intel com>
Date: Mon Oct 14 18:07:31 2013 +0100
Remove padding from eulers and quaternions
One of the notable advantages of a Euler representation of a rotation is
that it is compact but we negate that benefit if all CoglEulers have
enough padding to potentially cache a quaternion in the future. Having
padding for all CoglQuaternions is probably also unnecessary as higher
level code can find its own ways of caching data relating to
quaternions.
Reviewed-by: Neil Roberts <neil linux intel com>
cogl/cogl-euler.h | 10 +---------
cogl/cogl-quaternion.h | 8 +-------
2 files changed, 2 insertions(+), 16 deletions(-)
---
diff --git a/cogl/cogl-euler.h b/cogl/cogl-euler.h
index bf526d7..c73cc81 100644
--- a/cogl/cogl-euler.h
+++ b/cogl/cogl-euler.h
@@ -146,16 +146,8 @@ struct _CoglEuler
float heading;
float pitch;
float roll;
-
- /*< private > */
- /* May cached a quaternion here in the future */
- float padding0;
- float padding1;
- float padding2;
- float padding3;
- float padding4;
};
-COGL_STRUCT_SIZE_ASSERT (CoglEuler, 32);
+COGL_STRUCT_SIZE_ASSERT (CoglEuler, 12);
/**
* cogl_euler_init:
diff --git a/cogl/cogl-quaternion.h b/cogl/cogl-quaternion.h
index 02be22e..5db274c 100644
--- a/cogl/cogl-quaternion.h
+++ b/cogl/cogl-quaternion.h
@@ -128,14 +128,8 @@ struct _CoglQuaternion
float x;
float y;
float z;
-
- /*< private >*/
- float padding0;
- float padding1;
- float padding2;
- float padding3;
};
-COGL_STRUCT_SIZE_ASSERT (CoglQuaternion, 32);
+COGL_STRUCT_SIZE_ASSERT (CoglQuaternion, 16);
/**
* cogl_quaternion_init:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]