Use immutable level count in gl::Texture.

Instead of storing a binary flag indicating if we've created
immutable storage, store a level count. This indicates if or if
not we've created immutable storage, as well as avoiding the
call to the native storage to return the level count.

BUG=angle:781

Change-Id: I08a6bd086d00ddf3255262a7711628be5212b4b7
Reviewed-on: https://chromium-review.googlesource.com/222921
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Move Texture Serials to the base class.

It's reasonable to use the serial logic on both the GL and all other
translated Renderers, since we check the logic on the GL-side.
Serials give us a way to identify Textures that aren't raw pointers
and aren't "id". "id" has issues when Textures are deleted, then
re-allocated with the same value.

BUG=angle:781

Change-Id: I1a2a8b6f4ea3db915574c957c143a81e0210ec7d
Reviewed-on: https://chromium-review.googlesource.com/222922
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Remove getSamplerStateWithNativeOffset.

This method returned a sampler state as normal, with the base level
automatically offset by the one or two levels we use in the D3D
workaround for small compressed textures. Since this is D3D-only,
we can move all of the logic into the D3D classes themselves.

BUG=angle:781

Change-Id: Ie0a60877efebb41f02f4e57625a44e5fb5cce074
Reviewed-on: https://chromium-review.googlesource.com/222923
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Remove getNativeTexture from TextureImpl.

We can stop exposing this method on the GL-side, now that we only
use it on the D3D back-end.

BUG=angle:781

Change-Id: I3a9ecc277dcd21147881b8780849782f68b3e62e
Reviewed-on: https://chromium-review.googlesource.com/222924
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>