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/ReadPixelsTest.cpp b/tests/angle_tests/ReadPixelsTest.cpp
index 886e995..c04aeed 100644
--- a/tests/angle_tests/ReadPixelsTest.cpp
+++ b/tests/angle_tests/ReadPixelsTest.cpp
@@ -99,14 +99,14 @@
GLint offset = 16;
std::vector<GLubyte> pixels((pixelsWidth + offset) * (pixelsHeight + offset) * 4);
- glReadPixels(-offset, -offset, pixelsWidth + offset, pixelsHeight + offset, GL_RGBA, GL_UNSIGNED_BYTE, pixels.data());
+ glReadPixels(-offset, -offset, pixelsWidth + offset, pixelsHeight + offset, GL_RGBA, GL_UNSIGNED_BYTE, &pixels[0]);
EXPECT_GL_NO_ERROR();
for (int y = pixelsHeight / 2; y < pixelsHeight; y++)
{
for (int x = pixelsWidth / 2; x < pixelsWidth; x++)
{
- const GLubyte* pixel = pixels.data() + ((y * (pixelsWidth + offset) + x) * 4);
+ const GLubyte* pixel = &pixels[0] + ((y * (pixelsWidth + offset) + x) * 4);
unsigned int r = static_cast<unsigned int>(pixel[0]);
unsigned int g = static_cast<unsigned int>(pixel[1]);
unsigned int b = static_cast<unsigned int>(pixel[2]);