Types of usage flags
#include <screen/screen.h>
enum { SCREEN_USAGE_DISPLAY = (1 << 0), SCREEN_USAGE_READ = (1 << 1), SCREEN_USAGE_WRITE = (1 << 2), SCREEN_USAGE_NATIVE = (1 << 3), SCREEN_USAGE_OPENGL_ES1 = (1 << 4), SCREEN_USAGE_OPENGL_ES2 = (1 << 5), SCREEN_USAGE_OPENGL_ES3 = (1 << 11), SCREEN_USAGE_OPENVG = (1 << 6), SCREEN_USAGE_VIDEO = (1 << 7), SCREEN_USAGE_CAPTURE = (1 << 8), SCREEN_USAGE_ROTATION = (1 << 9), SCREEN_USAGE_OVERLAY = (1 << 10), SCREEN_USAGE_COMPRESSION = (1 << 12), SCREEN_USAGE_PHYSICAL = (1 << 13) };
If using blits (screen_blit()) or fills (screen_fill()), this flag must be set on the buffer.
Screen won't use display overlays unless your application assigns a pipeline. The SCREEN_USAGE_OVERLAY flag suggests that Screen tries to post your buffer onto a pipeline that doesn't have a framebuffer. If unable to, Screen will use composition instead. Changing SCREEN_USAGE_OVERLAY may affect pipeline assignment. Set this flag when you are targeting a non-composited pipeline.
This flag is used only as a suggestion to Screen. Query the buffer's SCREEN_PROPERTY_PHYSICALLY_CONTIGUOUS property to confirm whether the buffer is actually contiguous.
Usage flags are used when allocating buffers. Depending on the usage, different constraints such as width, height, stride granularity or special alignment must be observed. The usage is also valuable in determining the amount of caching that can be set on a particular buffer. Note that the usage assigned when creating buffers triggers Screen to load and start drivers where necessary. For more information, see Optimizing Start Times for Screen.