third_party/cairo/src/cairo-gl-device.c
static void
_gl_identity_ortho (GLfloat *m,
		    GLfloat left, GLfloat right,
		    GLfloat bottom, GLfloat top)
{
#define M(row,col)  m[col*4+row]
    M(0,0) = 2.f / (right - left);
    M(0,1) = 0.f;
    M(0,2) = 0.f;
    M(0,3) = -(right + left) / (right - left);

    M(1,0) = 0.f;
    M(1,1) = 2.f / (top - bottom);
    M(1,2) = 0.f;
    M(1,3) = -(top + bottom) / (top - bottom);

    M(2,0) = 0.f;
    M(2,1) = 0.f;
    M(2,2) = -1.f;
    M(2,3) = 0.f;

    M(3,0) = 0.f;
    M(3,1) = 0.f;
    M(3,2) = 0.f;
    M(3,3) = 1.f;
#undef M
}
/*
 * Stores a parallel projection transformation in matrix 'm',
 * using column-major order.
 *
 * This is equivalent to:
 *
 * glLoadIdentity()
 * gluOrtho2D()
 *
 * The calculation for the ortho transformation was taken from the
 * mesa source code.
 */
Stores a parallel projection transformation in matrix 'm',
using column-major order.

This is equivalent to.



The calculation for the ortho transformation was taken from the
mesa source code.
Stores a parallel projection transformation in matrix ' m ' using column - major order . This is equivalent to . The calculation for the ortho transformation was taken from the mesa source code .
static void
_gl_identity_ortho (GLfloat *m,
		    GLfloat left, GLfloat right,
		    GLfloat bottom, GLfloat top)
{
#define M(row,col)  m[col*4+row]
    M(0,0) = 2.f / (right - left);
    M(0,1) = 0.f;
    M(0,2) = 0.f;
    M(0,3) = -(right + left) / (right - left);
    M(1,0) = 0.f;
    M(1,1) = 2.f / (top - bottom);
    M(1,2) = 0.f;
    M(1,3) = -(top + bottom) / (top - bottom);
    M(2,0) = 0.f;
    M(2,1) = 0.f;
    M(2,2) = -1.f;
    M(2,3) = 0.f;
    M(3,0) = 0.f;
    M(3,1) = 0.f;
    M(3,2) = 0.f;
    M(3,3) = 1.f;
#undef M
}
static void _gl_identity_ortho ( GLfloat * m , GLfloat left , GLfloat right , GLfloat bottom , GLfloat top ) { #define M ( row , col )   m[col*4+row] M ( 0 , 0 ) = 2.f / ( right - left ) ; M ( 0 , 1 ) = 0.f ; M ( 0 , 2 ) = 0.f ; M ( 0 , 3 ) = - ( right + left ) / ( right - left ) ; M ( 1 , 0 ) = 0.f ; M ( 1 , 1 ) = 2.f / ( top - bottom ) ; M ( 1 , 2 ) = 0.f ; M ( 1 , 3 ) = - ( top + bottom ) / ( top - bottom ) ; M ( 2 , 0 ) = 0.f ; M ( 2 , 1 ) = 0.f ; M ( 2 , 2 ) = -1.f ; M ( 2 , 3 ) = 0.f ; M ( 3 , 0 ) = 0.f ; M ( 3 , 1 ) = 0.f ; M ( 3 , 2 ) = 0.f ; M ( 3 , 3 ) = 1.f ; #undef  M }
Stores a parallel projection transformation in matrix 'm',
 using column-major order.
Stores a parallel projection transformation in matrix ' m ' using column - major order .