Merge "Fix crash in Vulkan pipeline at boot time"

This commit is contained in:
TreeHugger Robot
2017-10-20 20:26:53 +00:00
committed by Android (Google) Code Review
2 changed files with 7 additions and 1 deletions

View File

@@ -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

View File

@@ -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;
}