diff options
author | Martin Capitanio <capnm@capitanio.org> | 2024-01-05 18:01:00 +0100 |
---|---|---|
committer | Martin Capitanio <capnm@capitanio.org> | 2024-01-08 09:59:43 +0100 |
commit | e090b112efe049233ea4b36e83f901ca507ac14e (patch) | |
tree | c5220f7ef3b069b01a51c27a949f3f6d858ea60b /thirdparty/thorvg/src/renderer/tvgRender.h | |
parent | c8c483cf57a768110fce57e509f9b855e69d34b7 (diff) | |
download | redot-engine-e090b112efe049233ea4b36e83f901ca507ac14e.tar.gz |
ThorVG: update from v0.11.6 to v0.12.0
https://github.com/thorvg/thorvg/releases/tag/v0.12.0
Godot-related SVG bug fixes:
+ [SwEngine] Fixed a linear filling scaling issue.
thorvg/thorvg#1834
+ [SwEngine] Path data not invalid even though
it doesn't start with MoveTo.
thorvg/thorvg#1848
Fixes #86128 Gradient issue.
Diffstat (limited to 'thirdparty/thorvg/src/renderer/tvgRender.h')
-rw-r--r-- | thirdparty/thorvg/src/renderer/tvgRender.h | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/thirdparty/thorvg/src/renderer/tvgRender.h b/thirdparty/thorvg/src/renderer/tvgRender.h index 6c0a7d5f13..1e70b53494 100644 --- a/thirdparty/thorvg/src/renderer/tvgRender.h +++ b/thirdparty/thorvg/src/renderer/tvgRender.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 - 2023 the ThorVG project. All rights reserved. + * Copyright (c) 2020 - 2024 the ThorVG project. All rights reserved. * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -23,6 +23,7 @@ #ifndef _TVG_RENDER_H_ #define _TVG_RENDER_H_ +#include <mutex> #include "tvgCommon.h" #include "tvgArray.h" @@ -49,17 +50,33 @@ enum ColorSpace struct Surface { union { - pixel_t* data; //system based data pointer - uint32_t* buf32; //for explicit 32bits channels - uint8_t* buf8; //for explicit 8bits grayscale + pixel_t* data = nullptr; //system based data pointer + uint32_t* buf32; //for explicit 32bits channels + uint8_t* buf8; //for explicit 8bits grayscale }; - uint32_t stride; - uint32_t w, h; - ColorSpace cs; - uint8_t channelSize; + mutex mtx; //used for thread safety + uint32_t stride = 0; + uint32_t w = 0, h = 0; + ColorSpace cs = ColorSpace::Unsupported; + uint8_t channelSize = 0; + bool premultiplied = 0; //Alpha-premultiplied + + Surface() + { + } + + Surface(const Surface* rhs) + { + data = rhs->data; + stride = rhs->stride; + w = rhs->w; + h = rhs->h; + cs = rhs->cs; + channelSize = rhs->channelSize; + premultiplied = rhs->premultiplied; + } + - bool premultiplied; //Alpha-premultiplied - bool owner; //Only owner could modify the buffer }; struct Compositor |