mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-26 04:35:41 +03:00
LibGL: Convert stencil front/back function and operation to Array
s
This commit is contained in:
parent
3609ffc450
commit
6386671944
Notes:
sideshowbarker
2024-07-17 20:42:53 +09:00
Author: https://github.com/gmta Commit: https://github.com/SerenityOS/serenity/commit/63866719443 Pull-request: https://github.com/SerenityOS/serenity/pull/11960 Reviewed-by: https://github.com/Quaker762 ✅
@ -2635,9 +2635,9 @@ void SoftwareGLContext::gl_stencil_func_separate(GLenum face, GLenum func, GLint
|
||||
|
||||
StencilFunctionOptions new_options = { func, ref, mask };
|
||||
if (face == GL_FRONT || face == GL_FRONT_AND_BACK)
|
||||
m_stencil_frontfacing_func = new_options;
|
||||
m_stencil_function[Face::Front] = new_options;
|
||||
if (face == GL_BACK || face == GL_FRONT_AND_BACK)
|
||||
m_stencil_backfacing_func = new_options;
|
||||
m_stencil_function[Face::Back] = new_options;
|
||||
}
|
||||
|
||||
void SoftwareGLContext::gl_stencil_op_separate(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass)
|
||||
@ -2677,9 +2677,9 @@ void SoftwareGLContext::gl_stencil_op_separate(GLenum face, GLenum sfail, GLenum
|
||||
|
||||
StencilOperationOptions new_options = { sfail, dpfail, dppass };
|
||||
if (face == GL_FRONT || face == GL_FRONT_AND_BACK)
|
||||
m_stencil_frontfacing_op = new_options;
|
||||
m_stencil_operation[Face::Front] = new_options;
|
||||
if (face == GL_BACK || face == GL_FRONT_AND_BACK)
|
||||
m_stencil_backfacing_op = new_options;
|
||||
m_stencil_operation[Face::Back] = new_options;
|
||||
}
|
||||
|
||||
void SoftwareGLContext::gl_normal(GLfloat nx, GLfloat ny, GLfloat nz)
|
||||
|
@ -231,16 +231,14 @@ private:
|
||||
GLint reference_value { 0 };
|
||||
GLuint mask { NumericLimits<GLuint>::max() };
|
||||
};
|
||||
StencilFunctionOptions m_stencil_backfacing_func;
|
||||
StencilFunctionOptions m_stencil_frontfacing_func;
|
||||
Array<StencilFunctionOptions, 2u> m_stencil_function;
|
||||
|
||||
struct StencilOperationOptions {
|
||||
GLenum op_fail { GL_KEEP };
|
||||
GLenum op_depth_fail { GL_KEEP };
|
||||
GLenum op_pass { GL_KEEP };
|
||||
};
|
||||
StencilOperationOptions m_stencil_backfacing_op;
|
||||
StencilOperationOptions m_stencil_frontfacing_op;
|
||||
Array<StencilOperationOptions, 2u> m_stencil_operation;
|
||||
|
||||
GLenum m_current_read_buffer = GL_BACK;
|
||||
GLenum m_current_draw_buffer = GL_BACK;
|
||||
|
Loading…
Reference in New Issue
Block a user