display: fix display rotation failure
authorJinhyung Jo <jinhyung.jo@samsung.com>
Fri, 30 Sep 2016 11:47:28 +0000 (20:47 +0900)
committerJinhyung Jo <jinhyung.jo@samsung.com>
Fri, 30 Sep 2016 11:47:28 +0000 (20:47 +0900)
The degree 0(90) & degree 180(270) have same size of display.
For that reason,
the resize event does not occur when the rotate angle is changed.
So update the status of the rotate & scale before drawing.

Change-Id: I2092a45ad60e65d4ee14ed8bb66def210b28cc68
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
tizen/src/ui/displayglwidget.cpp

index d88947b..6ccb3eb 100644 (file)
@@ -442,6 +442,14 @@ void DisplayGLWidget::paintGL()
     }
     mFuncs->glBlendFunc(GL_DST_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 
+    mOrtho.setToIdentity();
+    mOrtho.rotate((float)-rotateAngle, 0.0f, 0.0f, 1.0f);
+    mOrtho.ortho(0.0f, (float)mGuestResolution.width(),
+                 0.0f, (float)mGuestResolution.height(),
+                 -1.0f, 1.0f);
+    needScale = (mGuestResolution.width() != width())
+                 || (mGuestResolution.height() != height());
+
     drawQuad(dpyTexture, false);
     if (isTsEnabled) {
         drawMultiTouchPoints();
@@ -459,13 +467,6 @@ void DisplayGLWidget::resizeGL(int w, int h)
 
     // TODO: check changing of the guest resolution
     //       for 'Runtime Resolution Change'
-    mOrtho.setToIdentity();
-    mOrtho.rotate((float)-rotateAngle, 0.0f, 0.0f, 1.0f);
-    mOrtho.ortho(0.0f, (float)mGuestResolution.width(),
-                 0.0f, (float)mGuestResolution.height(),
-                 -1.0f, 1.0f);
-    needScale = (mGuestResolution.width() != width())
-                 || (mGuestResolution.height() != height());
 }
 
 /* override */