Bug:
13111945
Fixes an issue where a layer is destroyed after the GLRenderer
lost its Surface. Instead just check that the context we want is
current regardless of the active surface
Change-Id: I6537e6232b5c667b218b896ed5ef390fbe956344
mAttachedLayers.add(hardwareLayer);
}
+ boolean hasContext() {
+ return sEgl != null && mEglContext != null
+ && mEglContext.equals(sEgl.eglGetCurrentContext());
+ }
+
@Override
void onLayerDestroyed(HardwareLayer layer) {
if (mGlCanvas != null) {
mGlCanvas.cancelLayerUpdate(layer);
}
- if (Looper.myLooper() == Looper.getMainLooper() && validate()) {
+ if (hasContext()) {
long backingLayer = layer.detachBackingLayer();
nDestroyLayer(backingLayer);
}