Commit Graph

6 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult 7752d8450d glamor: replace xallocarray() by calloc()
Only key difference that calloc(), in contrast to rellocarray(),
is zero-initializing. The overhead is hard to measure on today's
machines, and it's safer programming practise to always allocate
zero-initialized, so one can't forget to do it explicitly.

Cocci rule:

    @@
    expression COUNT;
    expression LEN;
    @@
    - xallocarray(COUNT,LEN)
    + calloc(COUNT,LEN)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 8d95320217 glamor: fix missing include of dix-config.h
This header needs to be included first, otherwise things can easily get really
messed up. The current code only works by accident, because some other header
already including it early enough - but a subtle change in include order
can easy break it.

Thus, always make sure the header is really included first.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:32 +02:00
Michel Dänzer d4e11f4c92 glamor: Make glamor_solid_boxes take a DrawablePtr
Instead of a PixmapPtr. Gives better results if the window depth
doesn't match the backing pixmap depth.

Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1565
2023-07-20 10:14:56 +02:00
Alan Coopersmith f59236c286 Convert glamor & glx to new *allocarray functions
v2: fixup whitespace

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-04-21 16:58:08 -07:00
Eric Anholt d71ecbb458 glamor: Drop constant arguments to glamor_solid().
After keithp's change to drop the old glamor_fill() code, nothing ever
changed these values.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-07-17 17:34:29 -07:00
Keith Packard 18c09e60bf glamor: Replace glamor_solid_boxes and glamor_solid with GC using code
This provides glamor_solid_boxes and glamor_solid using regular GC
operations instead of calling directly to underlying rendering
functions. This will allow the old rendering code to be removed.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-06-15 23:17:58 +01:00