summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/LayerBase.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-10-27 23:44:07 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-10-27 23:44:07 -0700
commit7ba6ae3970ec6ebbb1b9d126efff37f523e70792 (patch)
tree53b555f4ff3126114126357c248bad215c04260d /services/surfaceflinger/LayerBase.cpp
parentc40f81047d1c3079dbe1f1c144ec64df30288355 (diff)
parent883dffaa0095ac9ac2be70915f620af9f429dc4b (diff)
downloadframeworks_native-7ba6ae3970ec6ebbb1b9d126efff37f523e70792.zip
frameworks_native-7ba6ae3970ec6ebbb1b9d126efff37f523e70792.tar.gz
frameworks_native-7ba6ae3970ec6ebbb1b9d126efff37f523e70792.tar.bz2
Merge "really fix [3118445] Transform * Transform does not work as expected" into gingerbread
Diffstat (limited to 'services/surfaceflinger/LayerBase.cpp')
-rw-r--r--services/surfaceflinger/LayerBase.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/services/surfaceflinger/LayerBase.cpp b/services/surfaceflinger/LayerBase.cpp
index 069b85a..64eed4b 100644
--- a/services/surfaceflinger/LayerBase.cpp
+++ b/services/surfaceflinger/LayerBase.cpp
@@ -415,6 +415,20 @@ void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const
cb = (texture.NPOTAdjust ? texture.hScale : 1.0f);
}
+ /*
+ * For the buffer transformation, we apply the rotation last.
+ * Since we're transforming the texture-coordinates, we need
+ * to apply the inverse of the buffer transformation:
+ * inverse( FLIP_V -> FLIP_H -> ROT_90 )
+ * <=> inverse( ROT_90 * FLIP_H * FLIP_V )
+ * = inverse(FLIP_V) * inverse(FLIP_H) * inverse(ROT_90)
+ * = FLIP_V * FLIP_H * ROT_270
+ * <=> ROT_270 -> FLIP_H -> FLIP_V
+ *
+ * The rotation is performed first, in the texture coordinate space.
+ *
+ */
+
struct TexCoords {
GLfloat u;
GLfloat v;