Screen usage flag types

Types of usage flags

Synopsis:

#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)
};

Data:

SCREEN_USAGE_DISPLAY
Internal use only; do not use.
SCREEN_USAGE_READ
Flag to indicate that the CPU can read from the buffer(s) associated with the API object.
SCREEN_USAGE_WRITE
Flag to indicate that the CPU can write to the buffer(s) associated with the API object.
SCREEN_USAGE_NATIVE
Flag to indicate that buffer(s) associated with the API object can be used for native API operations.

If using blits (screen_blit()) or fills (screen_fill()), this flag must be set on the buffer.

SCREEN_USAGE_OPENGL_ES1
Flag to indicate that OpenGL ES 1.X is used for rendering the buffer associated with the API object.
SCREEN_USAGE_OPENGL_ES2
Flag to indicate that OpenGL ES 2.X is used for rendering the buffer associated with the API object.
SCREEN_USAGE_OPENGL_ES3
Flag to indicate that OpenGL ES 3.X is used for rendering the buffer associated with the API object.
SCREEN_USAGE_OPENVG
Flag to indicate that OpenVG is used for rendering the buffer associated with the API object.
SCREEN_USAGE_VIDEO
Flag to indicate that the buffer can be written to by a video decoder.
SCREEN_USAGE_CAPTURE
Flag to indicate that the buffer can be written to by capture devices (such as cameras, analog-to-digital-converters, ...), and read by a hardware video encoder.
SCREEN_USAGE_ROTATION
Flag to indicate that the buffer can be reconfigured from landscape to portrait orientation without reallocation.
SCREEN_USAGE_OVERLAY
Flag to suggest the use of a display overlay.

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.

SCREEN_USAGE_COMPRESSION
Flag to indicate that a buffer is compressed.

Library:

libscreen

Description:

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.