[cairo] xtrace, part the second

Xan Lopez xan.lopez at gmail.com
Wed Dec 13 01:31:21 PST 2006


Hi guys,
let's compare xtrace outpus from xft and cairo again:

GTK+ 2.6

000:<:03c9: 16: Request(56): ChangeGC gc=0x0460000a
values={clip-mask=None(0x00000000)}
000:<:03ca: 20: Request(59): SetClipRectangles ordering=YXBanded(0x03)
gc=0x04600028 clip-x-origin=0 clip-y-origin=0 rectangles ={x=0 y=0
w=411 h=17};
000:<:03cb: 28: Request(62): CopyArea src-drawable=0x04600086
dst-drawable=0x04600004 gc=0x04600028 src-x=0 src-y=0 dst-x=0 dst-y=0
width=411 height=17
000:<:03cc: 16: Request(56): ChangeGC gc=0x04600028
values={clip-mask=None(0x00000000)}
000:<:03cd:  8: RENDERRequest(152): RenderFreePicture picture=0x04600087
000:<:03ce:  8: Request(54): FreePixmap drawable=0x04600086
000:<:03cf: 16: Request(53): CreatePixmap depth=0x18 pid=0x04600088
drawable=0x04600004 width=411 height=17

000:<:03d0: 20: Request(59): SetClipRectangles ordering=YXBanded(0x03)
gc=0x04600028 clip-x-origin=0 clip-y-origin=0 rectangles ={x=0 y=0
w=411 h=17};
000:<:03d1: 20: Request(70): PolyFillRectangle drawable=0x04600088
gc=0x04600028 rectangles={x=0 y=0 w=411 h=17};
000:<:03d2: 16: Request(56): ChangeGC gc=0x04600028
values={clip-mask=None(0x00000000)}
000:<:03d3: 20: Request(59): SetClipRectangles ordering=YXBanded(0x03)
gc=0x0460000b clip-x-origin=0 clip-y-origin=0 rectangles ={x=0 y=0
w=411 h=17};
000:<:03d4: 20: Request(70): PolyFillRectangle drawable=0x04600088
gc=0x0460000b rectangles={x=0 y=0 w=411 h=17};
000:<:03d5: 16: Request(56): ChangeGC gc=0x0460000b
values={clip-mask=None(0x00000000)}
000:<:03d6: 20: RENDERRequest(152): RenderCreatePicture pid=0x04600089
drawable=0x04600088 format=0x00000038  values={}
000:<:03d7: 20: RENDERRequest(152): RenderSetPictureClipRectangles
picture=0x04600089 xOrigin=0 yOrigin=0 rectangles={x=0 y=0 w=411
h=17};
000:<:03d8: 28: RENDERRequest(152): RenderFillRectangles op=Src(0x01)
dst=0x0460002b red=0x1010 green=0x1010 blue=0x1010 alpha=0xffff
rects={x=0 y=0 w=1 h=1};
000:<:03d9:100: RENDERRequest(152): RenderCompositeGlyphs8
op=Over(0x03) src=0x0460002b dst=0x04600089 maskFormat=0x00000036
glyphset=0x04600003 xSrc=0 ySrc=0 glyphcmds={deltax=0 deltay=13
glyphs=0x37,0x4b,0x4c,0x56,0x03,0x4c,0x56,0x03,0x44,0x03,0x53,0x55,0x48,0x57,0x57,0x5c,0x03,0x4f,0x52,0x51,0x4a,0x03,0x56,0x57,0x55,0x4c,0x51,0x4a,0x03,0x5a,0x4c,0x57,0x4b,0x03,0x56,0x52,0x50,0x48,0x03,0x44,0x46,0x46,0x48,0x51,0x57,0x48,0x47,0x03,0x46,0x4b,0x44,0x55,0x56,0x1d,0x03,0x2d,0xb7,0x48,0x03,0xa6,0xa6,0x55,0x48,0x56;
};

GTK+ 2.10 new

000:<:019f: 16: Request(56): ChangeGC gc=0x03e00009
values={clip-mask=None(0x00000000)}
000:<:01a0: 20: Request(59): SetClipRectangles ordering=YXBanded(0x03)
gc=0x03e00024 clip-x-origin=0 clip-y-origin=0 rectangles ={x=0 y=0
w=411 h=17};
000:<:01a1: 28: Request(62): CopyArea src-drawable=0x03e0004d
dst-drawable=0x03e00003 gc=0x03e00024 src-x=0 src-y=0 dst-x=0 dst-y=0
width=411 height=17
000:<:01a2: 16: Request(56): ChangeGC gc=0x03e00024
values={clip-mask=None(0x00000000)}
000:<:01a3:  8: RENDERRequest(152): RenderFreePicture picture=0x03e0004e
000:<:01a4:  8: Request(54): FreePixmap drawable=0x03e0004d
000:<:01a5: 16: Request(53): CreatePixmap depth=0x18 pid=0x03e00052
drawable=0x03e00003 width=411 height=17

000:<:01a6: 20: RENDERRequest(152): RenderCreatePicture pid=0x03e00053
drawable=0x03e00052 format=0x00000038  values={}
000:<:01a7: 20: RENDERRequest(152): RenderSetPictureClipRectangles
picture=0x03e00053 xOrigin=0 yOrigin=0 rectangles={x=0 y=0 w=411
h=17};
000:<:01a8: 28: RENDERRequest(152): RenderFillRectangles op=Over(0x03)
dst=0x03e00053 red=0xdcdc green=0xdada blue=0xd5d5 alpha=0xffff
rects={x=0 y=0 w=411 h=17};

000:<:01a9: 20: Request(59): SetClipRectangles ordering=YXBanded(0x03)
gc=0x03e0000a clip-x-origin=0 clip-y-origin=0 rectangles ={x=0 y=0
w=411 h=17};
000:<:01aa: 20: Request(70): PolyFillRectangle drawable=0x03e00052
gc=0x03e0000a rectangles={x=0 y=0 w=411 h=17};
000:<:01ab: 16: Request(56): ChangeGC gc=0x03e0000a
values={clip-mask=None(0x00000000)}
000:<:01ac: 20: RENDERRequest(152): RenderSetPictureClipRectangles
picture=0x03e00053 xOrigin=0 yOrigin=0 rectangles={x=0 y=0 w=411
h=17};

000:<:01ad: 16: Request(53): CreatePixmap depth=0x20 pid=0x03e00054
drawable=0x0000004c width=1 height=1
000:<:01ae: 20: RENDERRequest(152): RenderCreatePicture pid=0x03e00055
drawable=0x03e00054 format=0x00000036  values={}
000:<:01af: 28: RENDERRequest(152): RenderFillRectangles op=Src(0x01)
dst=0x03e00055 red=0x0000 green=0x0000 blue=0x0000 alpha=0xffff
rects={x=0 y=0 w=1 h=1};
000:<:01b0: 20: RENDERRequest(152): RenderCreatePicture pid=0x03e00056
drawable=0x03e00054 format=0x00000036  values={}
000:<:01b1: 44: RENDERRequest(152): RenderSetPictureTransform
picture=0x03e00056
transform=0x00010000,0x00000000,0x00000000,0x00000000,0x00010000,0x00000000,0x00000000,0x00000000,0x00010000;
000:<:01b2: 16: RENDERRequest(152): RenderChangePicture
picture=0x03e00056 mask=0x00000001 values={repeat=true(0x01)}
000:<:01b3: 20: RENDERRequest(152): RenderSetPictureFilter
picture=0x03e00056  name='nearest'

000:<:01b4:100: RENDERRequest(152): RenderCompositeGlyphs8
op=Over(0x03) src=0x03e00056 dst=0x03e00053 maskFormat=0x00000036
glyphset=0x03e00023 xSrc=0 ySrc=13 glyphcmds={deltax=0 deltay=13
glyphs=0x37,0x4b,0x4c,0x56,0x03,0x4c,0x56,0x03,0x44,0x03,0x53,0x55,0x48,0x57,0x57,0x5c,0x03,0x4f,0x52,0x51,0x4a,0x03,0x56,0x57,0x55,0x4c,0x51,0x4a,0x03,0x5a,0x4c,0x57,0x4b,0x03,0x56,0x52,0x50,0x48,0x03,0x44,0x46,0x46,0x48,0x51,0x57,0x48,0x47,0x03,0x46,0x4b,0x44,0x55,0x56,0x1d,0x03,0x2d,0x7d,0x48,0x03,0x6c,0x6c,0x55,0x48,0x56;
};
000:<:01b5:  8: RENDERRequest(152): RenderFreePicture picture=0x03e00055
000:<:01b6:  8: RENDERRequest(152): RenderFreePicture picture=0x03e00056
000:<:01b7:  8: Request(54): FreePixmap drawable=0x03e00054

Assuming a) less X calls = good b) the way xft does things is just
fine, there's still one issue to fix in cairo. Before the
RenderCompositeGlyphs8 call we are creating a 1x1 Pixmap in the
server, doing operationg with it, and freeing it (and the related
Pictures) immediately after rendering the glyphs. Xft does not do
anything similar AFAICT. If I'm not mistaken this calls start from the
following code in cairo-xlib-surface.c:

 if (src_pattern->type == CAIRO_PATTERN_TYPE_SOLID) {
        status = _cairo_pattern_acquire_surface (src_pattern, &dst->base,
                                                 0, 0, 1, 1,
                                                 (cairo_surface_t **) &src,
                                                 &attributes);
(...)

and finish with:

status = _cairo_xlib_surface_set_attributes (src, &attributes);

just before the actual glyph rendering. So, again. What are we exactly
doing? Can it be done the way Xft does it?

Cheers and happy hunting, Xan


More information about the cairo mailing list