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

Commit cf70e330 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

second take, hopefully this time it doesn't break one of the builds:...

second take, hopefully this time it doesn't break one of the builds: "SurfaceFlinger will now allocate buffers based on the usage specified by the clients. This allows to allocate the right kind of buffer automatically, without having the user to specify anything."
parent 52212713
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -467,7 +467,6 @@ void LayerBuffer::BufferSource::onDraw(const Region& clip) const
                    mTempBitmap.clear();
                    mTempBitmap = new android::Buffer(
                            tmp_w, tmp_h, src.img.format,
                            BufferAllocator::USAGE_HW_TEXTURE |
                            BufferAllocator::USAGE_HW_2D);
                    err = mTempBitmap->initCheck();
                }
+2 −3
Original line number Diff line number Diff line
@@ -71,8 +71,7 @@ void LayerDim::initDimmer(SurfaceFlinger* flinger, uint32_t w, uint32_t h)
        // TODO: api to pass the usage flags
        sp<Buffer> buffer = new Buffer(w, h, PIXEL_FORMAT_RGB_565,
                 BufferAllocator::USAGE_SW_WRITE_OFTEN |
                 BufferAllocator::USAGE_HW_TEXTURE |
                 BufferAllocator::USAGE_HW_2D);
                 BufferAllocator::USAGE_HW_TEXTURE);
        
        android_native_buffer_t* clientBuf = buffer->getNativeBuffer();

@@ -97,7 +96,7 @@ void LayerDim::initDimmer(SurfaceFlinger* flinger, uint32_t w, uint32_t h)

        // initialize the texture with zeros
        GGLSurface t;
        buffer->lock(&t, GRALLOC_USAGE_SW_READ_NEVER | GRALLOC_USAGE_SW_WRITE_OFTEN);
        buffer->lock(&t, GRALLOC_USAGE_SW_WRITE_OFTEN);
        memset(t.data, 0, t.stride * t.height * 2);
        buffer->unlock();
        sUseTexture = true;