Assume a texture is unbound after deleting it
Bug #9316260

The GL specification indicates that deleting a bound texture has
the side effect of binding the default texture (name=0). This change
replaces all calls to glDeleteTextures() by Caches::deleteTexture()
to properly keep track of texture bindings.

Change-Id: Ifbc60ef433e0f9776a668dd5bd5f0adbc65a77a0
diff --git a/libs/hwui/Image.cpp b/libs/hwui/Image.cpp
index 77c2300..edf3930 100644
--- a/libs/hwui/Image.cpp
+++ b/libs/hwui/Image.cpp
@@ -54,7 +54,7 @@
         eglDestroyImageKHR(eglGetDisplay(EGL_DEFAULT_DISPLAY), mImage);
         mImage = EGL_NO_IMAGE_KHR;
 
-        glDeleteTextures(1, &mTexture);
+        Caches::getInstance().deleteTexture(mTexture);
         mTexture = 0;
     }
 }