Replace usages of std::vector::data in most cases.
In some parts of ANGLE code, we were using std::vector::data to get
a pointer to the first element. Sadly, this is c++11 only, which
isn't currently supported on Chromium. This was causing a breakage
on Android. We should probably refrain from using data except on
D3D-only code, which we know will be Visual Studio.
BUG=angle:767
Change-Id: Ibc10577368435a13f62d74d77c95076482cd8f82
Reviewed-on: https://chromium-review.googlesource.com/220920
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/tests/angle_tests/IncompleteTextureTest.cpp b/tests/angle_tests/IncompleteTextureTest.cpp
index a2508a0..ae58ba0 100644
--- a/tests/angle_tests/IncompleteTextureTest.cpp
+++ b/tests/angle_tests/IncompleteTextureTest.cpp
@@ -96,7 +96,7 @@
std::vector<GLubyte> textureData(textureWidth * textureHeight * 4);
fillTextureData(textureData, 255, 0, 0, 255);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, textureWidth, textureHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, textureData.data());
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, textureWidth, textureHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, &textureData[0]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
drawQuad(mProgram, "position", 0.5f);
@@ -107,7 +107,7 @@
drawQuad(mProgram, "position", 0.5f);
EXPECT_PIXEL_EQ(0, 0, 0, 0, 0, 255);
- glTexImage2D(GL_TEXTURE_2D, 1, GL_RGBA, textureWidth >> 1, textureHeight >> 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, textureData.data());
+ glTexImage2D(GL_TEXTURE_2D, 1, GL_RGBA, textureWidth >> 1, textureHeight >> 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, &textureData[0]);
drawQuad(mProgram, "position", 0.5f);
EXPECT_PIXEL_EQ(0, 0, 255, 0, 0, 255);
@@ -132,7 +132,7 @@
for (size_t i = 0; i < 7; i++)
{
glTexImage2D(GL_TEXTURE_2D, i, GL_RGBA, redTextureWidth >> i, redTextureHeight >> i, 0, GL_RGBA, GL_UNSIGNED_BYTE,
- redTextureData.data());
+ &redTextureData[0]);
}
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
@@ -150,7 +150,7 @@
{
glTexSubImage2D(GL_TEXTURE_2D, i, greenTextureWidth >> i, greenTextureHeight >> i,
greenTextureWidth >> i, greenTextureHeight >> i, GL_RGBA, GL_UNSIGNED_BYTE,
- greenTextureData.data());
+ &greenTextureData[0]);
}
drawQuad(mProgram, "position", 0.5f);