From 4d3632761b928c14fb1ce257af077f45658d8537 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 25 Apr 2010 09:42:13 +0100 Subject: 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 --- src/drm/cairo-drm-i915-shader.c | 9 ++++----- src/drm/cairo-drm-i965-shader.c | 7 ++++--- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/drm') 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 -- cgit v1.2.3