replacing glReadPixels with EGL_KHR_image_base for faster pixel copy

You’re creating an empty buffer and then reading the contents out of it. Walking through the code: GraphicBufferAlloc* mGraphicBufferAlloc = new GraphicBufferAlloc(); sp<GraphicBuffer> window = mGraphicBufferAlloc->createGraphicBuffer(width, height, PIXEL_FORMAT_RGBA_8888, GraphicBuffer::USAGE_SW_READ_OFTEN | GraphicBuffer::USAGE_HW_TEXTURE,&error); This creates a new GraphicBuffer (sometimes referred to as a “gralloc buffer”), with the specified dimensions and pixel format. The usage flags allow it … Read more