f8c15850db
(from m111) SK_SUPPORT_GPU is now SK_GANESH GR_OP_ALLOCATE_USE_NEW was removed in skia m111 commit dd8f8ed3848cbe2032edc7ec08ef648a23e28ad9 Author: Mike Klein <mtklein@google.com> Date: Thu Apr 22 12:17:33 2021 -0500 clean up defines that do nothing the fast-png-write patch was removed. The underlying helper function we need was removed in commit 0ec4c84abd0b578a5c792b04b56653cbc325530e Author: Kevin Lubick <kjlubick@google.com> Date: Thu Apr 20 14:46:28 2023 -0400 Remove SkImageEncoder and SkImage::encodeToData So I updated our dump() function in SkiaHelper.cxx to use the new Skia API. The constexpr-template patch seems to be superceded by skia changes. SkOpts: :hash_fn has been replaced with SkChecksum::Hash32 commit 657ed9cf2379a950b925cb2aba7c85d6e1dd36ed Author: Brian Osman <brianosman@google.com> Date: Tue May 23 12:40:12 2023 +0000 Reland "Replace SkOpts::hash/hash_fn with SkChecksum::Hash32" The SkDebugf function needs to be exported from the library since it leaks out to calling code via some of the headers. Change-Id: I80ace8f25e660fa7889d22ef90676f47264d866c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154223 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
80 lines
2.5 KiB
C
80 lines
2.5 KiB
C
/*
|
|
|
|
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
|
|
|
|
// This is a setting that should be set manually and it affects LO
|
|
// code rather than Skia itself. It basically controls setting
|
|
// BackendCapabilities::mbSupportsBitmap32, i.e. whether one LO bitmap
|
|
// contains all the 32bits of an image including the alpha (premultiplied).
|
|
//
|
|
// Since Skia does not natively support 24bpp, the preferred setup is
|
|
// that the setting should be enabled, it makes the code faster and cleaner.
|
|
//
|
|
// 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.
|
|
//
|
|
// 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
|
|
// with 32bpp keep this disabled in order to avoid such breakages.
|
|
|
|
//#define SKIA_USE_BITMAP32 1
|
|
#define SKIA_USE_BITMAP32 0
|
|
|
|
|
|
// GPU support (set by configure).
|
|
#undef SK_GANESH
|
|
// Vulkan support enabled (set by configure).
|
|
#undef SK_VULKAN
|
|
// Metal support enabled (set by configure).
|
|
#undef SK_METAL
|
|
|
|
// Memory allocator for Vulkan.
|
|
#define SK_USE_VMA 1
|
|
|
|
#define SK_CODEC_DECODES_PNG 1
|
|
#define SK_ENCODE_PNG 1
|
|
|
|
// These are just to avoid warnings (some headers use them even with GL disabled).
|
|
#define SK_ASSUME_GL 1
|
|
#define SK_ASSUME_GL_ES 0
|
|
|
|
#define SK_ENABLE_SKSL 1
|
|
|
|
// 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
|
|
|
|
// 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
|
|
|
|
// 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.
|
|
#ifdef DBG_UTIL
|
|
|
|
#define SK_DEBUG
|
|
|
|
#define SK_ENABLE_DUMP_GPU
|
|
|
|
#else
|
|
|
|
#define SK_RELEASE
|
|
|
|
#endif // DBG_UTIL
|
|
|
|
// TODO ?
|
|
//#define SK_R32_SHIFT 16
|
|
|
|
#endif
|