Roi Cohen
2007-Apr-26 07:30 UTC
[compiz] [PATCH]Make wobbly's bezier patch to work with grids that aren't 4x4.
Hi, Recently, I started taking a look at wobbly's source (I was interested in it's physics... ;-)) I noticed that GRID_WIDTH and GRID_HEIGHT were defined to be 4, and I wanted to see how the physics look like with grid sizes that aren't 4x4. I changed the defines to my new grid size, but unfortunately it didn't work. I investigated this "bug" (it's not exactly a bug because users can't change the grid size), and found out the bezier patch was written for specifically 4x4 grids. The attached patch makes the bezier patch to work on every grid size defined (grid sizes could even be an option, although i think 4x4 indeed gives the best effect). Thanks, Roi. -------------- next part -------------- A non-text attachment was scrubbed... Name: bezier-fix.patch Type: text/x-patch Size: 1826 bytes Desc: not available Url : http://lists.freedesktop.org/archives/compiz/attachments/20070426/a9623fea/bezier-fix.bin
David Reveman
2007-May-01 15:13 UTC
[compiz] [PATCH]Make wobbly's bezier patch to work with grids that aren't 4x4.
On Thu, 2007-04-26 at 17:30 +0300, Roi Cohen wrote:> Hi, > > Recently, I started taking a look at wobbly's source (I was interested > in it's physics... ;-)) > I noticed that GRID_WIDTH and GRID_HEIGHT were defined to be 4, and I > wanted to see how the physics look like with grid sizes that aren't > 4x4. > I changed the defines to my new grid size, but unfortunately it didn't work. > I investigated this "bug" (it's not exactly a bug because users can't > change the grid size), and found out the bezier patch was written for > specifically 4x4 grids. > The attached patch makes the bezier patch to work on every grid size > defined (grid sizes could even be an option, although i think 4x4 > indeed gives the best effect).I think the bezierPatchEvaluate function that your patch modifies is one of the most CPU intensive functions that exist in the fdo compiz plugins. Hence, I'm concerned about how this patch affects performance. As the 4x4 grid still gives best results it might be better to just remove those defines from the top of the file and add a comment about the code being hard-coded to a grid size of 4x4. - David