ReactOS 0.4.15-dev-7918-g2a2556c
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) {
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
1170 if (format==GL_RGB && type==GL_UNSIGNED_BYTE && ctx->FastDrawPixels
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) {
1201 if (!ctx->CompileFlag) {
1202 /* may discard unpacked image now */
1203 if (image!=pixels)
1204 free( image );
1205 }
1206 }
1207}
#define free
Definition: debug_ros.c:5
void gl_save_DrawPixels(GLcontext *ctx, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
Definition: dlist.c:1249
void gl_error(GLcontext *ctx, GLenum error, const char *s)
Definition: context.c:1421
void gl_update_state(GLcontext *ctx)
Definition: context.c:1749
static void drawpixels(GLcontext *ctx, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
Definition: drawpix.c:1075
static GLboolean quickdraw_rgb(GLcontext *ctx, GLsizei width, GLsizei height, const void *pixels)
Definition: drawpix.c:1014
#define GL_RENDER
Definition: gl.h:388
#define GL_INVALID_VALUE
Definition: gl.h:695
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
Definition: gl.h:1546
GLeglImageOES image
Definition: gl.h:2204
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define GL_RGB
Definition: gl.h:502
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define GL_UNSIGNED_BYTE
Definition: gl.h:178
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define GL_FALSE
Definition: gl.h:173
int GLint
Definition: gl.h:156
#define GL_OUT_OF_MEMORY
Definition: gl.h:699
GLint GLint GLsizei width
Definition: gl.h:1546
GLvoid * gl_unpack_pixels(GLcontext *ctx, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
Definition: pixel.c:880

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