Commit b97a3e77 by Olli Etuaho Committed by Commit Bot

Clean up MipmapTest

This refactoring is done to prepare for adding more mipmap tests for ES3 where base level / max level is changed from 0. 1. Reuse drawQuad() from ANGLETest instead of having completely custom quad drawing code, and reuse the same clear+draw function for both 2D and cube map texture tests. 2. Add a helper function for clearing texture level 0 with glClear. 3. Remove a few redundant texture binding and useProgram calls. 4. Rely on sampler uniforms being set to 0 by default and texture unit 0 being active by default. 5. Remove "Offscreen" from variable names. 6. Split SetUp functions to helper functions. 7. Reuse FillWithRGBA from TextureTest also in MipmapTest. BUG=angleproject:596 TEST=angle_end2end_tests Change-Id: I9fd738f4b8b0a19c7aa1d267f7dbaa40a6935631 Reviewed-on: https://chromium-review.googlesource.com/338791Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
parent b0a53105
...@@ -11,18 +11,6 @@ using namespace angle; ...@@ -11,18 +11,6 @@ using namespace angle;
namespace namespace
{ {
template <typename T>
void FillWithRGBA(size_t pixelCount, T red, T green, T blue, T alpha, T *outArray)
{
for (size_t i = 0u; i < pixelCount; ++i)
{
outArray[i * 4u] = red;
outArray[i * 4u + 1u] = green;
outArray[i * 4u + 2u] = blue;
outArray[i * 4u + 3u] = alpha;
}
}
class TexCoordDrawTest : public ANGLETest class TexCoordDrawTest : public ANGLETest
{ {
protected: protected:
......
...@@ -66,6 +66,18 @@ bool operator==(const GLColor &a, const GLColor &b); ...@@ -66,6 +66,18 @@ bool operator==(const GLColor &a, const GLColor &b);
std::ostream &operator<<(std::ostream &ostream, const GLColor &color); std::ostream &operator<<(std::ostream &ostream, const GLColor &color);
GLColor ReadColor(GLint x, GLint y); GLColor ReadColor(GLint x, GLint y);
template <typename T>
void FillWithRGBA(size_t pixelCount, T red, T green, T blue, T alpha, T *outArray)
{
for (size_t i = 0u; i < pixelCount; ++i)
{
outArray[i * 4u] = red;
outArray[i * 4u + 1u] = green;
outArray[i * 4u + 2u] = blue;
outArray[i * 4u + 3u] = alpha;
}
}
} // namespace angle } // namespace angle
#define EXPECT_PIXEL_EQ(x, y, r, g, b, a) \ #define EXPECT_PIXEL_EQ(x, y, r, g, b, a) \
......
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