fix [3118445] Transform * Transform does not work as expected
The problem wasn't in the multiply operator, but rather in the code
that built the transform from the HAL bitmask.
We now use the multiply operator to build the Transform from the bitmask,
which guarantees, it'll always be correct.
Also added a simple test for Transform.
Change-Id: I09bf3b0e51d92f59d83ea91c4cc94fc2aa0bf227
diff --git a/services/surfaceflinger/Transform.h b/services/surfaceflinger/Transform.h
index 20fa11a..8fa5b86 100644
--- a/services/surfaceflinger/Transform.h
+++ b/services/surfaceflinger/Transform.h
@@ -23,6 +23,8 @@
#include <ui/Point.h>
#include <ui/Rect.h>
+#include <hardware/hardware.h>
+
namespace android {
class Region;
@@ -37,12 +39,11 @@
explicit Transform(uint32_t orientation);
~Transform();
- // FIXME: must match OVERLAY_TRANSFORM_*, pull from hardware.h
enum orientation_flags {
ROT_0 = 0x00000000,
- FLIP_H = 0x00000001,
- FLIP_V = 0x00000002,
- ROT_90 = 0x00000004,
+ FLIP_H = HAL_TRANSFORM_FLIP_H,
+ FLIP_V = HAL_TRANSFORM_FLIP_V,
+ ROT_90 = HAL_TRANSFORM_ROT_90,
ROT_180 = FLIP_H|FLIP_V,
ROT_270 = ROT_180|ROT_90,
ROT_INVALID = 0x80