#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
#include "sp_context.h"
-#include "sp_state.h"
#include "sp_surface.h"
#include "sp_texture.h"
-#include "sp_tile_cache.h"
+
/**
* Softpipe surface functions.
-#if 0
-#define CLIP_TILE \
- do { \
- assert(x + w <= ps->width); \
- assert(y + h <= ps->height); \
- } while(0)
-
-#else
#define CLIP_TILE \
do { \
if (x >= ps->width) \
if (x + w > ps->width) \
w = ps->width - x; \
if (y + h > ps->height) \
- h = ps->height -y; \
+ h = ps->height - y; \
} while(0)
-#endif
/*** PIPE_FORMAT_A8R8G8B8_UNORM ***/
{
const uint cpp = ps->cpp;
const ubyte *pSrc;
+ const uint src_stride = ps->pitch * cpp;
ubyte *pDest;
uint i;
for (i = 0; i < h; i++) {
memcpy(pDest, pSrc, w * cpp);
pDest += dst_stride;
- pSrc += ps->pitch * cpp;
+ pSrc += src_stride;
}
}
{
const uint cpp = ps->cpp;
const ubyte *pSrc;
+ const uint dst_stride = ps->pitch * cpp;
ubyte *pDest;
uint i;
for (i = 0; i < h; i++) {
memcpy(pDest, pSrc, w * cpp);
- pDest += ps->pitch * cpp;
+ pDest += dst_stride;
pSrc += src_stride;
}
}