Skip to content
Browse files

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...
1 parent 0d04b8a commit d88381fbe61bee1d2096a942e9ae23003b51533c Jeykumar Sankaran committed with Whitehawkx Aug 28, 2012
Showing with 15 additions and 3 deletions.
  1. +15 −3 services/surfaceflinger/SurfaceFlinger.cpp
View
18 services/surfaceflinger/SurfaceFlinger.cpp
@@ -1076,6 +1076,11 @@ void SurfaceFlinger::drawWormhole() const
if (region.isEmpty())
return;
+#ifdef QCOM_HARDWARE
+ const DisplayHardware& hw(graphicPlane(0).displayHardware());
+ const int32_t height = hw.getHeight();
+#endif
+
glDisable(GL_TEXTURE_EXTERNAL_OES);
glDisable(GL_TEXTURE_2D);
glDisable(GL_BLEND);
@@ -1088,13 +1093,20 @@ void SurfaceFlinger::drawWormhole() const
while (it != end) {
const Rect& r = *it++;
vertices[0][0] = r.left;
- vertices[0][1] = r.top;
vertices[1][0] = r.right;
- vertices[1][1] = r.top;
vertices[2][0] = r.right;
- vertices[2][1] = r.bottom;
vertices[3][0] = r.left;
+#ifdef QCOM_HARDWARE
+ vertices[0][1] = height - r.top;
+ vertices[1][1] = height - r.top;
+ vertices[2][1] = height - r.bottom;
+ vertices[3][1] = height - r.bottom;
+#else
+ vertices[0][1] = r.top;
+ vertices[1][1] = r.top;
+ vertices[2][1] = r.bottom;
vertices[3][1] = r.bottom;
+#endif
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
}
}

0 comments on commit d88381f

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