Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

frameworks/native: SF: Adapt vertices to GL co-ordinates

Adapt co-ordinates in drawWormhole() from display co-ordinate system to
GL co-ordinate system.

Change-Id: Id25a9e63c38ceb242f6d67eaca9e88cb95aead42
CRs-Fixed:382824
  • Loading branch information...
commit d88381fbe61bee1d2096a942e9ae23003b51533c 1 parent 0d04b8a
authored August 28, 2012 Whitehawkx committed September 12, 2012
18  services/surfaceflinger/SurfaceFlinger.cpp
@@ -1076,6 +1076,11 @@ void SurfaceFlinger::drawWormhole() const
1076 1076
     if (region.isEmpty())
1077 1077
         return;
1078 1078
 
  1079
+#ifdef QCOM_HARDWARE
  1080
+    const DisplayHardware& hw(graphicPlane(0).displayHardware());
  1081
+    const int32_t height = hw.getHeight();
  1082
+#endif
  1083
+
1079 1084
     glDisable(GL_TEXTURE_EXTERNAL_OES);
1080 1085
     glDisable(GL_TEXTURE_2D);
1081 1086
     glDisable(GL_BLEND);
@@ -1088,13 +1093,20 @@ void SurfaceFlinger::drawWormhole() const
1088 1093
     while (it != end) {
1089 1094
         const Rect& r = *it++;
1090 1095
         vertices[0][0] = r.left;
1091  
-        vertices[0][1] = r.top;
1092 1096
         vertices[1][0] = r.right;
1093  
-        vertices[1][1] = r.top;
1094 1097
         vertices[2][0] = r.right;
1095  
-        vertices[2][1] = r.bottom;
1096 1098
         vertices[3][0] = r.left;
  1099
+#ifdef QCOM_HARDWARE
  1100
+        vertices[0][1] = height - r.top;
  1101
+        vertices[1][1] = height - r.top;
  1102
+        vertices[2][1] = height - r.bottom;
  1103
+        vertices[3][1] = height - r.bottom;
  1104
+#else
  1105
+        vertices[0][1] = r.top;
  1106
+        vertices[1][1] = r.top;
  1107
+        vertices[2][1] = r.bottom;
1097 1108
         vertices[3][1] = r.bottom;
  1109
+#endif
1098 1110
         glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
1099 1111
     }
1100 1112
 }

0 notes on commit d88381f

Please sign in to comment.
Something went wrong with that request. Please try again.