X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Fcontrolflow%2Fdrawitem.c;h=d97628b021f3b9abed37236c0693a612328662b5;hb=2dd5f7c525c94774d24360dc8f7dbbc015127568;hp=a3085a8aa1824040f13a26c45bf058ac9d072358;hpb=6550d71135aed5d81a76d7d5625757570bcf0819;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/drawitem.c b/ltt/branches/poly/lttv/modules/gui/controlflow/drawitem.c index a3085a8a..d97628b0 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/drawitem.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/drawitem.c @@ -94,6 +94,10 @@ * Author : Mathieu Desnoyers, October 2003 */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -104,7 +108,9 @@ #include #include +#include +#include "drawing.h" #include "drawitem.h" @@ -118,9 +124,7 @@ gboolean draw_text( void *hook_data, void *call_data) PangoContext *context; PangoLayout *layout; - PangoAttribute *attribute; PangoFontDescription *font_desc;// = pango_font_description_new(); - gint font_size; PangoRectangle ink_rect; layout = draw_context->pango_layout; @@ -160,7 +164,7 @@ gboolean draw_text( void *hook_data, void *call_data) break; } /* verify if there is enough space to draw */ - if(x + width <= draw_context->drawinfo.end.x) { + if(unlikely(x + width <= draw_context->drawinfo.end.x)) { enough_space = TRUE; *offset += width; } @@ -185,14 +189,14 @@ gboolean draw_text( void *hook_data, void *call_data) break; } /* verify if there is enough space to draw */ - if(x - width >= draw_context->drawinfo.start.x) { + if(unlikely(x - width >= draw_context->drawinfo.start.x)) { enough_space = TRUE; *offset -= width; } break; } - if(enough_space) + if(unlikely(enough_space)) gdk_draw_layout_with_colors(draw_context->drawable, draw_context->gc, x, @@ -220,7 +224,7 @@ gboolean draw_icon( void *hook_data, void *call_data) g_assert(lttv_iattribute_find_by_path(attributes, icon_name, LTTV_POINTER, &value)); - if(*(value.v_pointer) == NULL) + if(unlikely(*(value.v_pointer) == NULL)) { *(value.v_pointer) = icon_info = g_new(IconStruct,1); @@ -258,7 +262,7 @@ gboolean draw_icon( void *hook_data, void *call_data) break; } /* verify if there is enough space to draw */ - if(x + width <= draw_context->drawinfo.end.x) { + if(unlikely(x + width <= draw_context->drawinfo.end.x)) { enough_space = TRUE; *offset += width; } @@ -283,14 +287,14 @@ gboolean draw_icon( void *hook_data, void *call_data) break; } /* verify if there is enough space to draw */ - if(x - width >= draw_context->drawinfo.start.x) { + if(unlikely(x - width >= draw_context->drawinfo.start.x)) { enough_space = TRUE; *offset -= width; } break; } - if(enough_space) { + if(unlikely(enough_space)) { gdk_gc_set_clip_mask(draw_context->gc, icon_info->mask); gdk_gc_set_clip_origin( @@ -391,7 +395,7 @@ gboolean draw_arc( void *hook_data, void *call_data) break; } /* verify if there is enough space to draw */ - if(x + width <= draw_context->drawinfo.end.x) { + if(unlikely(x + width <= draw_context->drawinfo.end.x)) { enough_space = TRUE; *offset += width; } @@ -416,14 +420,14 @@ gboolean draw_arc( void *hook_data, void *call_data) break; } /* verify if there is enough space to draw */ - if(x - width >= draw_context->drawinfo.start.x) { + if(unlikely(x - width >= draw_context->drawinfo.start.x)) { enough_space = TRUE; *offset -= width; } break; } - if(enough_space) + if(unlikely(enough_space)) gdk_draw_arc(draw_context->drawable, draw_context->gc, properties->filled, x,