Remote changes at Mon Aug 7 15:37:14 EDT 2017 by chuan on vivaldi

This commit is contained in:
Chuan Chen 2017-08-07 15:37:14 -04:00
parent 31ac164be4
commit a90545be3f
1 changed files with 13 additions and 8 deletions

View File

@ -427,29 +427,34 @@ int llx, lly, width, height;
/* glEnable(GL_LINE_SMOOTH); */ /* glEnable(GL_LINE_SMOOTH); */
/* Force draw to front buffer (in case of double-buffered config) */ /* Force draw to front buffer (in case of double-buffered config) */
glDrawBuffer(GL_FRONT); //glDrawBuffer(GL_FRONT);
glMatrixMode(GL_PROJECTION); //glMatrixMode(GL_PROJECTION);
glLoadIdentity(); //glLoadIdentity();
cairo_identify_matrix(grCairoContext);
glViewport((GLsizei)llx, (GLsizei)lly, (GLsizei) width, (GLsizei) height); glViewport((GLsizei)llx, (GLsizei)lly, (GLsizei) width, (GLsizei) height);
// cairo equivalent??
/* scale to fit window */ /* scale to fit window */
#ifdef OGL_INVERT_Y #ifdef OGL_INVERT_Y
glScalef(1.0 / (float)(width >> 1), -1.0 / (float)(height >> 1), 1.0); //glScalef(1.0 / (float)(width >> 1), -1.0 / (float)(height >> 1), 1.0);
cairo_scale(grCairoContext, 1.0 / (float)(width >> 1), -1.0 / (float)(height >> 1));
#else #else
glScalef(1.0 / (float)(width >> 1), 1.0 / (float)(height >> 1), 1.0); //glScalef(1.0 / (float)(width >> 1), 1.0 / (float)(height >> 1), 1.0);
cairo_scale(grCairoContext, 1.0 / (float)(width >> 1), 1.0 / (float)(height >> 1));
#endif #endif
/* magic origin maps to window center; move to window origin */ /* magic origin maps to window center; move to window origin */
glTranslated(-(GLsizei)(width >> 1), -(GLsizei)(height >> 1), 0); //glTranslated(-(GLsizei)(width >> 1), -(GLsizei)(height >> 1), 0);
cairo_translate(grCairoContext, -(GLsizei)(width >> 1), -(GLsizei)(height >> 1));
/* Remaining transformations are done on the modelview matrix */ /* Remaining transformations are done on the modelview matrix */
glMatrixMode(GL_MODELVIEW); //glMatrixMode(GL_MODELVIEW);
glLoadIdentity(); //glLoadIdentity();
} }