Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

XCopyArea/XPutImage which faster?

649 views
Skip to first unread message

Neil McGill

unread,
Apr 1, 1996, 3:00:00 AM4/1/96
to
Well, simply said - which is generally faster - or what is the difference
in their expected usage?

I have to display a few hundred small 16x8 pixel tiles. Each has data and
a mask - and the refresh has to be fairly nifty. I'm currently using XPutImage
and the results are quite slow. Will XCopyArea help?

Neil
--
NeilMcGill nei...@spider.co.uk *8^) Shiva Europe Ltd

Ken Lee

unread,
Apr 1, 1996, 3:00:00 AM4/1/96
to
In article <4jo8jv$7...@crab.spider.co.uk>,

nei...@spider.co.uk (Neil McGill) wrote:
>Well, simply said - which is generally faster - or what is the
difference
>in their expected usage?

Which is faster really depends on your algorithm. The two are not
directly comparable, since XPutImage uses a client-side source and
XCopyArea uses a server-side source.

-------
Ken Lee, http://www.rahul.net/kenton/index.html


Haavard Nord

unread,
Apr 2, 1996, 3:00:00 AM4/2/96
to
Neil McGill wrote:
>
> Well, simply said - which is generally faster - or what is the difference
> in their expected usage?
>
> I have to display a few hundred small 16x8 pixel tiles. Each has data and
> a mask - and the refresh has to be fairly nifty. I'm currently using XPutImage
> and the results are quite slow. Will XCopyArea help?
>

XCopyArea is much, much faster. XPutImage involves sending the data from the
client to the server, which converts it to a pixmap and copies (XCopyArea) it to
the screen. With XCopyArea, you save the time it takes to transfer and convert
the image. XCopyArea is often performed by the display adapter hardware.

--
Haavard Nord | Email : han...@troll.no
Troll Tech AS | Email : in...@troll.no
PO Box 6133 Etterstad, 0602 Oslo, Norway | Fax : +47 22646949

Robert Olofsson

unread,
Apr 2, 1996, 3:00:00 AM4/2/96
to
: > a mask - and the refresh has to be fairly nifty. I'm currently using XPutImage

: > and the results are quite slow. Will XCopyArea help?
: >

: XCopyArea is much, much faster. XPutImage involves sending the data from the
: client to the server, which converts it to a pixmap and copies (XCopyArea) it to
: the screen. With XCopyArea, you save the time it takes to transfer and convert
: the image. XCopyArea is often performed by the display adapter hardware.

If I use the shared memory extension how much speed will I gain (any)???
since both the server and the client uses the same memory theres
no need to transfer the data, I wounder if XCopyArea still will be faster?
trying to display some 3d graphics and need the fastest way to put them in the
window (the calculation takes some time).
/Rob
******************************************************************************
Robert Olofsson * d94...@nada.kth.se * "Your eyes can deceive you
Byvägen 95 * ro...@isk.kth.se * use the force."
183 39 Täby * tel: 08-758 55 32 * /Obi-Wan-Kenobi
Sweden * http://www.nada.kth.se/~d94-rol
******************************************************************************

Karl Schultz

unread,
Apr 2, 1996, 3:00:00 AM4/2/96
to
Robert Olofsson wrote:
>
> : > a mask - and the refresh has to be fairly nifty. I'm currently using XPutImage
> : > and the results are quite slow. Will XCopyArea help?
> : >
>
> : XCopyArea is much, much faster. XPutImage involves sending the data from the
> : client to the server, which converts it to a pixmap and copies (XCopyArea) it to
> : the screen. With XCopyArea, you save the time it takes to transfer and convert
> : the image. XCopyArea is often performed by the display adapter hardware.
>
> If I use the shared memory extension how much speed will I gain (any)???
> since both the server and the client uses the same memory theres
> no need to transfer the data, I wounder if XCopyArea still will be faster?
> trying to display some 3d graphics and need the fastest way to put them in the
> window (the calculation takes some time).

Like Ken said, it depends what you are doing.

If you are computing an image on the client side, which is what you are
suggesting, then the image needs to get from the client to the server
at least once *somehow*. So, you have to do at least one PutImage.

If you are just going to display it once, then there is no need to
create a server-side copy and so you might just as well do a PutImage
directly to the window.

If you think you are going to display the image many times, then you
might want to PutImage to a Pixmap and then do the CopyArea each time
you want to display it.

Keep in mind that you'll have to restore the picture due to Expose events.
The CopyArea would do this faster, even when PutImage uses shared memory.
When running remotely, it is even more important to cache the image
in a pixmap and use CopyArea if more than one draw is expected.

There are other factors to consider, like whether backing store is
availble and active, and how much memory the server-side pixmap
will occupy.

Jyrki Alakuijala

unread,
Apr 4, 1996, 3:00:00 AM4/4/96
to
>If I use the shared memory extension how much speed will I gain (any)???

XShmPutImage is significantly faster and should be used in
professional visualization programs.
However, programming with shm extensions seems
pretty difficult. I would recommend that you check how this
issue has been handled in Mesa graphics library (which is an
OpenGl-like graphics library for X).

It could be a good idea to give up your own graphics library
development and consider if you could use Mesa. This gives
you a much better upgrade path than your own development.
In addition to that you may compile and run the same
visualization engine on many platforms: Linux, Unix, NT,
Win95, and use the accelerated 3D engines of for example
Intergraph TDZ series (in NT) or Silicon Graphics. If you find
room for improvement in Mesas rendering quality or speed,
you are still free to implement your own versions of graphics
primitives (and contribute them) to Mesa. Mesa code is well
structured and easy to understand.

-- snip from Mesa readme --
The primary Mesa ftp site is iris.ssec.wisc.edu in the
pub/Mesa directory. Mesa is also mirrored on sunsite in
the directory pub/packages/development/graphics/mesa.
-- snap --

--Jyrki Alakuijala


0 new messages