Share TextureState structure with TextureImpl

This refactoring patch removes the need to pass texture state to
methods of TextureImpl in some cases. It also adds target value to
TextureState, and moves TextureState definition to Texture.h.

The effective base level can now also be queried from TextureState,
which reduces the need to pass it around.

Two different code paths that dealt with the TextureStorage11 SRV
cache are combined into one.

Besides refactoring, this patch fixes applying mTopLevel twice when
determining the amount of mip levels TextureStorage11.

BUG=angleproject:596
TEST=angle_end2end_tests, angle_unittests

Change-Id: I1add3d9ad847bec56774e394125156cf9cb0fc2a
Reviewed-on: https://chromium-review.googlesource.com/342940
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/libANGLE/ResourceManager_unittest.cpp b/src/libANGLE/ResourceManager_unittest.cpp
index 3369f16..bb37ee5 100644
--- a/src/libANGLE/ResourceManager_unittest.cpp
+++ b/src/libANGLE/ResourceManager_unittest.cpp
@@ -15,6 +15,8 @@
 using namespace rx;
 using namespace gl;
 
+using ::testing::_;
+
 namespace
 {
 
@@ -37,7 +39,7 @@
 
 TEST_F(ResourceManagerTest, ReallocateBoundTexture)
 {
-    EXPECT_CALL(mMockFactory, createTexture(GL_TEXTURE_2D)).Times(1).RetiresOnSaturation();
+    EXPECT_CALL(mMockFactory, createTexture(_)).Times(1).RetiresOnSaturation();
 
     mResourceManager->checkTextureAllocation(1, GL_TEXTURE_2D);
     GLuint newTexture = mResourceManager->createTexture();