w = softpipe->framebuffer.cbufs[0]->width;
h = softpipe->framebuffer.cbufs[0]->height;
+ assert(w <= ps->region->pitch);
+ assert(h <= ps->region->height);
+
pipe->region_fill(pipe, ps->region, 0, x, y, w, h, clearValue);
}
#include "sp_context.h"
#include "sp_region.h"
+#include "pipe/p_util.h"
#include "pipe/p_winsys.h"
#include "pipe/p_defines.h"
unsigned cpp, unsigned width, unsigned height, unsigned flags)
{
struct softpipe_context *sp = softpipe_context( pipe );
- struct pipe_region *region = calloc(sizeof(*region), 1);
+ struct pipe_region *region = CALLOC_STRUCT(pipe_region);
const unsigned alignment = 64;
region->cpp = cpp;
region->height = height;
region->refcount = 1;
+ assert(region->pitch > 0);
+
region->buffer = sp->pipe.winsys->buffer_create( sp->pipe.winsys, alignment );
/* NULL data --> just allocate the space */
{
unsigned i, j;
+ assert(dst->pitch > 0);
+ assert(width <= dst->pitch);
+
(void)pipe->region_map(pipe, dst);
switch (dst->cpp) {