Commit 3f6a398c by Geoff Lang

Fix type conversion warnings.

BUG=angleproject:1382 Change-Id: Idee8882a7d7576faaa08418d9d399d836cec8fa7 Reviewed-on: https://chromium-review.googlesource.com/360903 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 1a1829c4
......@@ -465,7 +465,7 @@ BindingInfo Program::getFragmentInputBindingInfo(GLint index) const
ret.valid = true;
std::string originalName = binding.first;
unsigned int index = ParseAndStripArrayIndex(&originalName);
unsigned int arrayIndex = ParseAndStripArrayIndex(&originalName);
for (const auto &in : inputs)
{
......@@ -478,10 +478,10 @@ BindingInfo Program::getFragmentInputBindingInfo(GLint index) const
// "if the string identifies the base name of an active array, where the
// string would exactly match the name of the variable if the suffix "[0]"
// were appended to the string".
if (index == GL_INVALID_INDEX)
index = 0;
if (arrayIndex == GL_INVALID_INDEX)
arrayIndex = 0;
ret.name = in.mappedName + "[" + std::to_string(index) + "]";
ret.name = in.mappedName + "[" + std::to_string(arrayIndex) + "]";
}
else
{
......
......@@ -537,16 +537,17 @@ void ProgramGL::postLink()
GLint queryResults[ArraySize(kQueryProperties)];
GLsizei queryLength = 0;
mFunctions->getProgramResourceiv(mProgramID, GL_FRAGMENT_INPUT_NV, i,
ArraySize(kQueryProperties), kQueryProperties,
ArraySize(queryResults), &queryLength, queryResults);
mFunctions->getProgramResourceiv(
mProgramID, GL_FRAGMENT_INPUT_NV, i, static_cast<GLsizei>(ArraySize(kQueryProperties)),
kQueryProperties, static_cast<GLsizei>(ArraySize(queryResults)), &queryLength,
queryResults);
ASSERT(queryLength == ArraySize(kQueryProperties));
PathRenderingFragmentInput input;
input.name = name;
input.location = queryResults[0];
mPathRenderingFragmentInputs.push_back(std::move(input));
PathRenderingFragmentInput baseElementInput;
baseElementInput.name = name;
baseElementInput.location = queryResults[0];
mPathRenderingFragmentInputs.push_back(std::move(baseElementInput));
// If the input is an array it's denoted by [0] suffix on the variable
// name. We'll then create an entry per each array index where index > 0
......@@ -558,12 +559,12 @@ void ProgramGL::postLink()
const auto arraySize = queryResults[1];
const auto baseLocation = queryResults[0];
for (GLint i = 1; i < arraySize; ++i)
for (GLint arrayIndex = 1; arrayIndex < arraySize; ++arrayIndex)
{
PathRenderingFragmentInput input;
input.name = name + "[" + std::to_string(i) + "]";
input.location = baseLocation + i;
mPathRenderingFragmentInputs.push_back(std::move(input));
PathRenderingFragmentInput arrayElementInput;
arrayElementInput.name = name + "[" + std::to_string(arrayIndex) + "]";
arrayElementInput.location = baseLocation + arrayIndex;
mPathRenderingFragmentInputs.push_back(std::move(arrayElementInput));
}
}
}
......
......@@ -1186,14 +1186,15 @@ class CHROMIUMPathRenderingWithTexturingTest : public ANGLETest
if (j % 2 == 0)
{
glDisable(GL_STENCIL_TEST);
glUniform2f(kModelTranslateLocation, i * kShapeWidth, j * kShapeHeight);
glUniform2f(kModelTranslateLocation, static_cast<GLfloat>(i * kShapeWidth),
static_cast<GLfloat>(j * kShapeHeight));
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
}
else
{
glEnable(GL_STENCIL_TEST);
path_model_translate[12] = i * kShapeWidth;
path_model_translate[13] = j * kShapeHeight;
path_model_translate[12] = static_cast<GLfloat>(i * kShapeWidth);
path_model_translate[13] = static_cast<GLfloat>(j * kShapeHeight);
glMatrixLoadfCHROMIUM(GL_PATH_MODELVIEW_CHROMIUM, path_model_translate);
glStencilThenCoverFillPathCHROMIUM(path, GL_COUNT_UP_CHROMIUM, 0x7F,
GL_BOUNDING_BOX_CHROMIUM);
......@@ -1374,15 +1375,16 @@ TEST_P(CHROMIUMPathRenderingWithTexturingTest, TestProgramPathFragmentInputGenCH
{
const float fx = kFillCoords[k];
const float fy = kFillCoords[k + 1];
const float px = i * kShapeWidth;
const float py = j * kShapeHeight;
const float px = static_cast<float>(i * kShapeWidth);
const float py = static_cast<float>(j * kShapeHeight);
angle::GLColor color;
color.R = std::roundf((px + fx) / kResolution * 255.0f);
color.G = std::roundf((py + fy) / kResolution * 255.0f);
color.R = static_cast<GLubyte>(std::roundf((px + fx) / kResolution * 255.0f));
color.G = static_cast<GLubyte>(std::roundf((py + fy) / kResolution * 255.0f));
color.B = 0;
color.A = 255;
CheckPixels(px + fx, py + fy, 1, 1, 2, color);
CheckPixels(static_cast<GLint>(px + fx), static_cast<GLint>(py + fy), 1, 1, 2,
color);
}
}
}
......@@ -1449,15 +1451,16 @@ TEST_P(CHROMIUMPathRenderingWithTexturingTest, TestProgramPathFragmentInputGenCH
{
const float fx = kFillCoords[k];
const float fy = kFillCoords[k + 1];
const float px = i * kShapeWidth;
const float py = j * kShapeHeight;
const float px = static_cast<float>(i * kShapeWidth);
const float py = static_cast<float>(j * kShapeHeight);
angle::GLColor color;
color.R = std::roundf(fx / kShapeWidth * 255.0f);
color.G = std::roundf(fy / kShapeHeight * 255.0f);
color.R = static_cast<GLubyte>(std::roundf(fx / kShapeWidth * 255.0f));
color.G = static_cast<GLubyte>(std::roundf(fy / kShapeHeight * 255.0f));
color.B = 0;
color.A = 255;
CheckPixels(px + fx, py + fy, 1, 1, 2, color);
CheckPixels(static_cast<GLint>(px + fx), static_cast<GLint>(py + fy), 1, 1, 2,
color);
}
}
}
......@@ -1779,15 +1782,16 @@ TEST_P(CHROMIUMPathRenderingWithTexturingTest, BindFragmentInputArray)
{
const float fx = kFillCoords[k];
const float fy = kFillCoords[k + 1];
const float px = i * kShapeWidth;
const float py = j * kShapeHeight;
const float px = static_cast<float>(i * kShapeWidth);
const float py = static_cast<float>(j * kShapeHeight);
angle::GLColor color;
color.R = 0;
color.G = 255;
color.B = 0;
color.A = 255;
CheckPixels(px + fx, py + fy, 1, 1, 2, color);
CheckPixels(static_cast<GLint>(px + fx), static_cast<GLint>(py + fy), 1, 1, 2,
color);
}
}
}
......@@ -1875,15 +1879,16 @@ TEST_P(CHROMIUMPathRenderingWithTexturingTest,
{
const float fx = kFillCoords[k];
const float fy = kFillCoords[k + 1];
const float px = i * kShapeWidth;
const float py = j * kShapeHeight;
const float px = static_cast<float>(i * kShapeWidth);
const float py = static_cast<float>(j * kShapeHeight);
angle::GLColor color;
color.R = 0;
color.G = 255;
color.B = 0;
color.A = 255;
CheckPixels(px + fx, py + fy, 1, 1, 2, color);
CheckPixels(static_cast<GLint>(px + fx), static_cast<GLint>(py + fy), 1, 1, 2,
color);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment