[Pixman] [PATCH 1/4] bits: Implement PAD support in the simple fetcher
Chris Wilson
chris at chris-wilson.co.uk
Wed Jan 30 02:15:01 PST 2013
On Tue, Jan 29, 2013 at 08:25:24PM +0100, Søren Sandmann wrote:
> Chris Wilson <chris at chris-wilson.co.uk> writes:
>
> > diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c
> > index 75a39a1..f25d576 100644
> > --- a/pixman/pixman-bits-image.c
> > +++ b/pixman/pixman-bits-image.c
> > @@ -1266,6 +1266,61 @@ bits_image_fetch_untransformed_repeat_none (bits_image_t *image,
> > }
> >
> > static void
> > +bits_image_fetch_untransformed_repeat_pad (bits_image_t *image,
> > + pixman_bool_t wide,
> > + int x,
> > + int y,
> > + int width,
> > + uint32_t * buffer)
>
> Some coding style issues in this one: no braces around single lines,
> spaces around -.
"image->width-1" right, just checking I haven't misinterpreted.
> But I'm curious what particular operation hits this. Usually PAD
> repeating is most useful with scaling, but this is an untransformed
> fetcher.
Not much I can add to this one based on the inspection of the call
stack, it is a regular pixel aligned cairo_fill hitting the
pixman_image_composite32() fast path. However, I can add that firefox
likes to default to PAD for its images. (Note that this benchmark
appears to have been written to demonstrate a few bugs in firefox, so I
would not rule out that the composite() should have ideally been clipped
to the source image.)
This seems to be representative:
#0 bits_image_fetch_untransformed_32 (iter=0xbfff8104, mask=0x0)
at pixman-bits-image.c:1372
image = <optimized out>
x = <optimized out>
y = <optimized out>
width = <optimized out>
buffer = <optimized out>
#1 0xb7e2c755 in general_composite_rect (imp=0x8058008, info=0xbfffe234)
at pixman-general.c:241
s = <optimized out>
m = <optimized out>
d = <optimized out>
op = PIXMAN_OP_OVER
src_image = 0x0
mask_image = <optimized out>
dest_image = 0x80f7168
src_x = 0
src_y = 0
mask_x = 0
mask_y = 0
dest_x = 0
dest_y = 0
width = 2560
height = 1439
compose = 0xb7e473d0 <sse2_combine_over_u>
component_alpha = <optimized out>
narrow = <optimized out>
src_iter_flags = <optimized out>
Bpp = -1209764912
i = <optimized out>
#2 0xb7ddbb78 in pixman_image_composite32 (op=op at entry=PIXMAN_OP_OVER,
src=src at entry=0x80acbc8, mask=mask at entry=0x0, dest=dest at entry=0x80f7168,
src_x=0, src_y=0, mask_x=0, mask_y=0, dest_x=0, dest_y=0, width=2560,
height=height at entry=1439) at pixman.c:707
src_format = PIXMAN_a8r8g8b8
mask_format = 0
dest_format = <optimized out>
region = {extents = {x1 = 0, y1 = 0, x2 = 2560, y2 = 1439}, data = 0x0}
extents = {x1 = 0, y1 = 0, x2 = 2560, y2 = 1439}
imp = 0x8058008
func = 0xb7e2c4b0 <general_composite_rect>
info = {op = PIXMAN_OP_OVER, src_image = 0x80acbc8, mask_image = 0x0,
dest_image = 0x80f7168, src_x = 0, src_y = 0, mask_x = 0,
mask_y = 0, dest_x = 0, dest_y = 0, width = 2560, height = 1439,
src_flags = 34065015, mask_flags = 8192, dest_flags = 34032383}
pbox = 0xbfffe220
n = 0
(gdb) p src->bits
$3 = {common = {type = BITS, ref_count = 1, clip_region = {extents = {x1 = 0,
y1 = 0, x2 = 0, y2 = 0}, data = 0xb7e76dc0}, alpha_count = 0,
have_clip_region = 0, client_clip = 0, clip_sources = 0, dirty = 0,
transform = 0x0, repeat = PIXMAN_REPEAT_PAD,
filter = PIXMAN_FILTER_NEAREST, filter_params = 0x0, n_filter_params = 0,
alpha_map = 0x0, alpha_origin_x = 0, alpha_origin_y = 1072693248,
component_alpha = 0,
property_changed = 0xb7de7ef0 <bits_image_property_changed>,
destroy_func = 0, destroy_data = 0x0, flags = 34065015,
extended_format_code = PIXMAN_a8r8g8b8}, format = PIXMAN_a8r8g8b8,
indexed = 0x0, width = 128, height = 128, bits = 0x80bc5e8, free_me = 0x0,
rowstride = 128, fetch_scanline_32 = 0xb7ddc700 <fetch_scanline_a8r8g8b8>,
fetch_pixel_32 = 0xb7ddc780 <fetch_pixel_a8r8g8b8>,
store_scanline_32 = 0xb7ddc740 <store_scanline_a8r8g8b8>,
fetch_scanline_float = 0xb7de1440 <fetch_scanline_generic_float>,
fetch_pixel_float = 0xb7de13a0 <fetch_pixel_generic_float>,
store_scanline_float = 0xb7de14c0 <store_scanline_generic_float>,
read_func = 0, write_func = 0}
(gdb) p dst->bits
$4 = {common = {type = BITS, ref_count = 1, clip_region = {extents = {x1 = 0,
y1 = 0, x2 = 0, y2 = 0}, data = 0xb7e76dc0}, alpha_count = 0,
have_clip_region = 0, client_clip = 0, clip_sources = 0, dirty = 0,
transform = 0x0, repeat = PIXMAN_REPEAT_NONE,
filter = PIXMAN_FILTER_NEAREST, filter_params = 0x0, n_filter_params = 0,
alpha_map = 0x0, alpha_origin_x = 51200, alpha_origin_y = 6656,
component_alpha = 0,
property_changed = 0xb7de7ef0 <bits_image_property_changed>,
destroy_func = 0, destroy_data = 0x0, flags = 34032383,
extended_format_code = PIXMAN_x8r8g8b8}, format = PIXMAN_x8r8g8b8,
indexed = 0x0, width = 2560, height = 1439, bits = 0xb30fb008,
free_me = 0xb30fb008, rowstride = 2560,
fetch_scanline_32 = 0xb7ddc7a0 <fetch_scanline_x8r8g8b8>,
fetch_pixel_32 = 0xb7ddc840 <fetch_pixel_x8r8g8b8>,
store_scanline_32 = 0xb7ddc7f0 <store_scanline_x8r8g8b8>,
fetch_scanline_float = 0xb7de1440 <fetch_scanline_generic_float>,
fetch_pixel_float = 0xb7de13a0 <fetch_pixel_generic_float>,
store_scanline_float = 0xb7de14c0 <store_scanline_generic_float>,
read_func = 0, write_func = 0}
--
Chris Wilson, Intel Open Source Technology Centre
More information about the Pixman
mailing list