[prev in list] [next in list] [prev in thread] [next in thread]
List: cairo-commit
Subject: [cairo-commit] util/cairo-trace
From: ickle () kemper ! freedesktop ! org (Chris Wilson)
Date: 2011-07-29 16:24:39
Message-ID: 20110729162439.42C88D8002 () kemper ! freedesktop ! org
[Download RAW message or body]
util/cairo-trace/trace.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
New commits:
commit b2ee7d9a21df56bf68851930448bc91f49a93e3d
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Fri Jul 29 17:14:42 2011 +0100
trace: Emit the content type for image surfaces
Currently we only emit the format, but if you want to later convert
the images to a normal surface for replay it is handy to have the
content.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c
index 9337a3b..d9e7704 100644
--- a/util/cairo-trace/trace.c
+++ b/util/cairo-trace/trace.c
@@ -1465,6 +1465,25 @@ _format_to_string (cairo_format_t format)
}
static const char *
+_format_to_content_string (cairo_format_t format)
+{
+ switch (format) {
+ case CAIRO_FORMAT_INVALID:
+ return "INVALID";
+ case CAIRO_FORMAT_ARGB32:
+ return "COLOR_ALPHA";
+ case CAIRO_FORMAT_RGB30:
+ case CAIRO_FORMAT_RGB24:
+ case CAIRO_FORMAT_RGB16_565:
+ return "COLOR";
+ case CAIRO_FORMAT_A8:
+ case CAIRO_FORMAT_A1:
+ return "ALPHA";
+ }
+ return "UNKNOWN";
+}
+
+static const char *
_status_to_string (cairo_status_t status)
{
#define f(name) case CAIRO_STATUS_ ## name: return "STATUS_" #name
@@ -3406,13 +3425,15 @@ cairo_image_surface_create (cairo_format_t format, int width, int height)
if (_write_lock ()) {
Object *obj = _create_surface (ret);
const char *format_str = _format_to_string (format);
+ const char *content_str = _format_to_content_string (format);
_trace_printf ("dict\n"
" /width %d set\n"
" /height %d set\n"
" /format //%s set\n"
+ " /content //%s set\n"
" image dup /s%ld exch def\n",
- width, height, format_str, obj->token);
+ width, height, format_str, content_str, obj->token);
obj->width = width;
obj->height = height;
obj->defined = TRUE;
_______________________________________________
cairo-commit mailing list
cairo-commit@lists.cairographics.org
http://lists.cairographics.org/mailman/listinfo/cairo-commit
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic