Move isTriangleMode to utilities.h.

TRAC #22245 Signed-off-by: Daniel Koch Signed-off-by: Geoff Lang Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1581 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 7386858e
...@@ -1734,7 +1734,7 @@ void Context::applyState(GLenum drawMode) ...@@ -1734,7 +1734,7 @@ void Context::applyState(GLenum drawMode)
Framebuffer *framebufferObject = getDrawFramebuffer(); Framebuffer *framebufferObject = getDrawFramebuffer();
GLint frontCCW = programBinary->getDxFrontCCWLocation(); GLint frontCCW = programBinary->getDxFrontCCWLocation();
GLfloat ccw = !isTriangleMode(drawMode) ? 0.0f : (mState.rasterizer.frontFace == GL_CCW ? 1.0f : -1.0f); GLfloat ccw = !IsTriangleMode(drawMode) ? 0.0f : (mState.rasterizer.frontFace == GL_CCW ? 1.0f : -1.0f);
programBinary->setUniform1fv(frontCCW, 1, &ccw); programBinary->setUniform1fv(frontCCW, 1, &ccw);
mRenderer->setRasterizerState(mState.rasterizer); mRenderer->setRasterizerState(mState.rasterizer);
...@@ -2498,7 +2498,7 @@ bool Context::skipDraw(GLenum drawMode) ...@@ -2498,7 +2498,7 @@ bool Context::skipDraw(GLenum drawMode)
return true; return true;
} }
} }
else if (isTriangleMode(drawMode)) else if (IsTriangleMode(drawMode))
{ {
if (mState.rasterizer.cullFace && mState.rasterizer.cullMode == GL_FRONT_AND_BACK) if (mState.rasterizer.cullFace && mState.rasterizer.cullMode == GL_FRONT_AND_BACK)
{ {
...@@ -2509,25 +2509,6 @@ bool Context::skipDraw(GLenum drawMode) ...@@ -2509,25 +2509,6 @@ bool Context::skipDraw(GLenum drawMode)
return false; return false;
} }
bool Context::isTriangleMode(GLenum drawMode)
{
switch (drawMode)
{
case GL_TRIANGLES:
case GL_TRIANGLE_FAN:
case GL_TRIANGLE_STRIP:
return true;
case GL_POINTS:
case GL_LINES:
case GL_LINE_LOOP:
case GL_LINE_STRIP:
return false;
default: UNREACHABLE();
}
return false;
}
void Context::setVertexAttrib(GLuint index, const GLfloat *values) void Context::setVertexAttrib(GLuint index, const GLfloat *values)
{ {
ASSERT(index < gl::MAX_VERTEX_ATTRIBS); ASSERT(index < gl::MAX_VERTEX_ATTRIBS);
......
...@@ -437,7 +437,6 @@ class Context ...@@ -437,7 +437,6 @@ class Context
Texture *getIncompleteTexture(TextureType type); Texture *getIncompleteTexture(TextureType type);
bool skipDraw(GLenum drawMode); bool skipDraw(GLenum drawMode);
bool isTriangleMode(GLenum drawMode);
void initExtensionString(); void initExtensionString();
void initRendererString(); void initRendererString();
......
...@@ -728,6 +728,25 @@ unsigned int GetStencilSize(GLenum stencilFormat) ...@@ -728,6 +728,25 @@ unsigned int GetStencilSize(GLenum stencilFormat)
} }
} }
bool IsTriangleMode(GLenum drawMode)
{
switch (drawMode)
{
case GL_TRIANGLES:
case GL_TRIANGLE_FAN:
case GL_TRIANGLE_STRIP:
return true;
case GL_POINTS:
case GL_LINES:
case GL_LINE_LOOP:
case GL_LINE_STRIP:
return false;
default: UNREACHABLE();
}
return false;
}
} }
std::string getTempPath() std::string getTempPath()
......
...@@ -57,6 +57,8 @@ GLuint GetGreenSize(GLenum colorFormat); ...@@ -57,6 +57,8 @@ GLuint GetGreenSize(GLenum colorFormat);
GLuint GetBlueSize(GLenum colorFormat); GLuint GetBlueSize(GLenum colorFormat);
GLuint GetDepthSize(GLenum depthFormat); GLuint GetDepthSize(GLenum depthFormat);
GLuint GetStencilSize(GLenum stencilFormat); GLuint GetStencilSize(GLenum stencilFormat);
bool IsTriangleMode(GLenum drawMode);
} }
std::string getTempPath(); std::string getTempPath();
......
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