GLESv2: Correctly handle location -1 in shared groups.
Before this CL, getHostLocation left an out parameter undefined when
accessing location == -1.
It now sets it to -1, consistent with the rest of the SharedGroup
library.
BUG=b.android.com/199855
BUG=27273807
Change-Id: Ibbc234e22895083b2057fe5feb34dbd6d7b02be3
diff --git a/opengl/system/GLESv2_enc/GL2Encoder.cpp b/opengl/system/GLESv2_enc/GL2Encoder.cpp
index accb223..3acd8b8 100755
--- a/opengl/system/GLESv2_enc/GL2Encoder.cpp
+++ b/opengl/system/GLESv2_enc/GL2Encoder.cpp
@@ -1051,8 +1051,10 @@
{
GL2Encoder *ctx = (GL2Encoder*)self;
GLuint program = ctx->m_state->currentProgram();
- if (location == -1)
+ if (location == -1) {
+ *hostLoc = location;
return;
+ }
SET_ERROR_IF((location < 0), GL_INVALID_OPERATION);
GLint curHostLoc = ctx->m_shared->locationWARAppToHost(program,location);
SET_ERROR_IF((ctx->m_shared->getProgramUniformType(program,curHostLoc) == 0 &&