Fix an image destruction deadlock.

The EGL image extension allows a texture image to be shared with another
texture. We previously prevented destroying them as long as they are shared
but the parent texture (which owns the resource lock for all its images)
could be destroyed before the EGL image is destroyed, causing a deadlock
when trying to acquire the resource lock. The situation was aggravated by
increasing the parent texture's reference count with the image reference
count (i.e. not the 'owning' texture's reference count). This fix ensures
that the parent texture can only destroy the images it owns.

Bug 18680652

Change-Id: I7fa09d181e695cbc287e77874bdb88f24c22cbd8
Reviewed-on: https://swiftshader-review.googlesource.com/1601
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/OpenGL/libGLES_CM/libGLES_CM.cbp b/src/OpenGL/libGLES_CM/libGLES_CM.cbp
index 042c9b7..b1f7bd3 100644
--- a/src/OpenGL/libGLES_CM/libGLES_CM.cbp
+++ b/src/OpenGL/libGLES_CM/libGLES_CM.cbp
@@ -247,6 +247,8 @@
 		<Unit filename="../../Shader/VertexRoutine.hpp" />
 		<Unit filename="../../Shader/VertexShader.cpp" />
 		<Unit filename="../../Shader/VertexShader.hpp" />
+		<Unit filename="../common/Object.cpp" />
+		<Unit filename="../common/Object.hpp" />
 		<Unit filename="../common/debug.cpp" />
 		<Unit filename="../common/debug.h" />
 		<Unit filename="../include/EGL/egl.h" />
@@ -273,8 +275,6 @@
 		<Unit filename="IndexDataManager.h" />
 		<Unit filename="MatrixStack.cpp" />
 		<Unit filename="MatrixStack.hpp" />
-		<Unit filename="RefCountObject.cpp" />
-		<Unit filename="RefCountObject.h" />
 		<Unit filename="Renderbuffer.cpp" />
 		<Unit filename="Renderbuffer.h" />
 		<Unit filename="ResourceManager.cpp" />
@@ -283,6 +283,7 @@
 		<Unit filename="Texture.h" />
 		<Unit filename="VertexDataManager.cpp" />
 		<Unit filename="VertexDataManager.h" />
+		<Unit filename="exports.map" />
 		<Unit filename="libGLES_CM.cpp" />
 		<Unit filename="main.cpp" />
 		<Unit filename="main.h" />