Have an actual fallback if the surface is lost
Bug: 17516789
This will force a relayout/reinitialize pass if the Surface
is lost mid-render instead of crashing on the next frame
Change-Id: If08bfa16f740728fa7c05904fa11e26f07b81e2e
diff --git a/libs/hwui/renderthread/CanvasContext.h b/libs/hwui/renderthread/CanvasContext.h
index e20564b..435244e 100644
--- a/libs/hwui/renderthread/CanvasContext.h
+++ b/libs/hwui/renderthread/CanvasContext.h
@@ -68,6 +68,8 @@
bool initialize(ANativeWindow* window);
void updateSurface(ANativeWindow* window);
void pauseSurface(ANativeWindow* window);
+ bool hasSurface() { return mNativeWindow.get(); }
+
void setup(int width, int height, const Vector3& lightCenter, float lightRadius,
uint8_t ambientShadowAlpha, uint8_t spotShadowAlpha);
void setOpaque(bool opaque);