I have a piece of code where I am drawing a string of length around 20 characters into Skia Bitmap of size 1000x100 pixels. Then load that into a texture and draw it on screen.
I found that it is taking around 29-30ms just to upload the SkBitmap data (the buffer returned by SkBitmap.getPixels()) into a texture.
The code for this is uploaded in another post
Drawing text to texture using Skia
measureStart = systemTime();
if (!initTexture(&texFrame, bitmap))
{
LOGD("framerate: Unable to create/upload texture based off bitmap");
return;
}
timeDiff += (int(ns2us(systemTime()-measureStart)));
I drew 30 frames and took an average of timeDiffs. It is taking around 30ms.
I created another program that doesn't use OpenGL at all, just uses Skia to render text and show it on frame buffer directly. That took 1ms to do the same.
This doesn't make sense. I am running this code on android box (with GPU) with Android 4.0.3. ARM and GPU share the same RAM.
How to make this faster?