home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / fj / maillis / xwindow / 18852 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  3.5 KB

  1. Path: sparky!uunet!stanford.edu!sun-barr!sh.wide!wnoc-tyo-news!scslwide!wsgw!wsservra!onoe
  2. From: ama@marley.Eng.Sun.COM (Al Amaral - SunSelect)
  3. Newsgroups: fj.mail-lists.x-window
  4. Subject: Re: An Open Challenge (it can't be done!)
  5. Message-ID: <1992Dec22.235053.21574@sm.sony.co.jp>
  6. Date: 22 Dec 92 23:50:53 GMT
  7. Sender: onoe@sm.sony.co.jp (Atsushi Onoe)
  8. Distribution: fj
  9. Organization: Sun Microsystems Inc. - BDC
  10. Lines: 63
  11. Approved: michael@sm.sony.co.jp
  12.  
  13. Date: 22 Dec 1992 19:21:55 GMT
  14. Message-Id: <1h7psjINN192@seven-up.East.Sun.COM>
  15. Newsgroups: comp.windows.x
  16. References: <78716@hydra.gatech.EDU>
  17. Sender: xpert-request@expo.lcs.mit.edu
  18.  
  19. In article <78716@hydra.gatech.EDU> gt4417a@prism.gatech.EDU (SKELTON,JOEL PHILLIP) writes:
  20. >
  21. >Here's the short form:
  22. > - 8 bit image in backing pixmap used to update window
  23. > - Image drawn in 8 bit X window
  24. > - Want to draw diagonal lines on top of image that can
  25. >   be removed quickly (i.e. replace them with the data they so
  26. >   recently covered)
  27. > - Can't do server extensions (too many platforms to support)
  28. >Betcha can't do it!
  29. >Joel Skelton   --    North Avenue Trade School, Dept. of Round Things
  30.  
  31.  
  32. Hmmm, I used to work on a window system/machine which actually had such a
  33. mechanism in hardware.  We used it to draw our cursors.  It would draw a 
  34. stroked area, saving the pixels which were touched in offscreen memory.
  35. We could then redraw the stroked area, and replace the pixels which were 
  36. originally under the cursor.  Too bad it's not in X.
  37.  
  38. Anyway, I'll take a whack at this one.  I have no idea how fast this will be,
  39. it'll probably be terribly slow, but I think it can be done...  I know you
  40. said "Can't do server extensions", but I assume you mean new, custom, server
  41. extensions, not ones that probably already are supported on your servers.
  42.  
  43. What about using a shaped window as your stroked polygon, rather than lines.
  44. You would draw the lines into a bitmap, which would then be used as as a 
  45. ShapeMask for the Shape extension.  You could overlay the window with the
  46. shaped window, then copy the whole shaped source window into a pixmap.
  47. This should only copy the stroked areas.  You can then unmap the shaped
  48. window and draw the lines into the original window, or just clear the
  49. shaped window to a single color (whichever is faster).  To restore the
  50. graphics you just do another copy from the pixmap onto the shaped window.
  51.  
  52. Of course, with this method you'll havt to deselect expose events while
  53. you are doing this else you'll get tons of expose events when you reshape
  54. the shaped window.  You'll also probably be severly speed constrained by 
  55. how fast the server can turn the bitmap into clip regions as the shape
  56. of the polygon changes.
  57.  
  58. You should be able to do the same thing without the shape extension altogether
  59. as you have the pixels in a server pixmap already.  To restore you could just 
  60. draw the lines into a bitmap and use it for a clipmask in a GC and do a 
  61. copyarea.  This might actually be much faster, but again, you'll be 
  62. severely speed constrained by how fast the server can turn the clipmask 
  63. into a cliplist...  If only the clip mask were used directly, instead of 
  64. having to be turned into a bazillion little rectangles.
  65.  
  66. Given the amount of time each redraw will take using either of these methods
  67. you'll undoubtedly need to do some kind of motion event compression, as trying
  68. to draw with each new mouse position (assuming you're dragging the lines)
  69. will back up most servers quite badly...
  70.  
  71. Hope this helps.
  72.  
  73. --
  74. --------------------------------------------------------------
  75. Al Amaral                Al.Amaral@East.Sun.COM
  76.