Hello,
While reading the code of xrandr, I noticed some little possible
optimizations. Here they are :-)

Eric
--

The init_transform() function sets up a unit matrix, so only the scaling
factors need to be updated. Additionally, the code for the transform
option initialised twice the matrix, which is not needed.

Signed-off-by: Eric Piel <[email protected]>
---
 xrandr.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/xrandr.c b/xrandr.c
index bbdb348..5c369cd 100644
--- a/xrandr.c
+++ b/xrandr.c
@@ -2256,7 +2256,6 @@ main (int argc, char **argv)
            init_transform (&output->transform);
            output->transform.transform.matrix[0][0] = XDoubleToFixed (sx);
            output->transform.transform.matrix[1][1] = XDoubleToFixed (sy);
-           output->transform.transform.matrix[2][2] = XDoubleToFixed (1.0);
            if (sx != 1 || sy != 1)
                output->transform.filter = "bilinear";
            else
@@ -2279,7 +2278,6 @@ main (int argc, char **argv)
                           &transform[2][0],&transform[2][1],&transform[2][2])
                    != 9)
                    usage ();
-               init_transform (&output->transform);
                for (k = 0; k < 3; k++)
                    for (l = 0; l < 3; l++) {
                        output->transform.transform.matrix[k][l] = 
XDoubleToFixed
(transform[k][l]);
-- 
1.6.0.5

begin:vcard
fn;quoted-printable:=C3=89ric Piel
n;quoted-printable:Piel;=C3=89ric
org:Technical University of Delft;Software Engineering Research Group
adr:HB 08.080;;Mekelweg 4;Delft;;2628 CD;The Netherlands
email;internet:[email protected]
tel;work:+31 15 278 6338
tel;cell:+31 6 2437 9135
x-mozilla-html:FALSE
url:http://pieleric.free.fr
version:2.1
end:vcard

_______________________________________________
xorg mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/xorg

Reply via email to