diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-27 03:38:57 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-27 03:38:57 +1000 |
commit | 4585c9cafa87cad6b54397af7e9375cc31b72f89 (patch) | |
tree | befd016a13e95467197b2bd507198b53b262fead /source/core/StarDirectives.hpp | |
parent | 14e23a17ccf7d556d98e7dc76f1e7ad81fa70e93 (diff) |
Lazy-loading of ImageOperation inside Directives
also fixed cases of drawables not staying centered after adding directives that scale
Diffstat (limited to 'source/core/StarDirectives.hpp')
-rw-r--r-- | source/core/StarDirectives.hpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/core/StarDirectives.hpp b/source/core/StarDirectives.hpp index 8af2f51..f841373 100644 --- a/source/core/StarDirectives.hpp +++ b/source/core/StarDirectives.hpp @@ -5,6 +5,7 @@ #include "StarHash.hpp" #include "StarDataStream.hpp" #include "StarStringView.hpp" +#include "StarThread.hpp" namespace Star { @@ -17,10 +18,11 @@ class Directives { public: struct Shared; struct Entry { - ImageOperation operation; + mutable ImageOperation operation; size_t begin; size_t length; + ImageOperation const& loadOperation(Shared const& parent) const; inline StringView string(Shared const& parent) const; Entry(ImageOperation&& newOperation, size_t begin, size_t end); Entry(ImageOperation const& newOperation, size_t begin, size_t end); @@ -32,6 +34,7 @@ public: String string; StringView prefix; size_t hash = 0; + mutable Mutex mutex; bool empty() const; Shared(List<Entry>&& givenEntries, String&& givenString, StringView givenPrefix); @@ -42,6 +45,7 @@ public: Directives(String&& directives); Directives(const char* directives); + void loadOperations() const; void parse(String&& directives); String string() const; StringView prefix() const; |