1/* 2 3Settings for the Skia library. We compile the Skia library with these 4settings and also LO code uses this header to ensure the settings 5are the same. 6*/ 7 8#ifndef CONFIG_SKIA_H 9#define CONFIG_SKIA_H 10 11// This is a setting that should be set manually and it affects LO 12// code rather than Skia itself. It basically controls setting 13// BackendCapabilities::mbSupportsBitmap32, i.e. whether one LO bitmap 14// contains all the 32bits of an image including the alpha (premultiplied). 15// 16// Since Skia does not natively support 24bpp, the preferred setup is 17// that the setting should be enabled, it makes the code faster and cleaner. 18// 19// Unfortunately VCL historically splits alpha into a whole separate 20// bitmap and works with 24bpp+8bpp, which is generally more complicated, 21// more error-prone and just worse, but that's how LO code has been 22// written and so there are many places in LO that expect this and 23// do not work correctly with true 32bpp bitmaps. 24// 25// So ultimately the 24+8 split should be dumped (preferably in all of LO, 26// not just the Skia-related code), but until all of LO works correctly 27// with 32bpp keep this disabled in order to avoid such breakages. 28 29//#define SKIA_USE_BITMAP32 1 30#define SKIA_USE_BITMAP32 0 31 32 33 34#define SK_SUPPORT_GPU 1 35 36#define SK_VULKAN 1 37 38// Memory allocator for Vulkan. 39#define SK_USE_VMA 1 40 41// Set by Skia's BUILD.gn. 42#define GR_OP_ALLOCATE_USE_NEW 43 44#define SK_CODEC_DECODES_PNG 1 45#define SK_ENCODE_PNG 1 46 47// These are just to avoid warnings (some headers use them even with GL disabled). 48#define SK_ASSUME_GL 1 49#define SK_ASSUME_GL_ES 0 50 51// See https://codereview.chromium.org/2089583002 . This makes raster drawing 52// faster in some cases, it was made conditional because of some tests failing, 53// but if I'm reading the review correctly the code is in fact fine and just 54// those tests needed updating, which presumably has never happened. 55#define SK_DRAWBITMAPRECT_FAST_OFFSET 1 56 57// Default to BGRA. Skia already defaults to that on Windows, and it seems 58// the default X11 visual is actually also BGRA. 59#define SK_R32_SHIFT 16 60 61// Enable Skia's internal checks depending on DBG_UTIL mode. ENABLE_SKIA_DEBUG 62// controls whether to build with or without optimizations (set in Makefile). 63#ifdef DBG_UTIL 64 65#define SK_DEBUG 66 67#define SK_ENABLE_DUMP_GPU 68 69#else 70 71#define SK_RELEASE 72 73#endif // DBG_UTIL 74 75// TODO ? 76//#define SK_R32_SHIFT 16 77 78#endif 79