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

Commit d354992d authored by Alec Mouri's avatar Alec Mouri
Browse files

Remove sampling usage bit requirement for output buffers

Skia RenderEngine hits a different path for creating SkSurfaces that
does not enforce presence of the sampling bit, so we don't really need
to enforce it here.

Note that in practice the sampling bit may still be provided in
anticipation of SF caching, so this is really just for tests/cleanup.

Bug: 180650640
Test: First, patch out sampling usage bit in RenderSurface
Test: boots
Test: simulate secondary displays
Test: force GPU composition
Change-Id: I35558beec60b1c228e1fa0ad6382482869e1719c
parent ec169127
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -404,10 +404,6 @@ bool SkiaGLRenderEngine::waitFence(base::unique_fd fenceFd) {
    return true;
}

static bool hasUsage(const AHardwareBuffer_Desc& desc, uint64_t usage) {
    return !!(desc.usage & usage);
}

static float toDegrees(uint32_t transform) {
    switch (transform) {
        case ui::Transform::ROT_90:
@@ -586,8 +582,6 @@ status_t SkiaGLRenderEngine::drawLayers(const DisplaySettings& display,
    auto& cache = mInProtectedContext ? mProtectedTextureCache : mTextureCache;
    AHardwareBuffer_Desc bufferDesc;
    AHardwareBuffer_describe(buffer->toAHardwareBuffer(), &bufferDesc);
    LOG_ALWAYS_FATAL_IF(!hasUsage(bufferDesc, AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE),
                        "missing usage");

    std::shared_ptr<AutoBackendTexture::LocalRef> surfaceTextureRef = nullptr;
    if (useFramebufferCache) {