Use the sh namespace for shader variables.

Since these types originate from the translator, use an appropriate
namespace. Also rename some of the gl helper functions to be more
specific to their functionality.

BUG=angle:466

Change-Id: Idc29987b2053b3c40748dd46b581f3dbd8a6fd61
Reviewed-on: https://chromium-review.googlesource.com/204680
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
diff --git a/src/common/blocklayout.cpp b/src/common/blocklayout.cpp
index a0c9289..cdb7d7f 100644
--- a/src/common/blocklayout.cpp
+++ b/src/common/blocklayout.cpp
@@ -12,7 +12,7 @@
 #include "common/mathutil.h"
 #include "common/utilities.h"
 
-namespace gl
+namespace sh
 {
 
 BlockLayoutEncoder::BlockLayoutEncoder(std::vector<BlockMemberInfo> *blockInfoOut)
@@ -103,7 +103,7 @@
 void Std140BlockEncoder::getBlockLayoutInfo(GLenum type, unsigned int arraySize, bool isRowMajorMatrix, int *arrayStrideOut, int *matrixStrideOut)
 {
     // We assume we are only dealing with 4 byte components (no doubles or half-words currently)
-    ASSERT(gl::UniformComponentSize(gl::UniformComponentType(type)) == BytesPerComponent);
+    ASSERT(gl::VariableComponentSize(gl::VariableComponentType(type)) == BytesPerComponent);
 
     size_t baseAlignment = 0;
     int matrixStride = 0;
@@ -127,7 +127,7 @@
     }
     else
     {
-        const int numComponents = gl::UniformComponentCount(type);
+        const int numComponents = gl::VariableComponentCount(type);
         baseAlignment = (numComponents == 3 ? 4u : static_cast<size_t>(numComponents));
     }
 
@@ -151,7 +151,7 @@
     }
     else
     {
-        mCurrentOffset += gl::UniformComponentCount(type);
+        mCurrentOffset += gl::VariableComponentCount(type);
     }
 }
 
@@ -173,7 +173,7 @@
 void HLSLBlockEncoder::getBlockLayoutInfo(GLenum type, unsigned int arraySize, bool isRowMajorMatrix, int *arrayStrideOut, int *matrixStrideOut)
 {
     // We assume we are only dealing with 4 byte components (no doubles or half-words currently)
-    ASSERT(gl::UniformComponentSize(gl::UniformComponentType(type)) == BytesPerComponent);
+    ASSERT(gl::VariableComponentSize(gl::VariableComponentType(type)) == BytesPerComponent);
 
     int matrixStride = 0;
     int arrayStride = 0;
@@ -204,7 +204,7 @@
     }
     else if (isPacked())
     {
-        int numComponents = gl::UniformComponentCount(type);
+        int numComponents = gl::VariableComponentCount(type);
         if ((numComponents + (mCurrentOffset % ComponentsPerRegister)) > ComponentsPerRegister)
         {
             nextRegister();
@@ -232,7 +232,7 @@
     }
     else if (isPacked())
     {
-        mCurrentOffset += gl::UniformComponentCount(type);
+        mCurrentOffset += gl::VariableComponentCount(type);
     }
     else
     {
@@ -245,8 +245,8 @@
     mCurrentOffset += (numRegisters * ComponentsPerRegister);
 }
 
-void HLSLVariableGetRegisterInfo(unsigned int baseRegisterIndex, gl::Uniform *variable, HLSLBlockEncoder *encoder,
-                                 const std::vector<gl::BlockMemberInfo> &blockInfo, ShShaderOutput outputType)
+void HLSLVariableGetRegisterInfo(unsigned int baseRegisterIndex, Uniform *variable, HLSLBlockEncoder *encoder,
+                                 const std::vector<BlockMemberInfo> &blockInfo, ShShaderOutput outputType)
 {
     // because this method computes offsets (element indexes) instead of any total sizes,
     // we can ignore the array size of the variable
@@ -282,7 +282,7 @@
     }
 }
 
-void HLSLVariableGetRegisterInfo(unsigned int baseRegisterIndex, gl::Uniform *variable, ShShaderOutput outputType)
+void HLSLVariableGetRegisterInfo(unsigned int baseRegisterIndex, Uniform *variable, ShShaderOutput outputType)
 {
     std::vector<BlockMemberInfo> blockInfo;
     HLSLBlockEncoder encoder(&blockInfo,