[cogl matrix stack] Create a client side matrix stack for the projection matrix

The cost of glGetFloatv with Mesa is still representing a majority of our
time in OpenGL for some applications, and the last thing left using this is
the current-matrix API when getting the projection matrix.

This adds a matrix stack for the projection matrix, so all getting, setting
and modification of the projection matrix is now managed by Cogl and it's only
when we come to draw that we flush changes to the matrix to OpenGL.

This also brings us closer to being able to drop internal use of the
deprecated OpenGL matrix functions, re: commit 54159f5a1d
This commit is contained in:
Robert Bragg
2009-07-03 00:34:10 +01:00
parent c3cc553c49
commit df4429462f
9 changed files with 85 additions and 59 deletions

View File

@ -1751,7 +1751,7 @@ cogl_vertex_buffer_draw (CoglHandle handle,
buffer = _cogl_vertex_buffer_pointer_from_handle (handle);
cogl_clip_ensure ();
_cogl_current_matrix_state_flush ();
_cogl_flush_matrix_stacks ();
enable_state_for_drawing_buffer (buffer);
/* FIXME: flush cogl cache */
@ -1888,7 +1888,7 @@ cogl_vertex_buffer_draw_elements (CoglHandle handle,
indices = _cogl_vertex_buffer_indices_pointer_from_handle (indices_handle);
cogl_clip_ensure ();
_cogl_current_matrix_state_flush ();
_cogl_flush_matrix_stacks ();
enable_state_for_drawing_buffer (buffer);
byte_offset = indices_offset * get_indices_type_size (indices->type);