Galaxy Nexus, drawBitmap, and JNI

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Galaxy Nexus, drawBitmap, and JNI

GJTorikian
This is the third manifestation of a question I've been asking in several places, with zero results.

I suspect something foul is occurring with my Galaxy Nexus. Code that I've written runs fine on 2.2 devies, and it even runs fine on the ICS emulator--but not on my actual Galaxy Nexus.

I'm making updates to a live wallpaper I've developed. It does the WallpaperService in Java, then does some bitmap manipulation in native code. On the Galaxy Nexus, it seems that only the last column is being correctly drawn. For example, in a coordinate system, if my phone is 420 x 720 (not sure of the exact dimensions), then only pixels (420, 0) through (420, 719) are being drawn. The rest is black / transparent.


Why would a chunk of code work in the emulator, but not the device? And why does it work on pre-4.0 devices, and not this one? I've turned off hardware acceleration, to no effect. There's no crash, nothing ndk-gdb can tell me. Only the last rectangle of the bitmap is being drawn.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/eBS8DHPp3lgJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Galaxy Nexus, drawBitmap, and JNI

GJTorikian
All right, so after days I finally figured it out.

After creating my bitmap, I need to set every pixel in Java:

            for (int x = 0; x < 254; x++) {
                for (int y =0; y < 254; y++) {
                    bmp.setPixel(x, y, Color.argb(255, 0, 0, 0));
                }
            }


The question is: WHY only for ICS?

On Sunday, December 9, 2012 10:35:43 AM UTC-8, GJTorikian wrote:
This is the third manifestation of a question I've been asking in several places, with zero results.

I suspect something foul is occurring with my Galaxy Nexus. Code that I've written runs fine on 2.2 devies, and it even runs fine on the ICS emulator--but not on my actual Galaxy Nexus.

I'm making updates to a live wallpaper I've developed. It does the WallpaperService in Java, then does some bitmap manipulation in native code. On the Galaxy Nexus, it seems that only the last column is being correctly drawn. For example, in a coordinate system, if my phone is 420 x 720 (not sure of the exact dimensions), then only pixels (420, 0) through (420, 719) are being drawn. The rest is black / transparent.


Why would a chunk of code work in the emulator, but not the device? And why does it work on pre-4.0 devices, and not this one? I've turned off hardware acceleration, to no effect. There's no crash, nothing ndk-gdb can tell me. Only the last rectangle of the bitmap is being drawn.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/e2VxMEq4408J.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.