Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 923d27f2 authored by Pablo Ceballos's avatar Pablo Ceballos
Browse files

Expose setSingleBufferMode in ANativeWindow

Bug 24940410

Change-Id: Ied57f1bef1988bdd0bf4dd95572f0985c9d43c2d
parent cc84af69
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#include <sys/cdefs.h>
#include <system/graphics.h>
#include <unistd.h>
#include <stdbool.h>

#ifndef __UNUSED
#define __UNUSED __attribute__((__unused__))
@@ -311,6 +312,7 @@ enum {
    NATIVE_WINDOW_SET_SIDEBAND_STREAM       = 18,
    NATIVE_WINDOW_SET_BUFFERS_DATASPACE     = 19,
    NATIVE_WINDOW_SET_SURFACE_DAMAGE        = 20,   /* private */
    NATIVE_WINDOW_SET_SINGLE_BUFFER_MODE    = 21,
};

/* parameter for NATIVE_WINDOW_[API_][DIS]CONNECT */
@@ -949,6 +951,18 @@ static inline int native_window_set_surface_damage(
            rects, numRects);
}

/*
 * native_window_set_single_buffer_mode(..., bool singleBufferMode)
 * Enable/disable single buffer mode
 */
static inline int native_window_set_single_buffer_mode(
        struct ANativeWindow* window,
        bool singleBufferMode)
{
    return window->perform(window, NATIVE_WINDOW_SET_SINGLE_BUFFER_MODE,
            singleBufferMode);
}

__END_DECLS

#endif /* SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H */