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

Commit 77f4145b authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5132890 from 18d90eaf to qt-release

Change-Id: I6fcfc0492ea9a6574f78f69a21b277d826f4db17
parents 074356f1 18d90eaf
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -327,8 +327,8 @@ void VelocityTracker::addMovement(const MotionEvent* event) {
        eventTime = event->getHistoricalEventTime(h);
        for (size_t i = 0; i < pointerCount; i++) {
            uint32_t index = pointerIndex[i];
            positions[index].x = event->getHistoricalRawX(i, h);
            positions[index].y = event->getHistoricalRawY(i, h);
            positions[index].x = event->getHistoricalX(i, h);
            positions[index].y = event->getHistoricalY(i, h);
        }
        addMovement(eventTime, idBits, positions);
    }
@@ -336,8 +336,8 @@ void VelocityTracker::addMovement(const MotionEvent* event) {
    eventTime = event->getEventTime();
    for (size_t i = 0; i < pointerCount; i++) {
        uint32_t index = pointerIndex[i];
        positions[index].x = event->getRawX(i);
        positions[index].y = event->getRawY(i);
        positions[index].x = event->getX(i);
        positions[index].y = event->getY(i);
    }
    addMovement(eventTime, idBits, positions);
}
+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ cc_library {
    cflags: [
        "-Wall",
        "-Werror",
        "-Wno-enum-compare",
        "-Wno-unused-function",
    ],

+85 −22
Original line number Diff line number Diff line
@@ -15,12 +15,31 @@
 */

/**
 * @addtogroup NativeActivity Native Activity
 * @{
 * @file hardware_buffer.h
 * @brief API for native hardware buffers.
 */

/**
 * @file hardware_buffer.h
 * @defgroup AHardwareBuffer Native Hardware Buffer
 *
 * AHardwareBuffer objects represent chunks of memory that can be
 * accessed by various hardware components in the system. It can be
 * easily converted to the Java counterpart
 * android.hardware.HardwareBuffer and passed between processes using
 * Binder. All operations involving AHardwareBuffer and HardwareBuffer
 * are zero-copy, i.e., passing AHardwareBuffer to another process
 * creates a shared view of the same region of memory.
 *
 * AHardwareBuffers can be bound to EGL/OpenGL and Vulkan primitives.
 * For EGL, use the extension function eglGetNativeClientBufferANDROID
 * to obtain an EGLClientBuffer and pass it directly to
 * eglCreateImageKHR. Refer to the EGL extensions
 * EGL_ANDROID_get_native_client_buffer and
 * EGL_ANDROID_image_native_buffer for more information. In Vulkan,
 * the contents of the AHardwareBuffer can be accessed as external
 * memory. See the VK_ANDROID_external_memory_android_hardware_buffer
 * extension for details.
 *
 * @{
 */

#ifndef ANDROID_HARDWARE_BUFFER_H
@@ -37,7 +56,7 @@ __BEGIN_DECLS
/**
 * Buffer pixel formats.
 */
enum {
enum AHardwareBuffer_Format {
    /**
     * Corresponding formats:
     *   Vulkan: VK_FORMAT_R8G8B8A8_UNORM
@@ -134,27 +153,47 @@ enum {
/**
 * Buffer usage flags, specifying how the buffer will be accessed.
 */
enum {
    /// The buffer will never be read by the CPU.
enum AHardwareBuffer_UsageFlags {
    /// The buffer will never be locked for direct CPU reads using the
    /// AHardwareBuffer_lock() function. Note that reading the buffer
    /// using OpenGL or Vulkan functions or memory mappings is still
    /// allowed.
    AHARDWAREBUFFER_USAGE_CPU_READ_NEVER        = 0UL,
    /// The buffer will sometimes be read by the CPU.
    /// The buffer will sometimes be locked for direct CPU reads using
    /// the AHardwareBuffer_lock() function. Note that reading the
    /// buffer using OpenGL or Vulkan functions or memory mappings
    /// does not require the presence of this flag.
    AHARDWAREBUFFER_USAGE_CPU_READ_RARELY       = 2UL,
    /// The buffer will often be read by the CPU.
    /// The buffer will often be locked for direct CPU reads using
    /// the AHardwareBuffer_lock() function. Note that reading the
    /// buffer using OpenGL or Vulkan functions or memory mappings
    /// does not require the presence of this flag.
    AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN        = 3UL,
    /// CPU read value mask.
    AHARDWAREBUFFER_USAGE_CPU_READ_MASK         = 0xFUL,

    /// The buffer will never be written by the CPU.
    /// The buffer will never be locked for direct CPU writes using the
    /// AHardwareBuffer_lock() function. Note that writing the buffer
    /// using OpenGL or Vulkan functions or memory mappings is still
    /// allowed.
    AHARDWAREBUFFER_USAGE_CPU_WRITE_NEVER       = 0UL << 4,
    /// The buffer will sometimes be written to by the CPU.
    /// The buffer will sometimes be locked for direct CPU writes using
    /// the AHardwareBuffer_lock() function. Note that writing the
    /// buffer using OpenGL or Vulkan functions or memory mappings
    /// does not require the presence of this flag.
    AHARDWAREBUFFER_USAGE_CPU_WRITE_RARELY      = 2UL << 4,
    /// The buffer will often be written to by the CPU.
    /// The buffer will often be locked for direct CPU writes using
    /// the AHardwareBuffer_lock() function. Note that writing the
    /// buffer using OpenGL or Vulkan functions or memory mappings
    /// does not require the presence of this flag.
    AHARDWAREBUFFER_USAGE_CPU_WRITE_OFTEN       = 3UL << 4,
    /// CPU write value mask.
    AHARDWAREBUFFER_USAGE_CPU_WRITE_MASK        = 0xFUL << 4,

    /// The buffer will be read from by the GPU as a texture.
    AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE      = 1UL << 8,
    /// The buffer will be written to by the GPU as a framebuffer attachment.
    AHARDWAREBUFFER_USAGE_GPU_FRAMEBUFFER        = 1UL << 9,
    /**
     * The buffer will be written to by the GPU as a framebuffer attachment.
     * Note that the name of this flag is somewhat misleading: it does not imply
@@ -162,16 +201,33 @@ enum {
     * format that will be used as a framebuffer attachment should also have
     * this flag.
     */
    AHARDWAREBUFFER_USAGE_GPU_COLOR_OUTPUT       = 1UL << 9,
    /// The buffer must not be used outside of a protected hardware path.
    AHARDWAREBUFFER_USAGE_GPU_COLOR_OUTPUT       = AHARDWAREBUFFER_USAGE_GPU_FRAMEBUFFER,
    /**
     * The buffer is protected from direct CPU access or being read by non-secure
     * hardware, such as video encoders. This flag is incompatible with CPU
     * read and write flags. It is mainly used when handling DRM video.
     * Refer to the EGL extension EGL_EXT_protected_content and GL extension
     * EXT_protected_textures for more information on how these buffers are expected
     * to behave.
     */
    AHARDWAREBUFFER_USAGE_PROTECTED_CONTENT      = 1UL << 14,
    /// The buffer will be read by a hardware video encoder.
    AHARDWAREBUFFER_USAGE_VIDEO_ENCODE           = 1UL << 16,
    /// The buffer will be used for direct writes from sensors.
    /**
     * The buffer will be used for direct writes from sensors.
     * When this flag is present, the format must be AHARDWAREBUFFER_FORMAT_BLOB.
     */
    AHARDWAREBUFFER_USAGE_SENSOR_DIRECT_DATA     = 1UL << 23,
    /// The buffer will be used as a shader storage or uniform buffer object.
    /**
     * The buffer will be used as a shader storage or uniform buffer object.
     * When this flag is present, the format must be AHARDWAREBUFFER_FORMAT_BLOB.
     */
    AHARDWAREBUFFER_USAGE_GPU_DATA_BUFFER        = 1UL << 24,
    /// The buffer will be used as a cube map texture.
    /**
     * The buffer will be used as a cube map texture.
     * When this flag is present, the buffer must have a layer count that is
     * a multiple of 6.
     */
    AHARDWAREBUFFER_USAGE_GPU_CUBE_MAP               = 1UL << 25,
    /// The buffer contains a complete mipmap hierarchy.
    AHARDWAREBUFFER_USAGE_GPU_MIPMAP_COMPLETE        = 1UL << 26,
@@ -206,20 +262,27 @@ typedef struct AHardwareBuffer_Desc {
    uint32_t    width;      ///< Width in pixels.
    uint32_t    height;     ///< Height in pixels.
    uint32_t    layers;     ///< Number of images in an image array.
    uint32_t    format;     ///< One of AHARDWAREBUFFER_FORMAT_*
    uint64_t    usage;      ///< Combination of AHARDWAREBUFFER_USAGE_*
    uint32_t    format;     ///< One of AHardwareBuffer_Format.
    uint64_t    usage;      ///< Combination of AHardwareBuffer_UsageFlags.
    uint32_t    stride;     ///< Row stride in pixels, ignored for AHardwareBuffer_allocate()
    uint32_t    rfu0;       ///< Initialize to zero, reserved for future use.
    uint64_t    rfu1;       ///< Initialize to zero, reserved for future use.
} AHardwareBuffer_Desc;

/**
 * Opaque handle for a native hardware buffer.
 */
typedef struct AHardwareBuffer AHardwareBuffer;

#if __ANDROID_API__ >= 26

/**
 * Allocates a buffer that backs an AHardwareBuffer using the passed
 * AHardwareBuffer_Desc.
 * Allocates a buffer that matches the passed AHardwareBuffer_Desc.
 *
 * If allocation succeeds, the buffer can be used according to the
 * usage flags specified in its description. If a buffer is used in ways
 * not compatible with its usage flags, the results are undefined and
 * may include program termination.
 *
 * \return 0 on success, or an error number of the allocation fails for
 * any reason. The returned buffer has a reference count of 1.
@@ -234,7 +297,7 @@ void AHardwareBuffer_acquire(AHardwareBuffer* buffer) __INTRODUCED_IN(26);

/**
 * Remove a reference that was previously acquired with
 * AHardwareBuffer_acquire().
 * AHardwareBuffer_acquire() or AHardwareBuffer_allocate().
 */
void AHardwareBuffer_release(AHardwareBuffer* buffer) __INTRODUCED_IN(26);

+10 −4
Original line number Diff line number Diff line
@@ -15,7 +15,13 @@
 */

/**
 * @addtogroup NativeActivity Native Activity
 * @defgroup ANativeWindow Native Window
 *
 * ANativeWindow represents the producer end of an image queue.
 * It is the C counterpart of the android.view.Surface object in Java,
 * and can be converted both ways. Depending on the consumer, images
 * submitted to ANativeWindow can be shown on the display or sent to
 * other consumers, such as video encoders.
 * @{
 */

@@ -41,7 +47,7 @@ extern "C" {
 * Legacy window pixel format names, kept for backwards compatibility.
 * New code and APIs should use AHARDWAREBUFFER_FORMAT_*.
 */
enum {
enum ANativeWindow_LegacyFormat {
    // NOTE: these values must match the values from graphics/common/x.x/types.hal

    /** Red: 8 bits, Green: 8 bits, Blue: 8 bits, Alpha: 8 bits. **/
@@ -95,7 +101,7 @@ typedef struct ANativeWindow_Buffer {
    /// memory. This may be >= width.
    int32_t stride;

    /// The format of the buffer. One of AHARDWAREBUFFER_FORMAT_*
    /// The format of the buffer. One of AHardwareBuffer_Format.
    int32_t format;

    /// The actual bits.
@@ -151,7 +157,7 @@ int32_t ANativeWindow_getFormat(ANativeWindow* window);
 *
 * \param width width of the buffers in pixels.
 * \param height height of the buffers in pixels.
 * \param format one of AHARDWAREBUFFER_FORMAT_* constants.
 * \param format one of the AHardwareBuffer_Format constants.
 * \return 0 for success, or a negative value on error.
 */
int32_t ANativeWindow_setBuffersGeometry(ANativeWindow* window,
+0 −1
Original line number Diff line number Diff line
@@ -50,7 +50,6 @@ filegroup {
        "gl/GLExtensions.cpp",
        "gl/GLFramebuffer.cpp",
        "gl/GLImage.cpp",
        "gl/GLSurface.cpp",
        "gl/Program.cpp",
        "gl/ProgramCache.cpp",
    ],
Loading