[cairo-commit] 2 commits - boilerplate/cairo-boilerplate.c boilerplate/cairo-boilerplate-drm.c boilerplate/cairo-boilerplate-xlib.c src/cairo-xcb-surface-render.c
Bryce Harrington
bryce at kemper.freedesktop.org
Tue May 6 10:24:01 PDT 2014
boilerplate/cairo-boilerplate-drm.c | 12 +++++--
boilerplate/cairo-boilerplate-xlib.c | 12 +++++--
boilerplate/cairo-boilerplate.c | 53 ++++++++++++++++++++++++-----------
src/cairo-xcb-surface-render.c | 3 +
4 files changed, 58 insertions(+), 22 deletions(-)
New commits:
commit 55608e4fd6947f26789557ffc757affc509b141b
Author: Ravi Nanjundappa <nravi.n at samsung.com>
Date: Mon May 5 12:34:21 2014 +0530
boilerplate: Maintain consistency in the usage of switch cases
Some of the switch cases used in boilerplate are not consistent
across other source files in the same module. This patch fixes the
consistency issues of switch case usage in the boilerplate module.
Signed-off-by: Ravi Nanjundappa <nravi.n at samsung.com>
Reviewed-by: Uli Schlachter <psychon at znc.in>
diff --git a/boilerplate/cairo-boilerplate-drm.c b/boilerplate/cairo-boilerplate-drm.c
index 214ce50..79d9229 100644
--- a/boilerplate/cairo-boilerplate-drm.c
+++ b/boilerplate/cairo-boilerplate-drm.c
@@ -52,10 +52,16 @@ _cairo_boilerplate_drm_create_surface (const char *name,
return NULL; /* skip tests if no supported h/w found */
switch (content) {
- case CAIRO_CONTENT_ALPHA: format = CAIRO_FORMAT_A8; break;
- case CAIRO_CONTENT_COLOR: format = CAIRO_FORMAT_RGB24; break;
+ case CAIRO_CONTENT_ALPHA:
+ format = CAIRO_FORMAT_A8;
+ break;
+ case CAIRO_CONTENT_COLOR:
+ format = CAIRO_FORMAT_RGB24;
+ break;
+ case CAIRO_CONTENT_COLOR_ALPHA:
default:
- case CAIRO_CONTENT_COLOR_ALPHA: format = CAIRO_FORMAT_ARGB32; break;
+ format = CAIRO_FORMAT_ARGB32;
+ break;
}
return *closure = cairo_drm_surface_create (device, format, width, height);
diff --git a/boilerplate/cairo-boilerplate-xlib.c b/boilerplate/cairo-boilerplate-xlib.c
index aed075f..f3d5598 100644
--- a/boilerplate/cairo-boilerplate-xlib.c
+++ b/boilerplate/cairo-boilerplate-xlib.c
@@ -248,10 +248,16 @@ _cairo_boilerplate_xlib_create_similar (cairo_surface_t *other,
similar->dpy = cairo_xlib_surface_get_display (other);
switch (content) {
+ case CAIRO_CONTENT_COLOR:
+ format = PictStandardRGB24;
+ break;
+ case CAIRO_CONTENT_ALPHA:
+ format = PictStandardA8;
+ break;
+ case CAIRO_CONTENT_COLOR_ALPHA:
default:
- case CAIRO_CONTENT_COLOR_ALPHA: format = PictStandardARGB32; break;
- case CAIRO_CONTENT_COLOR: format = PictStandardRGB24; break;
- case CAIRO_CONTENT_ALPHA: format = PictStandardA8; break;
+ format = PictStandardARGB32;
+ break;
}
xrender_format = XRenderFindStandardFormat (similar->dpy, format);
diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c
index 674c8d0..97d624c 100644
--- a/boilerplate/cairo-boilerplate.c
+++ b/boilerplate/cairo-boilerplate.c
@@ -112,13 +112,19 @@ cairo_boilerplate_format_from_content (cairo_content_t content)
cairo_format_t format;
switch (content) {
- case CAIRO_CONTENT_COLOR: format = CAIRO_FORMAT_RGB24; break;
- case CAIRO_CONTENT_COLOR_ALPHA: format = CAIRO_FORMAT_ARGB32; break;
- case CAIRO_CONTENT_ALPHA: format = CAIRO_FORMAT_A8; break;
- default:
- assert (0); /* not reached */
- format = CAIRO_FORMAT_INVALID;
- break;
+ case CAIRO_CONTENT_COLOR:
+ format = CAIRO_FORMAT_RGB24;
+ break;
+ case CAIRO_CONTENT_COLOR_ALPHA:
+ format = CAIRO_FORMAT_ARGB32;
+ break;
+ case CAIRO_CONTENT_ALPHA:
+ format = CAIRO_FORMAT_A8;
+ break;
+ default:
+ assert (0); /* not reached */
+ format = CAIRO_FORMAT_INVALID;
+ break;
}
return format;
@@ -163,10 +169,16 @@ _cairo_boilerplate_image_create_similar (cairo_surface_t *other,
void *ptr;
switch (content) {
- case CAIRO_CONTENT_ALPHA: format = CAIRO_FORMAT_A8; break;
- case CAIRO_CONTENT_COLOR: format = CAIRO_FORMAT_RGB24; break;
+ case CAIRO_CONTENT_ALPHA:
+ format = CAIRO_FORMAT_A8;
+ break;
+ case CAIRO_CONTENT_COLOR:
+ format = CAIRO_FORMAT_RGB24;
+ break;
+ case CAIRO_CONTENT_COLOR_ALPHA:
default:
- case CAIRO_CONTENT_COLOR_ALPHA: format = CAIRO_FORMAT_ARGB32; break;
+ format = CAIRO_FORMAT_ARGB32;
+ break;
}
stride = cairo_format_stride_for_width(format, width);
@@ -206,10 +218,16 @@ _cairo_boilerplate_image16_create_similar (cairo_surface_t *other,
void *ptr;
switch (content) {
- case CAIRO_CONTENT_ALPHA: format = CAIRO_FORMAT_A8; break;
- case CAIRO_CONTENT_COLOR: format = CAIRO_FORMAT_RGB16_565; break;
+ case CAIRO_CONTENT_ALPHA:
+ format = CAIRO_FORMAT_A8;
+ break;
+ case CAIRO_CONTENT_COLOR:
+ format = CAIRO_FORMAT_RGB16_565;
+ break;
+ case CAIRO_CONTENT_COLOR_ALPHA:
default:
- case CAIRO_CONTENT_COLOR_ALPHA: format = CAIRO_FORMAT_ARGB32; break;
+ format = CAIRO_FORMAT_ARGB32;
+ break;
}
stride = cairo_format_stride_for_width(format, width);
@@ -681,10 +699,13 @@ cairo_boilerplate_get_image_target (cairo_content_t content)
_cairo_boilerplate_register_all ();
switch (content) {
+ case CAIRO_CONTENT_COLOR:
+ return &builtin_targets[1];
+ case CAIRO_CONTENT_COLOR_ALPHA:
+ return &builtin_targets[0];
+ case CAIRO_CONTENT_ALPHA:
default:
- case CAIRO_CONTENT_ALPHA: return NULL;
- case CAIRO_CONTENT_COLOR: return &builtin_targets[1];
- case CAIRO_CONTENT_COLOR_ALPHA: return &builtin_targets[0];
+ return NULL;
}
}
commit 18b3cce2f5812c357e4b6310e72d72dd9ec92ed4
Author: Bryce Harrington <b.harrington at samsung.com>
Date: Tue May 6 10:18:19 2014 -0700
Fix segfault in firefox when scrolling on certain pages
Bug discovered by thorsten <fly_a320 at gmx.de>
Patch from Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/cairo-xcb-surface-render.c b/src/cairo-xcb-surface-render.c
index 9625953..75455e5 100644
--- a/src/cairo-xcb-surface-render.c
+++ b/src/cairo-xcb-surface-render.c
@@ -3121,6 +3121,9 @@ _clip_and_composite_boxes (cairo_xcb_surface_t *dst,
clip = _cairo_clip_copy (extents->clip);
clip = _cairo_clip_intersect_boxes (clip, boxes);
+ if (_cairo_clip_is_all_clipped (clip))
+ return CAIRO_INT_STATUS_NOTHING_TO_DO;
+
status = _cairo_clip_get_polygon (clip, &polygon,
&fill_rule, &antialias);
_cairo_clip_path_destroy (clip->path);
More information about the cairo-commit
mailing list