[cairo] RE: cairo Digest, Vol 17, Issue 35
sasikumar.kandhasamy at wipro.com
sasikumar.kandhasamy at wipro.com
Wed Dec 13 02:21:23 PST 2006
Thanks & Regards,
Sasikumar Kandhasamy
Project Engineer
Wipro Technologies
Madivala-1|Bangalore.
Mobile- +91-9986378586 | Phone: 30292842
"Dreams into Thoughts and Thoughts into Actions" -- Dr. A P J Abdul
Kalam
-----Original Message-----
From: cairo-bounces at cairographics.org
[mailto:cairo-bounces at cairographics.org] On Behalf Of
cairo-request at cairographics.org
Sent: Wednesday, December 13, 2006 3:21 PM
To: cairo at cairographics.org
Subject: cairo Digest, Vol 17, Issue 35
Send cairo mailing list submissions to
cairo at cairographics.org
To subscribe or unsubscribe via the World Wide Web, visit
http://cairographics.org/cgi-bin/mailman/listinfo/cairo
or, via email, send a message with subject or body 'help' to
cairo-request at cairographics.org
You can reach the person managing the list at
cairo-owner at cairographics.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of cairo digest..."
Today's Topics:
1. Re: Saving a surface to a file (Carl Worth)
2. Re: Re: Bus Error -- Mac OS X Intel (mpsuzuki at hiroshima-u.ac.jp)
3. how to uninstall cairo (ken carlino)
4. Re: how to uninstall cairo (Thomas Coppi)
5. xtrace, part the second (Xan Lopez)
6. RE: Cario in Visual Basic (Jelmer Baas)
7. Re: how to uninstall cairo (Gian Mario Tagliaretti)
8. patches for pixman (Klaus Stehle)
----------------------------------------------------------------------
Message: 1
Date: Tue, 12 Dec 2006 20:22:19 -0800
From: Carl Worth <cworth at cworth.org>
Subject: Re: [cairo] Saving a surface to a file
To: "yinglcs2 at yahoo.com" <yinglcs2 at yahoo.com>
Cc: cairo at cairographics.org
Message-ID: <87ejr45ssk.wl%cworth at cworth.org>
Content-Type: text/plain; charset="us-ascii"
On Wed, 13 Dec 2006 08:37:06 +0700 (ICT), "yinglcs2 at yahoo.com" wrote:
> Does anyone know if i need to do things different when i upgrade to
cairo 1.2.6?
No, you're not supposed to need to do things differently.
The fact that you're seeing a difference between 1.0 and 1.2 suggests
that there is a bug in cairo. We'd very much like to find out what
that bug is so we can then fix it.
Could you please help us by providing us more information? The ideal
contribution would be a minimal, (but complete), program that succeeds
with 1.0 and fails with 1.2.
-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url :
http://lists.freedesktop.org/archives/cairo/attachments/20061212/b01f6b4
e/attachment-0001.pgp
------------------------------
Message: 2
Date: Wed, 13 Dec 2006 13:54:18 +0900
From: mpsuzuki at hiroshima-u.ac.jp
Subject: Re: [cairo] Re: Bus Error -- Mac OS X Intel
To: "Daniel Corbe" <daniel.junkmail at gmail.com>
Cc: cairo at cairographics.org
Message-ID: <20061213135418.556771ef.mpsuzuki at hiroshima-u.ac.jp>
Content-Type: text/plain; charset=US-ASCII
Hi,
I'm the maintainer MacOS specific part of FreeType2.
The MacOS specific code (to support suitcase font etc) of
freetype-2.2.1 is not ready for Intel Mac. I'm not sure
the error is caused by freetype, but, if you want to support
system font on Mac OS X, please try to update latest freetype2
in CVS.
If possible, please build freetype2 and cairo with debug symbol
without optimization (-g3 -ggdb -O0) and search the exact part
which causes Bus error.
Regards,
mpsuzuki
On Tue, 12 Dec 2006 11:44:17 -0500
"Daniel Corbe" <daniel.junkmail at gmail.com> wrote:
>Program received signal EXC_BAD_ACCESS, Could not access memory.
>Reason: KERN_PROTECTION_FAILURE at address: 0x000000d0
>0x04680700 in _cairo_xlib_surface_show_glyphs (abstract_dst=0x594d7e0,
>op=CAIRO_OPERATOR_OVER, src_pattern=0xbfffdd24, glyphs=0x5024e00,
>num_glyphs=36, scaled_font=0x594b730) at cairo-xlib-surface.c:2822
>2822 if (scaled_glyph->surface->width &&
>scaled_glyph->surface->height) {
>(gdb)
>
>On 12/12/06, Daniel Corbe <daniel.junkmail at gmail.com> wrote:
>> Dear Cairo Community,
>>
>> Things that I have linked against Cairo currently crash with a Bus
>> Error. I ran one such thing (Ethereal<->GTK<->Pango<->Cairo) through
>> GDB and this is what I got (bt full, see attached). If someone could
>> point me in the right direction I would appriciate it. Thanks.
>>
>> -Daniel
>>
>>
>>
>_______________________________________________
>cairo mailing list
>cairo at cairographics.org
>http://cairographics.org/cgi-bin/mailman/listinfo/cairo
------------------------------
Message: 3
Date: Wed, 13 Dec 2006 00:20:28 -0600
From: "ken carlino" <ken.carlino at gmail.com>
Subject: [cairo] how to uninstall cairo
To: cairo at cairographics.org
Message-ID:
<b9e408290612122220l2b957de2o50ecf73cafa54ec0 at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
hi,
i have download the source of cairo 1.2.6 and do 'configure; make ;
make install' on my linux machine.
Can you please tell me what is the cleanest way to uninstall cairo?
thanks.
------------------------------
Message: 4
Date: Tue, 12 Dec 2006 23:23:19 -0700
From: "Thomas Coppi" <thisnukes4u at gmail.com>
Subject: Re: [cairo] how to uninstall cairo
To: "ken carlino" <ken.carlino at gmail.com>
Cc: cairo at cairographics.org
Message-ID:
<5e04a4c60612122223v5373bcd8u4ce410ba0ec75cf1 at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
make uninstall
On 12/12/06, ken carlino <ken.carlino at gmail.com> wrote:
>
> hi,
>
> i have download the source of cairo 1.2.6 and do 'configure; make ;
> make install' on my linux machine.
>
> Can you please tell me what is the cleanest way to uninstall cairo?
> thanks.
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://cairographics.org/cgi-bin/mailman/listinfo/cairo
>
--
Thomas Coppi
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.freedesktop.org/archives/cairo/attachments/20061212/598b461
e/attachment-0001.html
------------------------------
Message: 5
Date: Wed, 13 Dec 2006 11:31:21 +0200
From: "Xan Lopez" <xan.lopez at gmail.com>
Subject: [cairo] xtrace, part the second
To: cairo at cairographics.org
Message-ID:
<fcaff6ea0612130131g3e3f907aj42f9b806e06c08d0 at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
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,0x
4a,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,0
xb7,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,0x00000
000,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,0x
4a,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,0
x7d,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
------------------------------
Message: 6
Date: Wed, 13 Dec 2006 10:34:58 +0100
From: "Jelmer Baas" <Baas at speerit.nl>
Subject: RE: [cairo] Cario in Visual Basic
To: <cairo at cairographics.org>
Message-ID: <99061369D171124CA13DE958F9C5F15702F638 at www.speerit.nl>
Content-Type: text/plain; charset="us-ascii"
Daniel,
Thanks for your reply.
> Having said that, if you're looking for
> the fastest way to draw lines in VB, cairo may not be what
> you're looking for. Sure, it can draw lines quickly (and
> likely fast enough for your purposes), but the focus here is
> on a lot more than that. And that "a lot more"
> is probably going to interest you also.
It's not only about "the lines". I'll need to draw lines, text, use
colors, drag-'n-drop and much more. The problem is that I'm not even
completely aware about WHAT I'll need, but I'm sure that what I know
now, isn't half of it. Therefore I need more than a simple "draw a line"
control.
> Out of curiousity, where did you get the cairo dll? Here?
>
> http://www.gimp.org/~tml/gimp/win32/downloads.html
No, I downloaded it from
http://gladewin32.sourceforge.net/modules/news/, which is the link from
the cairo site (which is, on a side note, a great place to get lost ...)
> Notice that what you get from the above link isn't an ActiveX
> dll, which is what VB needs to interface with cairo nicely.
> The cairo dll just has plain old C functions, so you can
> either interface with it like you would the Win32 API
> (declare each function/structure you use etc), or you can go
> through the effort of creating a ActiveX DLL that wraps
> cairo's functionality in nice COM objects. To do that last
> approach would require quite a bit of work, but the result
> would be pretty cool, and I think you'd make a number of
> windows developers happy.
My idea is to write a simple module which gives a VB programmer access
to all the functions. Shouldn't be that hard, just a lot of work.
Only thing I haven't figured out is how to create the "cairo_t" object
in VB ... Oh, and ofcourse try to understand the LGPL license, which is
even harder for me...
Jonathan: thanks for the link, I'll check that out, too.
--
Jelmer
------------------------------
Message: 7
Date: Wed, 13 Dec 2006 10:48:05 +0100
From: "Gian Mario Tagliaretti" <g.tagliaretti at gmail.com>
Subject: Re: [cairo] how to uninstall cairo
To: "ken carlino" <ken.carlino at gmail.com>
Cc: cairo at cairographics.org
Message-ID:
<35bf41160612130148o4b29c6bcs7b459209056597b3 at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
2006/12/13, ken carlino <ken.carlino at gmail.com>:
> i have download the source of cairo 1.2.6 and do 'configure; make ;
> make install' on my linux machine.
short answer make uninstall, as Thomas already said.
long answer , depends how you run the configure script, have you pass
to the configure --prefix=/usr ? in that case you better NOT run make
uninstall, otherwise you will delete also the cairo version provided
with the packages of you distro (if your distro installs the system
libraries in /usr) breaking your system the hard way...
as you see there are plenty of variables possible, when asking this
sort of questions you should give all the details to avoid the "short
answer"
cheers
--
Gian Mario Tagliaretti
http://www.parafernalia.org/pygtk/
------------------------------
Message: 8
Date: Wed, 13 Dec 2006 10:50:59 +0100 (CET)
From: Klaus Stehle <klaus.stehle at uni-tuebingen.de>
Subject: [cairo] patches for pixman
To: cairo at cairographics.org
Message-ID:
<Pine.LNX.4.61.0612131050235.1212 at commlink.zdv.uni-tuebingen.de>
Content-Type: text/plain; charset="us-ascii"
I have some patches for libpixman. These patches were originally thought
to make support of special formats like 24bpp-RGB24 possible, and while
I was thinking of throwing them away, I found that the patches might be
helpful for a format like CAIRO_FORMAT_A8.
Here is a short example which prints the picture of the letter "A" to
the text console:
//----------%<----------%<----------%<----------%<----------%<----------
#include <cairo.h>
#include <stdio.h>
#define wd (50)
#define ht (25)
unsigned char buffer[wd*ht];
int main ()
{
cairo_surface_t *sfc;
cairo_t *cg;
int x, y;
sfc = cairo_image_surface_create_for_data (buffer, CAIRO_FORMAT_A8,
wd, ht, wd);
cg = cairo_create (sfc);
cairo_set_source_rgba (cg, 0, 0, 0, 1.0);
cairo_set_font_size (cg, 25.0);
cairo_move_to (cg, 2, 20);
cairo_show_text (cg, "A");
cairo_stroke (cg);
for (y=0; y<ht; y++) {
for (x=0; x<wd; x++)
putchar (buffer[y*wd+x] ? '*' : '.');
putchar('\n');
}
return 0;
}
//----------%<----------%<----------%<----------%<----------%<----------
The output is sheared and slanted. The letter "A" is not very nice.
If you change the value of 'wd' to 52, everything will work fine.
There is a bug in pixman. The core of the bug is the macro fbGetDrawable
in pixman/src/pixman-xserver-compat.h which divides the value of
'stride'
by 4, to make address calculations with (unsigned*) pointers possible.
This method fails in all cases where stride is not a multiple of 4.
These patches try to simplify the address calculations.
They also fix bug #7437.
But they aren't complete. Possibly more appearances of the macro
fbGetDrawable should be replaced ...
Perhaps the patches are too much. To fix bug #7437 and the problem shown
above the patches 0001--0003 would suffice.
cheers
Klaus
-------------- next part --------------
>From cba08e8734c3ae9a4e4ba878df6d1e6a80581a11 Mon Sep 17 00:00:00 2001
From: Klaus Stehle <klaus.stehle at uni-tuebingen.de>
Date: Fri, 1 Dec 2006 20:19:18 +0100
Subject: [PATCH] Three new macros to replace fbGetDrawable.
pixman/src/pixman-xserver-compat.h:
A new macro fbGetDrawableS has been added as replacement for
fbGetDrawable, and this new macro returns the correct value of
stride in number of bytes. The values xoff and yoff, which are
always set to zero by fbGetDrawable are thrown away.
A new macro fbAddrAdd adds an offset expressed as number of
bytes to a pointer of any type and returns the result.
A new macro fbInPlaceAdd does the same addition in place.
---
pixman/src/pixman-xserver-compat.h | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/pixman/src/pixman-xserver-compat.h
b/pixman/src/pixman-xserver-compat.h
index a09367d..073e733 100644
--- a/pixman/src/pixman-xserver-compat.h
+++ b/pixman/src/pixman-xserver-compat.h
@@ -86,6 +86,25 @@ typedef pixman_triangle_t xTriangle;
(yoff) = 0; \
}
+/* The macro above is only working correct with 32 bpp formats.
+ * Used with other formats it may not return the correct value of
stride.
+ * Here is a new fbGetDrawableS macro without the evil integer
division.
+ * The value of stride will always be expressed as number of bytes */
+#define fbGetDrawableS(pDrawable, buf, outstride, outbpp) { \
+ (buf) = (pDrawable)->data; \
+ (outstride) = ((int) pDrawable->stride); \
+ (outbpp) = (pDrawable)->bpp; \
+}
+
+/* Add an offset (number of bytes) to a pointer of any type. */
+#define fbAddrAdd(type, buffer, offset) \
+ ((type *)(((char *)(buffer)) + (offset)))
+
+/* Add an offset (number of bytes) to a pointer of any type in place.
*/
+#define fbInPlaceAdd(type, buffer, offset) \
+ ((buffer) = (type *)(((char *)(buffer)) + (offset)))
+
+
/* Extended repeat attributes included in 0.10 */
#define RepeatNone 0
#define RepeatNormal 1
--
1.4.4
-------------- next part --------------
>From f8f2607bd47fda69d02ef5297afd46f0994ce38d Mon Sep 17 00:00:00 2001
From: Klaus Stehle <klaus.stehle at uni-tuebingen.de>
Date: Fri, 1 Dec 2006 20:30:34 +0100
Subject: [PATCH] Replace fbGetDrawable in fbcompose.c
pixman/src/fbcompose.c:
Replaced fbGetDrawable in fbFetchSolid.
Replaced fbGetDrawable in fbFetch.
Replaced fbGetDrawable in fbStore.
Replaced fbGetDrawable twice in fbStoreExternalAlpha.
Not replaced old macro is still in fbFetchTransformed
and fbCompositeRect -- that must be done later ...
---
pixman/src/fbcompose.c | 32 ++++++++++----------------------
1 files changed, 10 insertions(+), 22 deletions(-)
diff --git a/pixman/src/fbcompose.c b/pixman/src/fbcompose.c
index 4958241..5b0373f 100644
--- a/pixman/src/fbcompose.c
+++ b/pixman/src/fbcompose.c
@@ -2686,7 +2686,6 @@ static void fbFetchSolid(PicturePtr pict
FbBits *bits;
FbStride stride;
int bpp;
- int xoff, yoff;
CARD32 color;
CARD32 *end;
fetchPixelProc fetch = fetchPixelProcForPicture(pict);
@@ -2696,8 +2695,7 @@ static void fbFetchSolid(PicturePtr pict
miIndexedPtr indexed = NULL;
#endif
- fbGetDrawable (pict->pDrawable, bits, stride, bpp, xoff, yoff);
- bits += yoff*stride + (xoff*bpp >> FB_SHIFT);
+ fbGetDrawableS (pict->pDrawable, bits, stride, bpp);
color = fetch(bits, 0, indexed);
@@ -2711,7 +2709,6 @@ static void fbFetch(PicturePtr pict, int
FbBits *bits;
FbStride stride;
int bpp;
- int xoff, yoff;
fetchProc fetch = fetchProcForPicture(pict);
#ifdef PIXMAN_INDEXED_FORMATS
miIndexedPtr indexed = (miIndexedPtr)
pict->pFormat->index.devPrivate;
@@ -2719,11 +2716,9 @@ static void fbFetch(PicturePtr pict, int
miIndexedPtr indexed = NULL;
#endif
- fbGetDrawable (pict->pDrawable, bits, stride, bpp, xoff, yoff);
- x += xoff;
- y += yoff;
+ fbGetDrawableS (pict->pDrawable, bits, stride, bpp);
- bits += y*stride;
+ fbInPlaceAdd (FbBits, bits, y*stride);
fetch(bits, x, width, buffer, indexed);
}
@@ -3571,7 +3566,6 @@ static void fbStore(PicturePtr pict, int
FbBits *bits;
FbStride stride;
int bpp;
- int xoff, yoff;
storeProc store = storeProcForPicture(pict);
#ifdef PIXMAN_INDEXED_FORMATS
miIndexedPtr indexed = (miIndexedPtr)
pict->pFormat->index.devPrivate;
@@ -3579,11 +3573,10 @@ static void fbStore(PicturePtr pict, int
miIndexedPtr indexed = NULL;
#endif
- fbGetDrawable (pict->pDrawable, bits, stride, bpp, xoff, yoff);
- x += xoff;
- y += yoff;
+ fbGetDrawableS (pict->pDrawable, bits, stride, bpp);
+
+ fbInPlaceAdd (FbBits, bits, y*stride);
- bits += y*stride;
store(bits, buffer, x, width, indexed);
}
@@ -3592,7 +3585,6 @@ static void fbStoreExternalAlpha(Picture
FbBits *bits, *alpha_bits;
FbStride stride, astride;
int bpp, abpp;
- int xoff, yoff;
int ax, ay;
storeProc store;
storeProc astore;
@@ -3619,15 +3611,11 @@ static void fbStoreExternalAlpha(Picture
ax = x;
ay = y;
- fbGetDrawable (pict->pDrawable, bits, stride, bpp, xoff, yoff);
- x += xoff;
- y += yoff;
- fbGetDrawable (pict->alphaMap->pDrawable, alpha_bits, astride,
abpp, xoff, yoff);
- ax += xoff;
- ay += yoff;
+ fbGetDrawableS (pict->pDrawable, bits, stride, bpp);
+ fbGetDrawableS (pict->alphaMap->pDrawable, alpha_bits, astride,
abpp);
- bits += y*stride;
- alpha_bits += (ay - pict->alphaOrigin.y)*astride;
+ fbInPlaceAdd (FbBits, bits, y*stride);
+ fbInPlaceAdd (FbBits, alpha_bits, (ay -
pict->alphaOrigin.y)*astride);
store(bits, buffer, x, width, indexed);
astore(alpha_bits, buffer, ax - pict->alphaOrigin.x, width,
aindexed);
--
1.4.4
-------------- next part --------------
>From 4b9eefa05e96afc4bf9fb733e9b720cff6adc921 Mon Sep 17 00:00:00 2001
From: Klaus Stehle <klaus.stehle at uni-tuebingen.de>
Date: Wed, 22 Nov 2006 22:17:36 +0100
Subject: [PATCH] Replaced fbGetDrawable in fbComposeGetStart.
pixman/src/fbpict.h:
Replaced fbGetDrawable in fbComposeGetStart.
---
pixman/src/fbpict.h | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/pixman/src/fbpict.h b/pixman/src/fbpict.h
index 0ff0c11..309c3ab 100644
--- a/pixman/src/fbpict.h
+++ b/pixman/src/fbpict.h
@@ -110,11 +110,11 @@
FbBits *__bits__; \
FbStride __stride__; \
int __bpp__; \
- int __xoff__,__yoff__; \
\
-
fbGetDrawable((pict)->pDrawable,__bits__,__stride__,__bpp__,__xoff__,__y
off__); \
- (stride) = __stride__ * sizeof (FbBits) / sizeof (type); \
- (line) = ((type *) __bits__) + (stride) * ((y) + __yoff__) + (mul)
* ((x) + __xoff__); \
+ fbGetDrawableS((pict)->pDrawable,__bits__,__stride__,__bpp__); \
+ (stride) = __stride__ * sizeof(FbBits) \
+ / sizeof(pixman_bits_t) / sizeof(type); \
+ (line) = ((type *) __bits__) + (stride) * (y) + (mul) * (x); \
}
#define cvt8888to0565(s) ((((s) >> 3) & 0x001f) | \
--
1.4.4
-------------- next part --------------
>From 4d6f46f9153427a56148db4fc8f3d3879a64875d Mon Sep 17 00:00:00 2001
From: Klaus Stehle <klaus.stehle at uni-tuebingen.de>
Date: Fri, 1 Dec 2006 21:49:58 +0100
Subject: [PATCH] fbGetDrawable also replaced in fbFetchTransformed.
pixman/src/fbcompose.c:
Replaced fbGetDrawable in fbFetchTransformed.
Not replaced old macro is still fbCompositeRect --
that must be done later ...
---
pixman/src/fbcompose.c | 31 ++++++++++++++-----------------
1 files changed, 14 insertions(+), 17 deletions(-)
diff --git a/pixman/src/fbcompose.c b/pixman/src/fbcompose.c
index 5b0373f..5fa86d6 100644
--- a/pixman/src/fbcompose.c
+++ b/pixman/src/fbcompose.c
@@ -3046,7 +3046,6 @@ static void fbFetchTransformed(PicturePt
FbBits *bits;
FbStride stride;
int bpp;
- int xoff, yoff;
fetchPixelProc fetch;
PictVector v;
PictVector unit;
@@ -3061,9 +3060,7 @@ static void fbFetchTransformed(PicturePt
fetch = fetchPixelProcForPicture(pict);
- fbGetDrawable(pict->pDrawable, bits, stride, bpp, xoff, yoff);
- x += xoff;
- y += yoff;
+ fbGetDrawableS (pict->pDrawable, bits, stride, bpp);
/* reference point is the center of the pixel */
v.vector[0] = IntToxFixed(x) + xFixed1/2;
@@ -3102,7 +3099,7 @@ static void fbFetchTransformed(PicturePt
y = MOD(v.vector[1]>>16,
pict->pDrawable->height);
x = MOD(v.vector[0]>>16,
pict->pDrawable->width);
}
- buffer[i] = fetch(bits + (y +
pict->pDrawable->y)*stride, x + pict->pDrawable->x, indexed);
+ buffer[i] = fetch (fbAddrAdd (FbBits, bits,
(y + pict->pDrawable->y)*stride), x + pict->pDrawable->x, indexed);
}
}
v.vector[0] += unit.vector[0];
@@ -3124,7 +3121,7 @@ static void fbFetchTransformed(PicturePt
x = MOD(v.vector[0]>>16,
pict->pDrawable->width);
}
if (pixman_region_contains_point
(pict->pSourceClip, x, y, &box))
- buffer[i] = fetch(bits + (y +
pict->pDrawable->y)*stride, x + pict->pDrawable->x, indexed);
+ buffer[i] = fetch (fbAddrAdd (FbBits,
bits, (y + pict->pDrawable->y)*stride), x + pict->pDrawable->x,
indexed);
else
buffer[i] = 0;
}
@@ -3151,7 +3148,7 @@ static void fbFetchTransformed(PicturePt
x = v.vector[0]>>16;
}
buffer[i] = ((x < box.x1) | (x >= box.x2) |
(y < box.y1) | (y >= box.y2)) ?
- 0 : fetch(bits + (y +
pict->pDrawable->y)*stride, x + pict->pDrawable->x, indexed);
+ 0 : fetch (fbAddrAdd (FbBits, bits, (y +
pict->pDrawable->y)*stride), x + pict->pDrawable->x, indexed);
}
}
v.vector[0] += unit.vector[0];
@@ -3171,7 +3168,7 @@ static void fbFetchTransformed(PicturePt
x = v.vector[0]>>16;
}
if (pixman_region_contains_point
(pict->pSourceClip, x, y, &box))
- buffer[i] = fetch(bits + (y +
pict->pDrawable->y)*stride, x + pict->pDrawable->x, indexed);
+ buffer[i] = fetch (fbAddrAdd (FbBits, bits,
(y + pict->pDrawable->y)*stride), x + pict->pDrawable->x, indexed);
else
buffer[i] = 0;
}
@@ -3227,11 +3224,11 @@ static void fbFetchTransformed(PicturePt
y1 = MOD (y1, pict->pDrawable->height);
y2 = MOD (y2, pict->pDrawable->height);
- b = bits + (y1 + pict->pDrawable->y)*stride;
+ b = fbAddrAdd (FbBits, bits, (y1 +
pict->pDrawable->y)*stride);
tl = fetch(b, x1 + pict->pDrawable->x,
indexed);
tr = fetch(b, x2 + pict->pDrawable->x,
indexed);
- b = bits + (y2 + pict->pDrawable->y)*stride;
+ b = fbAddrAdd (FbBits, bits, (y2 +
pict->pDrawable->y)*stride);
bl = fetch(b, x1 + pict->pDrawable->x,
indexed);
br = fetch(b, x2 + pict->pDrawable->x,
indexed);
@@ -3291,13 +3288,13 @@ static void fbFetchTransformed(PicturePt
y1 = MOD (y1, pict->pDrawable->height);
y2 = MOD (y2, pict->pDrawable->height);
- b = bits + (y1 + pict->pDrawable->y)*stride;
+ b = fbAddrAdd (FbBits, bits, (y1 +
pict->pDrawable->y)*stride);
tl =
pixman_region_contains_point(pict->pSourceClip, x1, y1, &box)
? fetch(b, x1 + pict->pDrawable->x,
indexed) : 0;
tr =
pixman_region_contains_point(pict->pSourceClip, x2, y1, &box)
? fetch(b, x2 + pict->pDrawable->x,
indexed) : 0;
- b = bits + (y2 + pict->pDrawable->y)*stride;
+ b = fbAddrAdd (FbBits, bits, (y2 +
pict->pDrawable->y)*stride);
bl =
pixman_region_contains_point(pict->pSourceClip, x1, y2, &box)
? fetch(b, x1 + pict->pDrawable->x,
indexed) : 0;
br =
pixman_region_contains_point(pict->pSourceClip, x2, y2, &box)
@@ -3358,7 +3355,7 @@ static void fbFetchTransformed(PicturePt
idistx = 256 - distx;
idisty = 256 - disty;
- b = bits + (y1 + pict->pDrawable->y)*stride;
+ b = fbAddrAdd (FbBits, bits, (y1 +
pict->pDrawable->y)*stride);
x_off = x1 + pict->pDrawable->x;
x1_out = (x1 < box.x1) | (x1 >= box.x2);
@@ -3368,7 +3365,7 @@ static void fbFetchTransformed(PicturePt
tl = x1_out|y1_out ? 0 : fetch(b, x_off,
indexed);
tr = x2_out|y1_out ? 0 : fetch(b, x_off + 1,
indexed);
- b += stride;
+ fbInPlaceAdd (FbBits, b, stride);
bl = x1_out|y2_out ? 0 : fetch(b, x_off,
indexed);
br = x2_out|y2_out ? 0 : fetch(b, x_off + 1,
indexed);
@@ -3423,14 +3420,14 @@ static void fbFetchTransformed(PicturePt
idistx = 256 - distx;
idisty = 256 - disty;
- b = bits + (y1 + pict->pDrawable->y)*stride;
+ b = fbAddrAdd (FbBits, bits, (y1 +
pict->pDrawable->y)*stride);
x_off = x1 + pict->pDrawable->x;
tl =
pixman_region_contains_point(pict->pSourceClip, x1, y1, &box)
? fetch(b, x_off, indexed) : 0;
tr =
pixman_region_contains_point(pict->pSourceClip, x2, y1, &box)
? fetch(b, x_off + 1, indexed) : 0;
- b += stride;
+ fbInPlaceAdd (FbBits, b, stride);
bl =
pixman_region_contains_point(pict->pSourceClip, x1, y2, &box)
? fetch(b, x_off, indexed) : 0;
br =
pixman_region_contains_point(pict->pSourceClip, x2, y2, &box)
@@ -3496,7 +3493,7 @@ static void fbFetchTransformed(PicturePt
if (*p) {
int tx = (pict->repeat == RepeatNormal)
? MOD (x, pict->pDrawable->width) : x;
if (pixman_region_contains_point
(pict->pSourceClip, tx, ty, &box)) {
- FbBits *b = bits + (ty +
pict->pDrawable->y)*stride;
+ FbBits *b = fbAddrAdd (FbBits, bits,
(ty + pict->pDrawable->y)*stride);
CARD32 c = fetch(b, tx +
pict->pDrawable->x, indexed);
srtot += Red(c) * *p;
--
1.4.4
-------------- next part --------------
>From 0e34a5762967c39b1b87a5451a4382bd2e934e8f Mon Sep 17 00:00:00 2001
From: Klaus Stehle <klaus.stehle at uni-tuebingen.de>
Date: Mon, 4 Dec 2006 20:51:49 +0100
Subject: [PATCH] fbGetDrawable also replaced in fbCompositeRect.
pixman/src/fbcompose.c:
Replaced fbGetDrawable in fbCompositeRect.
---
pixman/src/fbcompose.c | 18 ++++++++----------
1 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/pixman/src/fbcompose.c b/pixman/src/fbcompose.c
index 5fa86d6..5ba04e0 100644
--- a/pixman/src/fbcompose.c
+++ b/pixman/src/fbcompose.c
@@ -3633,7 +3633,7 @@ fbCompositeRect (const FbComposeData *da
unsigned int maskClass = SourcePictClassUnknown;
FbBits *bits = NULL; /* squelch bogus compiler warning */
FbStride stride = 0; /* squelch bogus compiler warning */
- int xoff = 0, yoff = 0; /* squelch bogus compiler warning */
+ int bpp = 0; /* squelch bogus compiler warning */
if (data->op == PIXMAN_OPERATOR_CLEAR)
fetchSrc = NULL;
@@ -3723,11 +3723,7 @@ fbCompositeRect (const FbComposeData *da
}
if (!store)
- {
- int bpp;
-
- fbGetDrawable (data->dest->pDrawable, bits, stride, bpp, xoff,
yoff);
- }
+ fbGetDrawableS (data->dest->pDrawable, bits, stride, bpp);
if (fetchSrc &&
fetchMask &&
@@ -3791,8 +3787,9 @@ fbCompositeRect (const FbComposeData *da
else
{
/* blend */
- compose (bits + (data->yDest + i+ yoff) * stride +
- data->xDest + xoff,
+ compose (fbAddrAdd (FbBits, bits,
+ (data->yDest + i) * stride +
+ data->xDest * bpp / 8),
src_buffer, mask_buffer, data->width);
}
}
@@ -3879,8 +3876,9 @@ fbCompositeRect (const FbComposeData *da
else
{
/* blend */
- compose (bits + (data->yDest + i+ yoff) * stride +
- data->xDest + xoff,
+ compose (fbAddrAdd (FbBits, bits,
+ (data->yDest + i) * stride +
+ data->xDest * bpp / 8),
src_mask_buffer, data->width);
}
}
--
1.4.4
------------------------------
_______________________________________________
cairo mailing list
cairo at cairographics.org
http://cairographics.org/cgi-bin/mailman/listinfo/cairo
End of cairo Digest, Vol 17, Issue 35
*************************************
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
www.wipro.com
More information about the cairo
mailing list