Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: gpu/command_buffer/tests/gl_pointcoord_unittest.cc

Issue 2602563002: Refactor DrawTextureQuad and CheckPixels in gl_tests util (Closed)
Patch Set: git cl format Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <GLES2/gl2.h> 5 #include <GLES2/gl2.h>
6 #include <GLES2/gl2ext.h> 6 #include <GLES2/gl2ext.h>
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "gpu/command_buffer/tests/gl_manager.h" 9 #include "gpu/command_buffer/tests/gl_manager.h"
10 #include "gpu/command_buffer/tests/gl_test_utils.h" 10 #include "gpu/command_buffer/tests/gl_test_utils.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 GLfloat u = xx / max_point_size * 2 - 1; 131 GLfloat u = xx / max_point_size * 2 - 1;
132 GLfloat v = yy / max_point_size * 2 - 1; 132 GLfloat v = yy / max_point_size * 2 - 1;
133 GLint xf = s2p(point_x + u * point_width); 133 GLint xf = s2p(point_x + u * point_width);
134 GLint yf = s2p(point_y + v * point_width); 134 GLint yf = s2p(point_y + v * point_width);
135 GLfloat s = 0.5 + (xf + 0.5 - xw) / max_point_size; 135 GLfloat s = 0.5 + (xf + 0.5 - xw) / max_point_size;
136 GLfloat t = 0.5 + (yf + 0.5 - yw) / max_point_size; 136 GLfloat t = 0.5 + (yf + 0.5 - yw) / max_point_size;
137 uint8_t color[4] = { 137 uint8_t color[4] = {
138 static_cast<uint8_t>(s * 255), 138 static_cast<uint8_t>(s * 255),
139 static_cast<uint8_t>((1 - t) * 255), 0, 255, 139 static_cast<uint8_t>((1 - t) * 255), 0, 255,
140 }; 140 };
141 GLTestHelper::CheckPixels(xf, yf, 1, 1, 4, color); 141 GLTestHelper::CheckPixels(xf, yf, 1, 1, 4, color, nullptr);
142 } 142 }
143 } 143 }
144 } 144 }
145 } 145 }
146 146
147 GLTestHelper::CheckGLError("no errors", __LINE__); 147 GLTestHelper::CheckGLError("no errors", __LINE__);
148 } 148 }
149 149
150 } // namespace gpu 150 } // namespace gpu
151 151
152 152
153 153
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698