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

Commit fd1f557c authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

Convert backend texture creation failure from ALOGE to FATAL log

If the texture is invalid, we'll hit a fatal log later, but at that
point we won't have the stack trace to see where the invalid texture
was coming from. Convert this log into fatal so we can get a stack
trace that includes the caller.

In addition, abort if the texture has a width or height of zero, which
has been seen in recent crashes.

Bug: 279524845
Test: make
Change-Id: I1c8593c3da533692a43bd251dcdf2baa9572041a
parent 8bf29931
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -43,10 +43,12 @@ AutoBackendTexture::AutoBackendTexture(GrDirectContext* context, AHardwareBuffer
                                                       createProtectedImage, backendFormat,
                                                       isOutputBuffer);
    mColorType = GrAHardwareBufferUtils::GetSkColorTypeFromBufferFormat(desc.format);
    ALOGE_IF(!mBackendTexture.isValid(),
             "Failed to create a valid texture. [%p]:[%d,%d] isProtected:%d isWriteable:%d "
             "format:%d",
             this, desc.width, desc.height, createProtectedImage, isOutputBuffer, desc.format);
    if (!mBackendTexture.isValid() || !desc.width || !desc.height) {
        LOG_ALWAYS_FATAL("Failed to create a valid texture. [%p]:[%d,%d] isProtected:%d "
                         "isWriteable:%d format:%d",
                         this, desc.width, desc.height, createProtectedImage, isOutputBuffer,
                         desc.format);
    }
}

AutoBackendTexture::~AutoBackendTexture() {