[AD] Android Locking

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


So this code in ogl_lock_es.c:

   /* Some Android devices only want to read POT chunks with glReadPixels.
    * This adds yet more overhead, but AFAICT it fails any other way.
    * Test device was gen 1 Galaxy Tab. Also read 16x16 minimum.
    *
    * XXX Nexus 7 at least does NOT require the next POT
    */
   if (IS_ANDROID) {
      glPixelStorei(GL_PACK_ALIGNMENT, 4);
      e = glGetError();
      if (e) {
         ALLEGRO_ERROR("glPixelStorei failed (%s).\n",
_al_gl_error_string(e));
         ok = false;
      }

      w = pot(w);
      while (w < 16) w = pot(w+1);
      h = pot(h);
      while (h < 16) h = pot(h+1);
      ALLEGRO_DEBUG("roundup w, h = %d, %d\n", w, h);
   }

Is supposed to fix locking on some older Androids. I've been testing on a
couple newer devices (I think they're both Snapdragon), and not only is it
not needed but it screws up results. Not sure but it seems to be a wrong
pitch or something. Completely removing this fixes it. Ideally we could fix
for those old devices and the newer ones but to me this code is just so
complex to wrap my head around. Maybe Peter you can spot the problem? I'd
like to test it on Tegra hardware and see if it works with these lines
removed. If not I'd like to fix it so it works with both old and new but if
it does work, should I just remove this code? I don't imagine many people
are still using Android 2.x devices anymore.

Thanks,
Trent






Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/