OSDN Git Service

surfaceflinger: fix video playback no full screen issue
authorChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 22 Oct 2010 09:12:48 +0000 (17:12 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 29 Oct 2010 07:45:17 +0000 (15:45 +0800)
The video playback is not full screen due to the incorrect
workabound commit 8a0ecc74c88158d9b8affbbd8cc85ca20fefafa6.

libs/surfaceflinger/LayerBase.cpp

index da55d9b..663bb2d 100644 (file)
@@ -438,7 +438,10 @@ void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const
     Region::const_iterator it = clip.begin();
     Region::const_iterator const end = clip.end();
 
-#ifdef __arm__
+#ifdef __i386__
+    if (UNLIKELY(transformed()
+            || !(mFlags & DisplayHardware::DRAW_TEXTURE_EXTENSION) )) {
+#endif
     //StopWatch watch("GL transformed");
     const GLfixed texCoords[4][2] = {
             { 0,        0 },
@@ -481,17 +484,19 @@ void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const
         glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
     }
     glDisableClientState(GL_TEXTURE_COORD_ARRAY);
-#else
-    GLint crop[4] = { 0, height, width, -height };
-    glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop);
-    int x = tx();
-    int y = ty();
-    y = fbHeight - (y + height);
-    while (it != end) {
-        const Rect& r = *it++;
-        const GLint sy = fbHeight - (r.top + r.height());
-        glScissor(r.left, sy, r.width(), r.height());
-        glDrawTexiOES(x, y, 0, width, height);
+#ifdef __i386__
+    } else {
+        GLint crop[4] = { 0, height, width, -height };
+        glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop);
+        int x = tx();
+        int y = ty();
+        y = fbHeight - (y + height);
+        while (it != end) {
+            const Rect& r = *it++;
+            const GLint sy = fbHeight - (r.top + r.height());
+            glScissor(r.left, sy, r.width(), r.height());
+            glDrawTexiOES(x, y, 0, width, height);
+        }
     }
 #endif
 }