void
intelDrawPixels(struct gl_context * ctx,
                GLint x, GLint y,
                GLsizei width, GLsizei height,
                GLenum format,
                GLenum type,
                const struct gl_pixelstore_attrib *unpack,
                const GLvoid * pixels)
{
   struct brw_context *brw = brw_context(ctx);

   if (!_mesa_check_conditional_render(ctx))
      return;

   if (format == GL_STENCIL_INDEX) {
      _swrast_DrawPixels(ctx, x, y, width, height, format, type,
                         unpack, pixels);
      return;
   }

   if (_mesa_is_bufferobj(unpack->BufferObj)) {
      if (do_blit_drawpixels(ctx, x, y, width, height, format, type, unpack,
			     pixels)) {
	 return;
      }

      perf_debug("%s: fallback to generic code in PBO case\n", __FUNCTION__);
   }

   _mesa_meta_DrawPixels(ctx, x, y, width, height, format, type,
                         unpack, pixels);
}
예제 #2
0
파일: mgapixel.c 프로젝트: dikerex/theqvd
static void
mgaDDDrawPixels( GLcontext *ctx,
		 GLint x, GLint y, GLsizei width, GLsizei height,
		 GLenum format, GLenum type,
		 const struct gl_pixelstore_attrib *unpack,
		 const GLvoid *pixels )
{
   if (!mgaTryDrawPixels( ctx, x, y, width, height, format, type,
			  unpack, pixels ))
      _swrast_DrawPixels( ctx, x, y, width, height, format, type,
			  unpack, pixels );
}
예제 #3
0
static void
intelDrawPixels( GLcontext *ctx,
		 GLint x, GLint y, GLsizei width, GLsizei height,
		 GLenum format, GLenum type,
		 const struct gl_pixelstore_attrib *unpack,
		 const GLvoid *pixels )
{
   if (INTEL_DEBUG & DEBUG_PIXEL)
      fprintf(stderr, "%s\n", __FUNCTION__);

   if (intelTryDrawPixels( ctx, x, y, width, height, format, type,
                           unpack, pixels ))
      return;

   if (ctx->FragmentProgram._Current == ctx->FragmentProgram._TexEnvProgram) {
      /*
       * We don't want the i915 texenv program to be applied to DrawPixels.
       * This is really just a performance optimization (mesa will other-
       * wise happily run the fragment program on each pixel in the image).
       */
      struct gl_fragment_program *fpSave = ctx->FragmentProgram._Current;
   /* can't just set current frag prog to 0 here as on buffer resize
      we'll get new state checks which will segfault. Remains a hack. */
      ctx->FragmentProgram._Current = NULL;
      ctx->FragmentProgram._UseTexEnvProgram = GL_FALSE;
      ctx->FragmentProgram._Active = GL_FALSE;
      _swrast_DrawPixels( ctx, x, y, width, height, format, type,
                          unpack, pixels );
      ctx->FragmentProgram._Current = fpSave;
      ctx->FragmentProgram._UseTexEnvProgram = GL_TRUE;
      ctx->FragmentProgram._Active = GL_TRUE;
   }
   else {
      _swrast_DrawPixels( ctx, x, y, width, height, format, type,
                          unpack, pixels );
   }
}
예제 #4
0
static void
r200DrawPixels( GLcontext *ctx,
                GLint x, GLint y, GLsizei width, GLsizei height,
                GLenum format, GLenum type,
                const struct gl_pixelstore_attrib *unpack,
                const GLvoid *pixels )
{
    if (R200_DEBUG & DEBUG_PIXEL)
        fprintf(stderr, "%s\n", __FUNCTION__);

    if (!r200TryDrawPixels( ctx, x, y, width, height, format, type,
                            unpack, pixels ))
        _swrast_DrawPixels( ctx, x, y, width, height, format, type,
                            unpack, pixels );
}
예제 #5
0
void
intelDrawPixels(GLcontext * ctx,
                GLint x, GLint y,
                GLsizei width, GLsizei height,
                GLenum format,
                GLenum type,
                const struct gl_pixelstore_attrib *unpack,
                const GLvoid * pixels)
{
   if (do_blit_drawpixels(ctx, x, y, width, height, format, type,
                          unpack, pixels))
      return;

   if (do_texture_drawpixels(ctx, x, y, width, height, format, type,
                             unpack, pixels))
      return;


   if (INTEL_DEBUG & DEBUG_PIXEL)
      _mesa_printf("%s: fallback to swrast\n", __FUNCTION__);

   _swrast_DrawPixels(ctx, x, y, width, height, format, type, unpack, pixels);
}