ReactOS  0.4.14-dev-606-g14ebc0b
drawpix.h File Reference
#include "types.h"
Include dependency graph for drawpix.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void gl_DrawPixels (GLcontext *ctx, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
 

Function Documentation

◆ gl_DrawPixels()

void gl_DrawPixels ( GLcontext ctx,
GLsizei  width,
GLsizei  height,
GLenum  format,
GLenum  type,
const GLvoid pixels 
)

Definition at line 1145 of file drawpix.c.

1147 {
1148  GLvoid *image;
1149 
1150  if (width<0 || height<0) {
1151  gl_error( ctx, GL_INVALID_VALUE, "glDrawPixels" );
1152  return;
1153  }
1154 
1155  if (ctx->NewState) {
1156  gl_update_state(ctx);
1157  }
1158 
1159  /* Let the device driver take a crack at glDrawPixels */
1160  if (!ctx->CompileFlag && ctx->Driver.DrawPixels) {
1161  GLint x = (GLint) (ctx->Current.RasterPos[0] + 0.5F);
1162  GLint y = (GLint) (ctx->Current.RasterPos[1] + 0.5F);
1163  if ((*ctx->Driver.DrawPixels)( ctx, x, y, width, height,
1164  format, type, GL_FALSE, pixels )) {
1165  /* Device driver did the job */
1166  return;
1167  }
1168  }
1169 
1171  && !ctx->CompileFlag && ctx->RenderMode==GL_RENDER
1172  && ctx->RasterMask==0 && ctx->CallDepth==0) {
1173  /* optimized path */
1174  if (quickdraw_rgb( ctx, width, height, pixels )) {
1175  /* success */
1176  return;
1177  }
1178  }
1179 
1180  /* take the general path */
1181 
1182  /* THIS IS A REAL HACK - FIX IN MESA 2.5
1183  * If we're inside glCallList then we don't have to unpack the pixels again.
1184  */
1185  if (ctx->CallDepth == 0) {
1187  if (!image) {
1188  gl_error( ctx, GL_OUT_OF_MEMORY, "glDrawPixels" );
1189  return;
1190  }
1191  }
1192  else {
1193  image = (GLvoid *) pixels;
1194  }
1195 
1196  if (ctx->CompileFlag) {
1198  }
1199  if (ctx->ExecuteFlag) {
1200  drawpixels( ctx, width, height, format, type, image );
1201  if (!ctx->CompileFlag) {
1202  /* may discard unpacked image now */
1203  if (image!=pixels)
1204  free( image );
1205  }
1206  }
1207 }
GLeglImageOES image
Definition: gl.h:2204
GLuint CallDepth
Definition: types.h:1305
GLint GLint GLsizei width
Definition: gl.h:1546
GLboolean ExecuteFlag
Definition: types.h:1306
GLuint NewState
Definition: types.h:1355
#define GL_FALSE
Definition: gl.h:173
#define free
Definition: debug_ros.c:5
#define GL_UNSIGNED_BYTE
Definition: gl.h:178
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
struct gl_current_attrib Current
Definition: types.h:1320
GLboolean FastDrawPixels
Definition: types.h:1368
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
GLuint RasterMask
Definition: types.h:1361
struct dd_function_table Driver
Definition: types.h:1276
void gl_save_DrawPixels(GLcontext *ctx, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
Definition: dlist.c:1249
GLenum RenderMode
Definition: types.h:1356
#define GL_RGB
Definition: gl.h:502
#define GL_INVALID_VALUE
Definition: gl.h:695
GLboolean CompileFlag
Definition: types.h:1307
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
void gl_error(GLcontext *ctx, GLenum error, const char *s)
Definition: context.c:1421
static GLboolean quickdraw_rgb(GLcontext *ctx, GLsizei width, GLsizei height, const void *pixels)
Definition: drawpix.c:1014
void gl_update_state(GLcontext *ctx)
Definition: context.c:1749
GLvoid * gl_unpack_pixels(GLcontext *ctx, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
Definition: pixel.c:880
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
Definition: gl.h:1546
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define GL_OUT_OF_MEMORY
Definition: gl.h:699
int GLint
Definition: gl.h:156
#define GL_RENDER
Definition: gl.h:388
static void drawpixels(GLcontext *ctx, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
Definition: drawpix.c:1075

Referenced by execute_list(), init_dlist_pointers(), and init_exec_pointers().