2019-10-17 05:07:48 -05:00
|
|
|
/*
|
|
|
|
|
|
|
|
Settings for the Skia library. We compile the Skia library with these
|
|
|
|
settings and also LO code uses this header to ensure the settings
|
|
|
|
are the same.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CONFIG_SKIA_H
|
|
|
|
#define CONFIG_SKIA_H
|
|
|
|
|
2020-09-23 03:50:57 -05:00
|
|
|
// This is a setting that should be set manually and it affects LO
|
2020-01-09 07:10:00 -06:00
|
|
|
// code rather than Skia itself. It basically controls setting
|
2020-09-23 03:50:57 -05:00
|
|
|
// BackendCapabilities::mbSupportsBitmap32, i.e. whether one LO bitmap
|
|
|
|
// contains all the 32bits of an image including the alpha (premultiplied).
|
|
|
|
//
|
2020-01-09 07:10:00 -06:00
|
|
|
// Since Skia does not natively support 24bpp, the preferred setup is
|
|
|
|
// that the setting should be enabled, it makes the code faster and cleaner.
|
2020-09-23 03:50:57 -05:00
|
|
|
//
|
2020-01-09 07:10:00 -06:00
|
|
|
// Unfortunately VCL historically splits alpha into a whole separate
|
|
|
|
// bitmap and works with 24bpp+8bpp, which is generally more complicated,
|
|
|
|
// more error-prone and just worse, but that's how LO code has been
|
|
|
|
// written and so there are many places in LO that expect this and
|
|
|
|
// do not work correctly with true 32bpp bitmaps.
|
2020-09-23 03:50:57 -05:00
|
|
|
//
|
2020-01-09 07:10:00 -06:00
|
|
|
// So ultimately the 24+8 split should be dumped (preferably in all of LO,
|
|
|
|
// not just the Skia-related code), but until all of LO works correctly
|
2020-09-23 03:50:57 -05:00
|
|
|
// with 32bpp keep this disabled in order to avoid such breakages.
|
|
|
|
|
2020-01-26 14:41:01 -06:00
|
|
|
//#define SKIA_USE_BITMAP32 1
|
|
|
|
#define SKIA_USE_BITMAP32 0
|
2020-01-09 07:10:00 -06:00
|
|
|
|
|
|
|
|
2021-08-18 12:26:45 -05:00
|
|
|
// GPU support (set by configure).
|
2023-07-08 13:28:29 -05:00
|
|
|
#undef SK_GANESH
|
2021-08-18 12:26:45 -05:00
|
|
|
// Vulkan support enabled (set by configure).
|
2021-08-23 10:57:48 -05:00
|
|
|
#undef SK_VULKAN
|
2021-08-18 12:26:45 -05:00
|
|
|
// Metal support enabled (set by configure).
|
|
|
|
#undef SK_METAL
|
2019-10-17 05:07:48 -05:00
|
|
|
|
2020-05-18 04:47:01 -05:00
|
|
|
// Memory allocator for Vulkan.
|
|
|
|
#define SK_USE_VMA 1
|
|
|
|
|
2020-03-17 14:45:04 -05:00
|
|
|
#define SK_CODEC_DECODES_PNG 1
|
|
|
|
#define SK_ENCODE_PNG 1
|
2019-10-17 05:07:48 -05:00
|
|
|
|
2020-04-06 06:05:06 -05:00
|
|
|
// These are just to avoid warnings (some headers use them even with GL disabled).
|
2019-10-17 05:07:48 -05:00
|
|
|
#define SK_ASSUME_GL 1
|
|
|
|
#define SK_ASSUME_GL_ES 0
|
|
|
|
|
2021-05-25 05:13:24 -05:00
|
|
|
#define SK_ENABLE_SKSL 1
|
|
|
|
|
2020-06-24 03:30:01 -05:00
|
|
|
// See https://codereview.chromium.org/2089583002 . This makes raster drawing
|
|
|
|
// faster in some cases, it was made conditional because of some tests failing,
|
|
|
|
// but if I'm reading the review correctly the code is in fact fine and just
|
|
|
|
// those tests needed updating, which presumably has never happened.
|
|
|
|
#define SK_DRAWBITMAPRECT_FAST_OFFSET 1
|
2019-10-17 05:07:48 -05:00
|
|
|
|
2020-10-02 13:36:27 -05:00
|
|
|
// Default to BGRA. Skia already defaults to that on Windows, and it seems
|
|
|
|
// the default X11 visual is actually also BGRA.
|
|
|
|
#define SK_R32_SHIFT 16
|
|
|
|
|
2023-01-26 03:51:11 -06:00
|
|
|
// Enable Skia's internal checks depending on DBG_UTIL mode.
|
|
|
|
// ENABLE_SKIA_DEBUG controls whether to build with or without optimizations, and
|
|
|
|
// is set by using --enable-skia=debug.
|
2019-10-17 05:07:48 -05:00
|
|
|
#ifdef DBG_UTIL
|
|
|
|
|
|
|
|
#define SK_DEBUG
|
|
|
|
|
|
|
|
#define SK_ENABLE_DUMP_GPU
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
2020-08-28 04:55:57 -05:00
|
|
|
#define SK_RELEASE
|
2019-10-17 05:07:48 -05:00
|
|
|
|
|
|
|
#endif // DBG_UTIL
|
|
|
|
|
|
|
|
// TODO ?
|
|
|
|
//#define SK_R32_SHIFT 16
|
|
|
|
|
|
|
|
#endif
|