Add another layer to the example

This commit is contained in:
Simon Ser 2019-08-23 18:59:44 +03:00
parent 559bd2bf3a
commit c5601aef5d
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

View file

@ -131,7 +131,7 @@ int main(int argc, char *argv[])
drmModeCrtc *crtc; drmModeCrtc *crtc;
drmModeConnector *connector; drmModeConnector *connector;
struct hwc_output *output; struct hwc_output *output;
struct hwc_layer *layers[3]; struct hwc_layer *layers[4];
drmModeAtomicReq *req; drmModeAtomicReq *req;
int ret; int ret;
@ -178,6 +178,7 @@ int main(int argc, char *argv[])
crtc->mode.vdisplay, false); crtc->mode.vdisplay, false);
layers[1] = add_layer(drm_fd, output, 50, 50, 256, 256, true); layers[1] = add_layer(drm_fd, output, 50, 50, 256, 256, true);
layers[2] = add_layer(drm_fd, output, 500, 500, 128, 128, false); layers[2] = add_layer(drm_fd, output, 500, 500, 128, 128, false);
layers[3] = add_layer(drm_fd, output, 700, 700, 128, 128, true);
req = drmModeAtomicAlloc(); req = drmModeAtomicAlloc();
if (!hwc_display_apply(display, req)) { if (!hwc_display_apply(display, req)) {
@ -204,6 +205,7 @@ int main(int argc, char *argv[])
hwc_layer_destroy(layers[0]); hwc_layer_destroy(layers[0]);
hwc_layer_destroy(layers[1]); hwc_layer_destroy(layers[1]);
hwc_layer_destroy(layers[2]); hwc_layer_destroy(layers[2]);
hwc_layer_destroy(layers[3]);
hwc_output_destroy(output); hwc_output_destroy(output);
drmModeFreeCrtc(crtc); drmModeFreeCrtc(crtc);
drmModeFreeConnector(connector); drmModeFreeConnector(connector);