summaryrefslogtreecommitdiff
path: root/src/drm
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-04-25 09:42:13 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-04-25 09:45:41 +0100
commit4d3632761b928c14fb1ce257af077f45658d8537 (patch)
treeb39077750611dbc0d0344cb1dd9b5a25031f7ece /src/drm
parent241ce933f8fa44210015dcdc4a66b3f9d8ac56e8 (diff)
clip: Report the surface offset when retrieving the clip mask
Stop the callers from guessing the origin of the clip surface by reporting it explicitly! This enables the clip to bypass any rectangles overlaid on top of the clip surface, which is common when the backends limit the clip to the extents of the operation -- but irrelevant to the actual content of the clip mask
Diffstat (limited to 'src/drm')
-rw-r--r--src/drm/cairo-drm-i915-shader.c9
-rw-r--r--src/drm/cairo-drm-i965-shader.c7
2 files changed, 8 insertions, 8 deletions
diff --git a/src/drm/cairo-drm-i915-shader.c b/src/drm/cairo-drm-i915-shader.c
index 13f9d85a..a56513d1 100644
--- a/src/drm/cairo-drm-i915-shader.c
+++ b/src/drm/cairo-drm-i915-shader.c
@@ -2403,11 +2403,11 @@ i915_shader_set_clip (i915_shader_t *shader,
cairo_clip_t *clip)
{
cairo_surface_t *clip_surface;
- const cairo_rectangle_int_t *clip_extents;
+ int clip_x, clip_y;
union i915_shader_channel *channel;
i915_surface_t *s;
- clip_surface = _cairo_clip_get_surface (clip, &shader->target->intel.drm.base);
+ clip_surface = _cairo_clip_get_surface (clip, &shader->target->intel.drm.base, &clip_x, &clip_y);
assert (clip_surface->status == CAIRO_STATUS_SUCCESS);
assert (clip_surface->type == CAIRO_SURFACE_TYPE_DRM);
@@ -2434,13 +2434,12 @@ i915_shader_set_clip (i915_shader_t *shader,
SS3_NORMALIZED_COORDS |
i915_texture_extend (CAIRO_EXTEND_NONE);
- clip_extents = _cairo_clip_get_extents (clip);
cairo_matrix_init_scale (&shader->clip.base.matrix,
1. / s->intel.drm.width,
1. / s->intel.drm.height);
cairo_matrix_translate (&shader->clip.base.matrix,
- NEAREST_BIAS - clip_extents->x,
- NEAREST_BIAS - clip_extents->y);
+ NEAREST_BIAS - clip_x,
+ NEAREST_BIAS - clip_y);
}
static cairo_status_t
diff --git a/src/drm/cairo-drm-i965-shader.c b/src/drm/cairo-drm-i965-shader.c
index fcfec295..f18494ce 100644
--- a/src/drm/cairo-drm-i965-shader.c
+++ b/src/drm/cairo-drm-i965-shader.c
@@ -762,10 +762,11 @@ i965_shader_set_clip (i965_shader_t *shader,
cairo_clip_t *clip)
{
cairo_surface_t *clip_surface;
+ int clip_x, clip_y;
union i965_shader_channel *channel;
i965_surface_t *s;
- clip_surface = _cairo_clip_get_surface (clip, &shader->target->intel.drm.base);
+ clip_surface = _cairo_clip_get_surface (clip, &shader->target->intel.drm.base, &clip_x, &clip_y);
assert (clip_surface->status == CAIRO_STATUS_SUCCESS);
assert (clip_surface->type == CAIRO_SURFACE_TYPE_DRM);
s = (i965_surface_t *) clip_surface;
@@ -793,8 +794,8 @@ i965_shader_set_clip (i965_shader_t *shader,
1. / s->intel.drm.height);
cairo_matrix_translate (&shader->clip.base.matrix,
- NEAREST_BIAS - clip->path->extents.x,
- NEAREST_BIAS - clip->path->extents.y);
+ NEAREST_BIAS - clip_x,
+ NEAREST_BIAS - clip_y);
}
static cairo_bool_t