19e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt/**************************************************************************
29e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt *
39e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
49e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt * All Rights Reserved.
59e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt *
69e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt * Permission is hereby granted, free of charge, to any person obtaining a
79e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt * copy of this software and associated documentation files (the
89e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt * "Software"), to deal in the Software without restriction, including
99e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt * without limitation the rights to use, copy, modify, merge, publish,
109e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt * distribute, sub license, and/or sell copies of the Software, and to
119e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt * permit persons to whom the Software is furnished to do so, subject to
129e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt * the following conditions:
139e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt *
149e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt * The above copyright notice and this permission notice (including the
159e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt * next paragraph) shall be included in all copies or substantial portionsalloc
169e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt * of the Software.
179e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt *
189e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
199e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
209e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
219e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
229e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
239e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
249e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
259e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt *
269e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt **************************************************************************/
279e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt
28ecadb51bbcb972a79f3ed79e65a7986b9396e757Brian Paul#include "main/glheader.h"
29ecadb51bbcb972a79f3ed79e65a7986b9396e757Brian Paul#include "main/enums.h"
30ecadb51bbcb972a79f3ed79e65a7986b9396e757Brian Paul#include "main/image.h"
31ecadb51bbcb972a79f3ed79e65a7986b9396e757Brian Paul#include "main/mtypes.h"
32f85ea6837da434cdec011de431e62db20ee39df2Eric Anholt#include "main/teximage.h"
33f85ea6837da434cdec011de431e62db20ee39df2Eric Anholt#include "main/texobj.h"
34f85ea6837da434cdec011de431e62db20ee39df2Eric Anholt#include "main/texstate.h"
359e6ae75cc8d6bff139aa21bda0aa682755ab7a7cBrian Paul#include "swrast/swrast.h"
36886a0a715076213266b4f96118d15de5be2bff27Brian Paul#include "drivers/common/meta.h"
379e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt
389e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt#include "intel_context.h"
399e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt#include "intel_pixel.h"
409e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt
419e68e191ac9d32f2f93e840a66127e724b442756Eric Anholtvoid
42f9995b30756140724f41daf963fa06167912be7fKristian HøgsbergintelDrawPixels(struct gl_context * ctx,
439e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt                GLint x, GLint y,
449e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt                GLsizei width, GLsizei height,
459e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt                GLenum format,
469e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt                GLenum type,
479e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt                const struct gl_pixelstore_attrib *unpack,
489e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt                const GLvoid * pixels)
499e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt{
509e6ae75cc8d6bff139aa21bda0aa682755ab7a7cBrian Paul   if (format == GL_STENCIL_INDEX) {
519e6ae75cc8d6bff139aa21bda0aa682755ab7a7cBrian Paul      _swrast_DrawPixels(ctx, x, y, width, height, format, type,
529e6ae75cc8d6bff139aa21bda0aa682755ab7a7cBrian Paul                         unpack, pixels);
539e6ae75cc8d6bff139aa21bda0aa682755ab7a7cBrian Paul      return;
549e6ae75cc8d6bff139aa21bda0aa682755ab7a7cBrian Paul   }
555c39bad220c801490ac3d99af01d4c4a7e05dfd6Eric Anholt
564de8e2123ebeb50db252b2bb57fb167058fa4683Brian Paul   _mesa_meta_DrawPixels(ctx, x, y, width, height, format, type,
574de8e2123ebeb50db252b2bb57fb167058fa4683Brian Paul                         unpack, pixels);
589e68e191ac9d32f2f93e840a66127e724b442756Eric Anholt}
59