const float *src_matrix = NULL;
const float *mask_matrix = NULL;
+ xa_scissor_update(ctx, dstX, dstY, dstX + width, dstY + height);
+
if (comp->src->has_transform)
src_matrix = comp->src->transform;
if (comp->mask && comp->mask->has_transform)
{
struct pipe_box src_box;
+ xa_scissor_update(ctx, dx, dy, dx + width, dy + height);
+
if (ctx->simple_copy) {
u_box_2d(sx, sy, width, height, &src_box);
ctx->pipe->resource_copy_region(ctx->pipe,
XA_EXPORT void
xa_solid(struct xa_context *ctx, int x, int y, int width, int height)
{
+ xa_scissor_update(ctx, x, y, x + width, y + height);
renderer_solid(ctx, x, y, x + width, y + height, ctx->solid_color);
}
#include "pipe/p_context.h"
#include "pipe/p_state.h"
+#include "util/u_math.h"
+
#if defined(__GNUC__) && __GNUC__ >= 4
#define XA_EXPORT __attribute__ ((visibility("default")))
#else
struct xa_surface *dst;
struct pipe_surface *srf;
+ /* destination scissor state.. we scissor out untouched parts
+ * of the dst for the benefit of tilers:
+ */
+ struct pipe_scissor_state scissor;
+ int scissor_valid;
+
int simple_copy;
int has_solid_color;
const struct xa_composite *comp;
};
+static INLINE void
+xa_scissor_reset(struct xa_context *ctx)
+{
+ ctx->scissor.maxx = 0;
+ ctx->scissor.maxy = 0;
+ ctx->scissor.minx = ~0;
+ ctx->scissor.miny = ~0;
+ ctx->scissor_valid = FALSE;
+}
+
+static INLINE void
+xa_scissor_update(struct xa_context *ctx, unsigned minx, unsigned miny,
+ unsigned maxx, unsigned maxy)
+{
+ ctx->scissor.maxx = MAX2(ctx->scissor.maxx, maxx);
+ ctx->scissor.maxy = MAX2(ctx->scissor.maxy, maxy);
+ ctx->scissor.minx = MIN2(ctx->scissor.minx, minx);
+ ctx->scissor.miny = MIN2(ctx->scissor.miny, miny);
+ ctx->scissor_valid = TRUE;
+}
+
enum xa_vs_traits {
VS_COMPOSITE = 1 << 0,
VS_MASK = 1 << 1,
if (!r->buffer_size)
return;
+ if (!r->scissor_valid) {
+ r->scissor.minx = 0;
+ r->scissor.miny = 0;
+ r->scissor.maxx = r->dst->tex->width0;
+ r->scissor.maxy = r->dst->tex->height0;
+ }
+
+ r->pipe->set_scissor_states(r->pipe, 0, 1, &r->scissor);
+
cso_set_vertex_elements(r->cso, r->attrs_per_vertex, r->velems);
util_draw_user_vertex_buffer(r->cso, r->buffer, PIPE_PRIM_QUADS,
num_verts, /* verts */
r->attrs_per_vertex); /* attribs/vert */
r->buffer_size = 0;
+
+ xa_scissor_reset(r);
}
static INLINE void
raster.half_pixel_center = 1;
raster.bottom_edge_rule = 1;
raster.depth_clip = 1;
+ raster.scissor = 1;
cso_set_rasterizer(r->cso, &raster);
/* vertex elements state */
struct pipe_framebuffer_state fb;
struct pipe_viewport_state viewport;
+ xa_scissor_reset(r);
+
/* Framebuffer uses actual surface width/height
*/
memset(&fb, 0, sizeof fb);