Crash instead of leaking layers/textures between GL contexts

bug:17208461
Change-Id: I4d58f301cf0f5e8145e808a5d6ade4de7801970b
diff --git a/libs/hwui/RenderState.cpp b/libs/hwui/RenderState.cpp
index 97f379d..50b8f39 100644
--- a/libs/hwui/RenderState.cpp
+++ b/libs/hwui/RenderState.cpp
@@ -34,6 +34,10 @@
     mCaches->init();
 }
 
+void RenderState::onGLContextDestroyed() {
+    LOG_ALWAYS_FATAL_IF(!mActiveLayers.empty(), "layers have survived gl context destruction");
+}
+
 void RenderState::setViewport(GLsizei width, GLsizei height) {
     mViewportWidth = width;
     mViewportHeight = height;