From 7ae58b3208f26ae8fa177de32190861d4fbdc4b6 Mon Sep 17 00:00:00 2001 From: actionless Date: Sat, 5 Sep 2015 21:12:09 +0200 Subject: [PATCH] doc(lib: gears: surface): more verbose docstring Closes https://github.com/awesomeWM/awesome/pull/436. --- lib/gears/surface.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/gears/surface.lua b/lib/gears/surface.lua index e4042638a..c7a96d749 100644 --- a/lib/gears/surface.lua +++ b/lib/gears/surface.lua @@ -71,7 +71,14 @@ function surface.get_size(surf) end ---- Get the duplicate of a cairo surface +--- Create a copy of a cairo surface. +-- The surfaces returned by `surface.load` are cached and must not be +-- modified to avoid unintended side-effects. This function allows to create +-- a copy of a cairo surface. This copy can then be freely modified. +-- The surface returned will be as compatible as possible to the input +-- surface. For example, it will likely be of the same surface type as the +-- input. The details are explained in the `create_similar` function on a cairo +-- surface. -- @param s Source surface. -- @return The surface's duplicate. function surface.duplicate_surface(s)