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

Commit 850054cb authored by Craig Donner's avatar Craig Donner
Browse files

Use layered version of graphic buffer allocation calls.

Allocators now require a layer count, but in these cases we can
assume that a single layer is sufficient, since that's what they
effectively do now.

Bug: 31686534
Test: manual
Change-Id: I30e498f8cb3e27c497f7bab9fbf2e7b4dad842d5
parent de45ca5e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ static jlong android_view_GraphiceBuffer_create(JNIEnv* env, jobject clazz,
    }

    status_t error;
    sp<GraphicBuffer> buffer(alloc->createGraphicBuffer(width, height, format, usage, &error));
    sp<GraphicBuffer> buffer(alloc->createGraphicBuffer(width, height, format, 1, usage, &error));
    if (buffer == NULL) {
        if (kDebugGraphicBuffer) {
            ALOGW("createGraphicBuffer() failed in GraphicBuffer.create()");
+1 −1
Original line number Diff line number Diff line
@@ -227,7 +227,7 @@ sk_sp<Bitmap> Bitmap::allocateHardwareBitmap(uirenderer::renderthread::RenderThr
    PixelFormat pixelFormat = internalFormatToPixelFormat(internalFormat);
    status_t error;
    sp<GraphicBuffer> buffer = alloc->createGraphicBuffer(info.width(), info.height(), pixelFormat,
            GraphicBuffer::USAGE_HW_TEXTURE | GraphicBuffer::USAGE_SW_WRITE_NEVER
            1, GraphicBuffer::USAGE_HW_TEXTURE | GraphicBuffer::USAGE_SW_WRITE_NEVER
            | GraphicBuffer::USAGE_SW_READ_NEVER , &error);

    if (!buffer.get()) {