Merge "handles glGetFloatv with GL_STENCIL_VALUE_MASK etc" into studio-1.0-dev
diff --git a/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp b/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp
index fe64f6f..81f867f 100644
--- a/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp
+++ b/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp
@@ -934,6 +934,20 @@
         }
         break;
 
+    case GL_STENCIL_BACK_VALUE_MASK:
+    case GL_STENCIL_BACK_WRITEMASK:
+    case GL_STENCIL_VALUE_MASK:
+    case GL_STENCIL_WRITEMASK:
+        {
+            GLint myint = 0;
+            glGetIntegerv(pname, &myint);
+            // Two casts are used: since mask is unsigned integer,
+            // the first cast converts to unsigned integer;
+            // the second cast converts to float.
+            *params = (GLfloat)((GLuint)(myint));
+        }
+        break;
+
     default:
         ctx->dispatcher().glGetFloatv(pname,params);
     }