Pass ImplFactory to Texture constructor

This improves encapsulation inside the Texture class, and removes
duplication of createTexture calls. This is a necessary step towards
adding a shared "Data" structure to the Texture classes, following a
similar pattern as for example the Framebuffer class.

This patch also shares the same MockFactory class among different
unit tests.

BUG=angleproject:596
TEST=angle_unittests

Change-Id: Ie8d3a9aa4ec35565d7ecbabb8c40e7b1ba068721
Reviewed-on: https://chromium-review.googlesource.com/340200
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/libANGLE/ResourceManager.cpp b/src/libANGLE/ResourceManager.cpp
index 3872d39..a0af9c6 100644
--- a/src/libANGLE/ResourceManager.cpp
+++ b/src/libANGLE/ResourceManager.cpp
@@ -403,7 +403,7 @@
         return textureMapIt->second;
     }
 
-    Texture *texture = new Texture(mFactory->createTexture(type), handle, type);
+    Texture *texture = new Texture(mFactory, handle, type);
     texture->addRef();
 
     if (handleAllocated)