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

Commit cba23c66 authored by Pawin Vongmasa's avatar Pawin Vongmasa
Browse files

Change GraphicBuffer to AnwBuffer and update its fields.

The server side only needs information of type ANativeWindowBuffer, not
GraphicBuffer.

Test: Compiles

Bug: 31399200
Change-Id: Ic967c58d8c922e0c422e5b63fa5ce2188da89010
parent d13c84bc
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -27,28 +27,28 @@ typedef vec<uint8_t> Bytes;


/**
/**
 * Ref: frameworks/native/include/ui/GraphicBuffer.h
 * Ref: frameworks/native/include/ui/GraphicBuffer.h
 * Ref: system/core/include/system/window.h
 * Ref: system/core/include/system/window.h: ANativeWindowBuffer
 */
 */


/**
/**
 * This struct contains attributes for a gralloc buffer that can be put into a
 * This struct contains attributes for a gralloc buffer that can be put into a
 * union.
 * union.
 */
 */
struct GraphicBufferAttributes {
struct AnwBufferAttributes {
    uint32_t width;
    uint32_t width;
    uint32_t height;
    uint32_t height;
    uint32_t stride;
    uint32_t stride;
    PixelFormat format;
    PixelFormat format;
    uint32_t usage; // TODO: convert to an enum
    uint32_t usage; // TODO: convert to an enum
    uint32_t generationNumber;
    uint64_t layerCount;
};
};


/**
/**
 * A GraphicBuffer is simply GraphicBufferAttributes plus a native handle.
 * An AnwBuffer is simply AnwBufferAttributes plus a native handle.
 */
 */
struct GraphicBuffer {
struct AnwBuffer {
    handle nativeHandle;
    handle nativeHandle;
    GraphicBufferAttributes attr;
    AnwBufferAttributes attr;
};
};


/**
/**
+1 −1
Original line number Original line Diff line number Diff line
@@ -150,7 +150,7 @@ struct CodecBuffer {
        SharedMemoryAttributes sharedMem;
        SharedMemoryAttributes sharedMem;


        // if bufferType == ANW_BUFFER
        // if bufferType == ANW_BUFFER
        GraphicBufferAttributes anwBuffer;
        AnwBufferAttributes anwBuffer;


        // if bufferType == NATIVE_HANDLE
        // if bufferType == NATIVE_HANDLE
        // No additional attributes.
        // No additional attributes.