summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/LayerBase.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-10-27 23:48:26 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-10-27 23:48:26 -0700
commitc23902b27fc8f4825217cef720c95c14e900efd8 (patch)
tree3caf86b3582c7c14ea4ab9195620ebf922f202f5 /services/surfaceflinger/LayerBase.cpp
parenta9d28e75066d8c1d07cbe03af0886bff5ad1f27d (diff)
parentc2dba08cc6c7f1a5dd2d7e6ff741f2e7924fc1b0 (diff)
downloadframeworks_native-c23902b27fc8f4825217cef720c95c14e900efd8.zip
frameworks_native-c23902b27fc8f4825217cef720c95c14e900efd8.tar.gz
frameworks_native-c23902b27fc8f4825217cef720c95c14e900efd8.tar.bz2
am 5c0efef9: am 7d452f69: 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 8ab5a10..df6aa51 100644
--- a/services/surfaceflinger/LayerBase.cpp
+++ b/services/surfaceflinger/LayerBase.cpp
@@ -424,6 +424,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;