wayland: Pre-multiply custom cursor image alpha

Since the Wayland SHM buffer format is implicitly premultiplied and the
GLFWimage pixels are defined to be non-premultiplied, we need to
convert the non-premultiplied pixels to premultiplied when filling the
buffer.

Related to #707.
This commit is contained in:
Jonas Ådahl
2016-02-17 13:51:08 +08:00
committed by Camilla Berglund
parent cb08dc574c
commit 71c72db1e3
2 changed files with 13 additions and 4 deletions
+7
View File
@@ -233,6 +233,13 @@ typedef VkResult (APIENTRY * PFN_vkEnumerateInstanceExtensionProperties)(const c
y = t; \
}
// Helper for non-premultiplied alpha to premultiplied alpha conversion
static inline unsigned char _glfwMultiplyAlpha(unsigned char alpha,
unsigned char value)
{
return (unsigned char) ((value * (unsigned int) alpha) / 255);
}
//========================================================================
// Platform-independent structures