mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibGL: Ignore stack on projection and model view matrix retrieval
Our implementation keeps the top-most item on the matrix stacks in a member variable, so we can always use that instead of considering the actual stack. Additionally, the current matrix mode should not influence retrieving the projection or model view matrix.
This commit is contained in:
parent
c3273e9492
commit
36a732e98e
Notes:
sideshowbarker
2024-07-17 18:23:08 +09:00
Author: https://github.com/gmta
Commit: 36a732e98e
Pull-request: https://github.com/SerenityOS/serenity/pull/12695
Reviewed-by: https://github.com/Quaker762 ✅
Reviewed-by: https://github.com/linusg ✅
Reviewed-by: https://github.com/sunverwerth ✅
1 changed files with 3 additions and 12 deletions
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Jesse Buhagiar <jooster669@gmail.com>
|
||||
* Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org>
|
||||
* Copyright (c) 2022, Jelle Raaijmakers <jelle@gmta.nl>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -1931,20 +1932,10 @@ void SoftwareGLContext::get_floating_point(GLenum pname, T* params)
|
|||
};
|
||||
switch (pname) {
|
||||
case GL_MODELVIEW_MATRIX:
|
||||
if (m_current_matrix_mode == GL_MODELVIEW)
|
||||
flatten_and_assign_matrix(m_model_view_matrix);
|
||||
else if (m_model_view_matrix_stack.is_empty())
|
||||
flatten_and_assign_matrix(FloatMatrix4x4::identity());
|
||||
else
|
||||
flatten_and_assign_matrix(m_model_view_matrix_stack.last());
|
||||
flatten_and_assign_matrix(m_model_view_matrix);
|
||||
return;
|
||||
case GL_PROJECTION_MATRIX:
|
||||
if (m_current_matrix_mode == GL_PROJECTION)
|
||||
flatten_and_assign_matrix(m_projection_matrix);
|
||||
else if (m_projection_matrix_stack.is_empty())
|
||||
flatten_and_assign_matrix(FloatMatrix4x4::identity());
|
||||
else
|
||||
flatten_and_assign_matrix(m_projection_matrix_stack.last());
|
||||
flatten_and_assign_matrix(m_projection_matrix);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue