summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authortwiz@chromium.org <twiz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-05 01:23:44 +0000
committertwiz@chromium.org <twiz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-05 01:23:44 +0000
commite57052dfc263904958aab228c15df44c26386295 (patch)
tree75672d5a2be3e912d8fd898b6c45da8e2d48de1b /gpu
parent8e23c888e76b7ecdc5e5f9d8fb7451097e96a0e9 (diff)
downloadchromium_src-e57052dfc263904958aab228c15df44c26386295.zip
chromium_src-e57052dfc263904958aab228c15df44c26386295.tar.gz
chromium_src-e57052dfc263904958aab228c15df44c26386295.tar.bz2
Adjust the constant pixel color values so that premultiplied alpha operations do not rely on the rounding behaviour of the GPU shader.
The rounding behaviour on mac was generating results that 1/2 = 1, which was not present on Linux and Windows platforms. BUG=126178 TEST=gl_tests Review URL: http://codereview.chromium.org/10368026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135512 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/gpu/command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc b/gpu/command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc
index 9020537..28b1518 100644
--- a/gpu/command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc
+++ b/gpu/command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc
@@ -122,9 +122,10 @@ TEST_F(GLCopyTextureCHROMIUMTest, FlipYAndPremultiplyAlpha) {
uint8 pixels[2][2][4];
for (int x = 0; x < 2; ++x) {
for (int y = 0; y < 2; ++y) {
- pixels[y][x][0] = x + y;
- pixels[y][x][1] = x + y;
- pixels[y][x][2] = x + y;
+ uint8 color = 16 * x + 16 * y;
+ pixels[y][x][0] = color;
+ pixels[y][x][1] = color;
+ pixels[y][x][2] = color;
pixels[y][x][3] = 128u;
}
}