summaryrefslogtreecommitdiff
path: root/libs/hwui/Extensions.cpp
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2017-10-20 20:26:53 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-10-20 20:26:53 +0000
commita0f2109438d93c115cce5fd5a31e18d2b16ef05c (patch)
treeb4b6eded965c34d7ec67ca418540907b5a33adf6 /libs/hwui/Extensions.cpp
parentef511a871643b4c3f45c163e5f5e4c73b209536b (diff)
parentd56d2188fc7fbc646516a5d3da99bc95b2480319 (diff)
Merge "Fix crash in Vulkan pipeline at boot time"
Diffstat (limited to 'libs/hwui/Extensions.cpp')
-rw-r--r--libs/hwui/Extensions.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/hwui/Extensions.cpp b/libs/hwui/Extensions.cpp
index 1e71cb081b39..6b8006cc5a33 100644
--- a/libs/hwui/Extensions.cpp
+++ b/libs/hwui/Extensions.cpp
@@ -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