xresources theme: Use a RecordingSurface for wallpaper
This theme draws a minimal wallpaper directly. This commit replaces the ImageSurface of the wallpaper with a RecordingSurface. This shouldn't have any visible effect, except for reducing memory usage, because an ImageSurface needs a lot of memory and is only eventually released by the garbage collector. A RecordingSurface instead just records the operations that were done which needs a lot less memory for the simple operations done here. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
1714a6513b
commit
daf05e6eb1
|
@ -51,7 +51,8 @@ function theme_assets.wallpaper(bg, fg, alt_fg, s)
|
||||||
s = s or screen.primary
|
s = s or screen.primary
|
||||||
local height = s.workarea.height
|
local height = s.workarea.height
|
||||||
local width = s.workarea.width
|
local width = s.workarea.width
|
||||||
local img = cairo.ImageSurface(cairo.Format.ARGB32, width, height)
|
local img = cairo.RecordingSurface(cairo.Content.COLOR,
|
||||||
|
cairo.Rectangle { x = 0, y = 0, width = width, height = height })
|
||||||
local cr = cairo.Context(img)
|
local cr = cairo.Context(img)
|
||||||
|
|
||||||
local letter_size = height/10
|
local letter_size = height/10
|
||||||
|
|
Loading…
Reference in New Issue