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

Commit ff4bc528 authored by Marissa Wall's avatar Marissa Wall Committed by android-build-merger
Browse files

Merge "test-hwc2: fix build errors on other branches" am: ea8d46f1 am: acfd2a84

am: 96074086

Change-Id: Iac974deaf0c4a0df9512ff666ff382a18ad270b6
parents bd7ba140 96074086
Loading
Loading
Loading
Loading
+20 −17
Original line number Original line Diff line number Diff line
@@ -21,7 +21,6 @@


#include <gui/Surface.h>
#include <gui/Surface.h>
#include <gui/BufferItemConsumer.h>
#include <gui/BufferItemConsumer.h>
#include <gui/GraphicBufferAlloc.h>


#include <ui/GraphicBuffer.h>
#include <ui/GraphicBuffer.h>
#include <ui/vec4.h>
#include <ui/vec4.h>
@@ -395,15 +394,17 @@ int Hwc2TestBuffer::get(buffer_handle_t* outHandle, int32_t* outFence)
 * devices */
 * devices */
int Hwc2TestBuffer::generateBuffer()
int Hwc2TestBuffer::generateBuffer()
{
{
    int ret;

    /* Create new graphic buffer with correct dimensions */
    /* Create new graphic buffer with correct dimensions */
    mGraphicBuffer = mGraphicBufferAlloc.createGraphicBuffer(
    mGraphicBuffer = new GraphicBuffer(mBufferArea.width, mBufferArea.height,
            mBufferArea.width, mBufferArea.height, mFormat,
            mFormat, GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_HW_RENDER,
            GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_HW_RENDER,
            "hwc2_test_buffer");
            "hwc2_test_buffer", &ret);
    int ret = mGraphicBuffer->initCheck();
    if (ret)
    if (ret) {
        return ret;
        return ret;
    }
    if (!mGraphicBuffer->handle) {
        return -EINVAL;
    }


    /* Locks the buffer for writing */
    /* Locks the buffer for writing */
    uint8_t* img;
    uint8_t* img;
@@ -466,15 +467,17 @@ int Hwc2TestClientTargetBuffer::get(buffer_handle_t* outHandle,
        const std::set<hwc2_layer_t>* clientLayers,
        const std::set<hwc2_layer_t>* clientLayers,
        const std::set<hwc2_layer_t>* clearLayers)
        const std::set<hwc2_layer_t>* clearLayers)
{
{
    int err;
    /* Create new graphic buffer with correct dimensions */

    mGraphicBuffer = new GraphicBuffer(bufferArea.width, bufferArea.height,
    /* Create new graphic buffer with updated size */
            mFormat, GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_HW_RENDER,
    mGraphicBuffer = mGraphicBufferAlloc.createGraphicBuffer(bufferArea.width,
            "hwc2_test_buffer");
            bufferArea.height, mFormat,
    int ret = mGraphicBuffer->initCheck();
            GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_HW_RENDER,
    if (ret) {
            "hwc2_test_buffer", &err);
        return ret;
    if (err)
    }
        return err;
    if (!mGraphicBuffer->handle) {
        return -EINVAL;
    }


    uint8_t* img;
    uint8_t* img;
    mGraphicBuffer->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, (void**)(&img));
    mGraphicBuffer->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, (void**)(&img));
+0 −3
Original line number Original line Diff line number Diff line
@@ -22,7 +22,6 @@


#include <hardware/hwcomposer2.h>
#include <hardware/hwcomposer2.h>


#include <gui/GraphicBufferAlloc.h>
#include <ui/GraphicBuffer.h>
#include <ui/GraphicBuffer.h>


#include "Hwc2TestProperties.h"
#include "Hwc2TestProperties.h"
@@ -42,7 +41,6 @@ public:
protected:
protected:
    int generateBuffer();
    int generateBuffer();


    android::GraphicBufferAlloc mGraphicBufferAlloc;
    android::sp<android::GraphicBuffer> mGraphicBuffer;
    android::sp<android::GraphicBuffer> mGraphicBuffer;


    std::unique_ptr<Hwc2TestFenceGenerator> mFenceGenerator;
    std::unique_ptr<Hwc2TestFenceGenerator> mFenceGenerator;
@@ -66,7 +64,6 @@ public:
            const std::set<hwc2_layer_t>* clearLayers);
            const std::set<hwc2_layer_t>* clearLayers);


protected:
protected:
    android::GraphicBufferAlloc mGraphicBufferAlloc;
    android::sp<android::GraphicBuffer> mGraphicBuffer;
    android::sp<android::GraphicBuffer> mGraphicBuffer;


    std::unique_ptr<Hwc2TestFenceGenerator> mFenceGenerator;
    std::unique_ptr<Hwc2TestFenceGenerator> mFenceGenerator;