Make sure we have a current EGL context when invoking EGL
Bug #5081795

Change-Id: Iee3382d362a71c1e6c5c498b319bf7f7bcf5a2f0
diff --git a/libs/hwui/Layer.h b/libs/hwui/Layer.h
index 0c536b0..dd75497 100644
--- a/libs/hwui/Layer.h
+++ b/libs/hwui/Layer.h
@@ -191,6 +191,10 @@
         if (texture.id) glDeleteTextures(1, &texture.id);
     }
 
+    inline void deleteFbo() {
+        if (fbo) glDeleteFramebuffers(1, &fbo);
+    }
+
     inline void allocateTexture(GLenum format, GLenum storage) {
         glTexImage2D(renderTarget, 0, format, getWidth(), getHeight(), 0, format, storage, NULL);
     }