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

Unified Diff: third_party/gles2_book/Chapter_11/Stencil_Test/Stencil_Test.c

Issue 7530011: Fixed Stencil test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/gles2_book/README.chromium » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/gles2_book/Chapter_11/Stencil_Test/Stencil_Test.c
===================================================================
--- third_party/gles2_book/Chapter_11/Stencil_Test/Stencil_Test.c (revision 94518)
+++ third_party/gles2_book/Chapter_11/Stencil_Test/Stencil_Test.c (working copy)
@@ -42,10 +42,10 @@
-0.25f, 0.25f, 0.50f,
-0.25f, 0.75f, 0.50f,
-0.75f, 0.75f, 0.50f,
- 0.25f, 0.25f, 0.90f, // Quad #1
- 0.75f, 0.25f, 0.90f,
- 0.75f, 0.75f, 0.90f,
- 0.25f, 0.75f, 0.90f,
+ 0.25f, 0.25f, 0.50f, // Quad #1
+ 0.75f, 0.25f, 0.50f,
+ 0.75f, 0.75f, 0.50f,
+ 0.25f, 0.75f, 0.50f,
-0.75f, -0.75f, 0.50f, // Quad #2
-0.25f, -0.75f, 0.50f,
-0.25f, -0.25f, 0.50f,
@@ -118,16 +118,14 @@
{ 1.0f, 0.0f, 0.0f, 1.0f },
{ 0.0f, 1.0f, 0.0f, 1.0f },
{ 0.0f, 0.0f, 1.0f, 1.0f },
- { 1.0f, 1.0f, 0.0f, 0.0f }
+ { 1.0f, 1.0f, 0.0f, 1.0f }
};
- GLint numStencilBits = 0;
GLuint stencilValues[NumTests] = {
0x7, // Result of test 0
0x0, // Result of test 1
0x2, // Result of test 2
- 0xff // Result of test 3. We need to fill this
- // value in a run-time
+ 0xfe // Result of test 3
};
// Set the viewport
@@ -214,14 +212,6 @@
glStencilOp( GL_INVERT, GL_KEEP, GL_KEEP );
offset += 6;
glDrawElements( GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, offset );
-
- // Since we don't know at compile time how many stecil bits are present,
- // we'll query, and update the value correct value in the
- // stencilValues arrays for the fourth tests. We'll use this value
- // later in rendering.
- glGetIntegerv( GL_STENCIL_BITS, &numStencilBits );
-
- stencilValues[3] = ~(((1 << numStencilBits) - 1) & 0x1) & 0xff;
// Use the stencil buffer for controlling where rendering will
// occur. We diable writing to the stencil buffer so we
« no previous file with comments | « no previous file | third_party/gles2_book/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698