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

Commit d56d2188 authored by Stan Iliev's avatar Stan Iliev
Browse files

Fix crash in Vulkan pipeline at boot time

Fix a crash caused by calling OpenGL APIs with Vulkan pipeline
(likely a regression from ag/2706458).

Test: Ran CtsViewTestCases tests with SkiaGL pipeline.
Change-Id: Ibabeb4229ef88de57c99f2961a10a68ca71b25ab
parent 3cf1a945
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -31,6 +31,12 @@ namespace android {
namespace uirenderer {

Extensions::Extensions() {
    if (Properties::getRenderPipelineType() != RenderPipelineType::OpenGL) {
        //Extensions class is used only by OpenGL pipeline
        //The code below will crash for SkiaVulkan, because OpenGL is not initialized
        //TODO: instantiate Extensions class only for OpenGL pipeline
        return;
    }
    const char* version = (const char*) glGetString(GL_VERSION);

    // Section 6.1.5 of the OpenGL ES specification indicates the GL version
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ CopyResult SkiaOpenGLReadback::copyImageInto(EGLImageKHR eglImage, const Matrix4
     * for reading back float buffers (skbug.com/6945).
     */
    if (pixelConfig == kRGBA_half_GrPixelConfig &&
            !DeviceInfo::get()->extensions().hasFloatTextures()) {
            !grContext->caps()->isConfigTexturable(kRGBA_half_GrPixelConfig)) {
        ALOGW("Can't copy surface into bitmap, RGBA_F16 config is not supported");
        return CopyResult::DestinationInvalid;
    }