mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
Removed _swrast_clip_pixelrect(). Use _mesa_clip_drawpixels() instead.
This commit is contained in:
parent
4084e3c215
commit
c55c963f4c
3 changed files with 4 additions and 56 deletions
|
|
@ -31,6 +31,7 @@
|
|||
#include "drawpix.h"
|
||||
#include "extensions.h"
|
||||
#include "macros.h"
|
||||
#include "image.h"
|
||||
#include "imports.h"
|
||||
#include "mtypes.h"
|
||||
#include "state.h"
|
||||
|
|
@ -43,7 +44,6 @@
|
|||
#include "swrast/swrast.h"
|
||||
#include "swrast/s_auxbuffer.h"
|
||||
#include "swrast/s_context.h"
|
||||
#include "swrast/s_drawpix.h"
|
||||
#include "swrast/s_alphabuf.h"
|
||||
#include "swrast_setup/swrast_setup.h"
|
||||
#include "tnl/tnl.h"
|
||||
|
|
@ -865,7 +865,7 @@ xmesa_DrawPixels_8R8G8B( GLcontext *ctx,
|
|||
pixels = ADD_POINTERS(buf, pixels);
|
||||
}
|
||||
|
||||
if (_swrast_clip_pixelrect(ctx, &dstX, &dstY, &w, &h, &srcX, &srcY)) {
|
||||
if (_mesa_clip_drawpixels(ctx, &dstX, &dstY, &w, &h, &srcX, &srcY)) {
|
||||
/* This is a little tricky since all coordinates up to now have
|
||||
* been in the OpenGL bottom-to-top orientation. X is top-to-bottom
|
||||
* so we have to carefully compute the Y coordinates/addresses here.
|
||||
|
|
@ -968,7 +968,7 @@ xmesa_DrawPixels_5R6G5B( GLcontext *ctx,
|
|||
pixels = ADD_POINTERS(buf, pixels);
|
||||
}
|
||||
|
||||
if (_swrast_clip_pixelrect(ctx, &dstX, &dstY, &w, &h, &srcX, &srcY)) {
|
||||
if (_mesa_clip_drawpixels(ctx, &dstX, &dstY, &w, &h, &srcX, &srcY)) {
|
||||
/* This is a little tricky since all coordinates up to now have
|
||||
* been in the OpenGL bottom-to-top orientation. X is top-to-bottom
|
||||
* so we have to carefully compute the Y coordinates/addresses here.
|
||||
|
|
|
|||
|
|
@ -40,53 +40,6 @@
|
|||
#include "s_zoom.h"
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Given the dest position, size and skipPixels and skipRows values
|
||||
* for a glDrawPixels command, perform clipping of the image bounds
|
||||
* so the result lies withing the context's buffer bounds.
|
||||
* Return: GL_TRUE if image is ready for drawing
|
||||
* GL_FALSE if image was completely clipped away (draw nothing)
|
||||
*/
|
||||
GLboolean
|
||||
_swrast_clip_pixelrect(const GLcontext *ctx,
|
||||
GLint *destX, GLint *destY,
|
||||
GLsizei *width, GLsizei *height,
|
||||
GLint *skipPixels, GLint *skipRows)
|
||||
{
|
||||
const GLframebuffer *buffer = ctx->DrawBuffer;
|
||||
|
||||
/* left clipping */
|
||||
if (*destX < buffer->_Xmin) {
|
||||
*skipPixels += (buffer->_Xmin - *destX);
|
||||
*width -= (buffer->_Xmin - *destX);
|
||||
*destX = buffer->_Xmin;
|
||||
}
|
||||
/* right clipping */
|
||||
if (*destX + *width > buffer->_Xmax)
|
||||
*width -= (*destX + *width - buffer->_Xmax);
|
||||
|
||||
if (*width <= 0)
|
||||
return GL_FALSE;
|
||||
|
||||
/* bottom clipping */
|
||||
if (*destY < buffer->_Ymin) {
|
||||
*skipRows += (buffer->_Ymin - *destY);
|
||||
*height -= (buffer->_Ymin - *destY);
|
||||
*destY = buffer->_Ymin;
|
||||
}
|
||||
/* top clipping */
|
||||
if (*destY + *height > buffer->_Ymax)
|
||||
*height -= (*destY + *height - buffer->_Ymax);
|
||||
|
||||
if (*height <= 0)
|
||||
return GL_TRUE;
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Try to do a fast and simple RGB(a) glDrawPixels.
|
||||
* Return: GL_TRUE if success, GL_FALSE if slow path must be used instead
|
||||
|
|
|
|||
|
|
@ -31,11 +31,6 @@
|
|||
#include "mtypes.h"
|
||||
#include "swrast.h"
|
||||
|
||||
|
||||
extern GLboolean
|
||||
_swrast_clip_pixelrect(const GLcontext *ctx,
|
||||
GLint *destX, GLint *destY,
|
||||
GLsizei *width, GLsizei *height,
|
||||
GLint *skipPixels, GLint *skipRows);
|
||||
/* XXX kill this header? */
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue