summaryrefslogtreecommitdiff
path: root/twin_draw.c
AgeCommit message (Collapse)AuthorFilesLines
2006-12-03Rework clip handling. The clip rectangle and the origin of drawingBenjamin Herrenschmidt1-12/+24
are now two different things, so that you can clip drawing within changing your coordinate system. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2006-12-01Fix crash in twin_composite if msk == NULLBenjamin Herrenschmidt1-2/+2
Oops, introduced by the transform changes, I wasn't testing msk for NULL before dereferencing it in one spot. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2006-11-28Fix copy/paste bogon on 16 bits tranformBenjamin Herrenschmidt benh@kernel.crashing.org1-2/+2
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2006-11-28Add some basic affine transform support to compositing.Benjamin Herrenschmidt benh@kernel.crashing.org1-32/+313
The transform matrix is currently stored in the pixmap, though it is only ever used when that pixmap is a source of a composite operation (not for windows refresh, damage, etc...) thus I might move it to twin_operand_t. The implementation is totally sub-optimal but it gives a working basis. As Keith suggested, we could use a bresenham-type algorithm in the transform loop to avoiding having to transform every pixel through the matrix. That will probably significantly improve performances. There are also minor optimisations that can be done in a few corners. Also the matrix is used as a reverse transform, which can be confusing. I'll fix it one of these days to operate on an inverted matrix instead. While playing with it, I noticed several issues with the existing non-transform composite function. A bug I fixed related to masks, but also the source clipping seems to be busted. It adds the clip top/left to the src_x/y & msk_x/y which doesn't make much sense to me and doesn't clip when fetching pixels, thus forcing you to have perfectly adjusted width and height args to twin_composite() that match the source image size (which stops making sense when using transforms). I haven't fixed it yet but I will do so, possibly by merging xform and simple into one function (thus always using a temporary span buffer) or by adding a bit of clipping code to the simple function's inner loop. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2006-11-24Change from MIT to LGPL licenseKeith Packard1-18/+15
2004-10-29add demoline + demosplineKeith Packard1-4/+4
Add cap styles, widget shapes, text alignment and arcs Change circle/ellipse API. Capture button events. Use Lozenge shape for output Drag lines with the mouse drag splines with the mouse move '1' right a bit Convert dispatch result to boool was mis-computing delegate and crashing when window->event was NULL Map X button info to twin mask draw different stuff.
2004-10-27Move bevel routine to twin_widget for sharingKeith Packard1-1/+1
Change order of timeout vs work, making work come last as that's where redisplay occurs. Oops. Argument order wrong in twin_pixmap_damage call Make button italic to test Change names of formals to match prototype
2004-10-25Add dispatch stuff to manage timeouts, workprocs and files. Remove threadKeith Packard1-49/+58
stuff Split demos into separate files Make drawing origin match clip rectangle. twin_fedit Add glyph editor to CVS to preserve it Add scalable icons Separate 'closing' a subpath from 'finishing' a subpath; the former adds a point back to the start while the latter just leaves the path unclosed and prepares for a new subpath. Eliminate locking, add clipping. Clean up title drawing, use clipping Eliminate locking, use dispatch stuff
2004-10-06Add the beginings of event dispatch and a bit of window managementKeith Packard1-11/+7
including titles. Default event dispatcher does restacking and motion.
2004-10-05Update API to use twin_ types for most everything.Keith Packard1-43/+33
Rework snapping to correctly snap vertical and horizontal text on pixel boundaries. Change clock watermark
2004-10-04Fix a clipping bugKeith Packard1-2/+2
Change glyph representation to allow splines and include metrics. Add some new helper functions. Expose _twin_path_scurve for glyphs Increase sin table precision. Fix off-by-one error in y position. Lock screen while adding expose damage Change clock appearance. Use corrected glyph metrics
2004-09-30Handle unhinted text.Keith Packard1-0/+6
Add helper functions Lock pixmaps during drawing Disable screen updates while applications are busy Add threads to manage events and redisplay Paint a clock
2004-09-21Add convolution. Pen starting position needs work.Keith Packard1-3/+0
Move shared geometric functions to new file Add twin_path_circle to generate pens. Fix path edge generator to handle last subpath right. Skip vertices which don't span a sample row test convolutions Add .cvsignore file Mention path primitives Add paths Eliminate some unused variables. Simple path construction Anti-aliased polygon fill code Change twin_bool to twin_bool_t Append cubic Bézier splines to paths Test paths
2004-09-15Initial revisionKeith Packard1-0/+408