From c26319f24a31dc897596d53cb27cadfdbbe9ea05 Mon Sep 17 00:00:00 2001 From: Inan Evin Date: Thu, 10 Oct 2024 18:17:56 +0300 Subject: [PATCH] v2.2.0 --- Example/include/Backends/GL/GLBackend.hpp | 2 +- Example/src/Backends/GL/GLBackend.cpp | 2 +- include/LinaVG/Core/BufferStore.hpp | 6 +++--- include/LinaVG/Core/Common.hpp | 6 +++--- src/Core/BufferStore.cpp | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Example/include/Backends/GL/GLBackend.hpp b/Example/include/Backends/GL/GLBackend.hpp index 07d0712..e30854d 100644 --- a/Example/include/Backends/GL/GLBackend.hpp +++ b/Example/include/Backends/GL/GLBackend.hpp @@ -99,7 +99,7 @@ struct Texture void StartFrame(); void DrawDefault(DrawBuffer* buf); - void DrawSimpleText(SimpleTextDrawBuffer* buf); + void DrawSimpleText(DrawBufferText* buf); void EndFrame(); void SaveAPIState(); void RestoreAPIState(); diff --git a/Example/src/Backends/GL/GLBackend.cpp b/Example/src/Backends/GL/GLBackend.cpp index d3ceea2..e88b85f 100644 --- a/Example/src/Backends/GL/GLBackend.cpp +++ b/Example/src/Backends/GL/GLBackend.cpp @@ -285,7 +285,7 @@ namespace LinaVG::Examples Config.debugCurrentVertexCount += buf->vertexBuffer.m_size; } - void GLBackend::DrawSimpleText(SimpleTextDrawBuffer* buf) + void GLBackend::DrawSimpleText(DrawBufferText* buf) { if (m_backendData.m_skipDraw) return; diff --git a/include/LinaVG/Core/BufferStore.hpp b/include/LinaVG/Core/BufferStore.hpp index b463e3b..50b81fc 100644 --- a/include/LinaVG/Core/BufferStore.hpp +++ b/include/LinaVG/Core/BufferStore.hpp @@ -68,7 +68,7 @@ namespace LinaVG struct BufferStoreData { Array m_defaultBuffers; - Array m_simpleTextBuffers; + Array m_simpleTextBuffers; Array m_drawOrders; LINAVG_MAP m_textCache; int m_gcFrameCounter = 0; @@ -84,7 +84,7 @@ namespace LinaVG int GetBufferIndexInDefaultArray(DrawBuffer* buf); int GetBufferIndexInCharArray(DrawBuffer* buf); DrawBuffer& GetDefaultBuffer(void* userData, int drawOrder, DrawBufferShapeType shapeType, TextureHandle txtHandle, const Vec4& textureUV); - SimpleTextDrawBuffer& GetSimpleTextBuffer(void* userData, Font* font, int drawOrder, bool isDropShadow, bool isSDF); + DrawBufferText& GetSimpleTextBuffer(void* userData, Font* font, int drawOrder, bool isDropShadow, bool isSDF); void AddTextCache(uint32_t sid, const TextOptions& opts, DrawBuffer* buf, int vtxStart, int indexStart); TextCache* CheckTextCache(uint32_t sid, const TextOptions& opts, DrawBuffer* buf); }; @@ -92,7 +92,7 @@ namespace LinaVG struct BufferStoreCallbacks { std::function drawDefault; - std::function drawSimpleText; + std::function drawSimpleText; }; class BufferStore diff --git a/include/LinaVG/Core/Common.hpp b/include/LinaVG/Core/Common.hpp index 608d881..f476df2 100644 --- a/include/LinaVG/Core/Common.hpp +++ b/include/LinaVG/Core/Common.hpp @@ -805,10 +805,10 @@ namespace LinaVG } }; - struct SimpleTextDrawBuffer : public DrawBuffer + struct DrawBufferText : public DrawBuffer { - SimpleTextDrawBuffer(){}; - SimpleTextDrawBuffer(void* userData, Font* font, int drawOrder, bool isDropShadow, bool sdf, BackendHandle clipPosX, BackendHandle clipPosY, BackendHandle clipSizeX, BackendHandle clipSizeY) + DrawBufferText(){}; + DrawBufferText(void* userData, Font* font, int drawOrder, bool isDropShadow, bool sdf, BackendHandle clipPosX, BackendHandle clipPosY, BackendHandle clipSizeX, BackendHandle clipSizeY) : DrawBuffer(userData, drawOrder, DrawBufferType::SimpleText, isDropShadow ? DrawBufferShapeType::DropShadow : DrawBufferShapeType::Shape, 0, Vec4(), clipPosX, clipPosY, clipSizeX, clipSizeY), font(font), isDropShadow(isDropShadow), isSDF(sdf){}; Font* font = nullptr; diff --git a/src/Core/BufferStore.cpp b/src/Core/BufferStore.cpp index fb3def6..369c258 100644 --- a/src/Core/BufferStore.cpp +++ b/src/Core/BufferStore.cpp @@ -125,7 +125,7 @@ namespace LinaVG for (int i = 0; i < m_data.m_simpleTextBuffers.m_size; i++) { - SimpleTextDrawBuffer& buf = m_data.m_simpleTextBuffers[i]; + DrawBufferText& buf = m_data.m_simpleTextBuffers[i]; if (buf.drawOrder == drawOrder && buf.shapeType == shapeType && buf.vertexBuffer.m_size != 0 && buf.indexBuffer.m_size != 0) { @@ -186,7 +186,7 @@ namespace LinaVG return m_defaultBuffers.last_ref(); } - SimpleTextDrawBuffer& BufferStoreData::GetSimpleTextBuffer(void* userData, Font* font, int drawOrder, bool isDropShadow, bool isSDF) + DrawBufferText& BufferStoreData::GetSimpleTextBuffer(void* userData, Font* font, int drawOrder, bool isDropShadow, bool isSDF) { for (int i = 0; i < m_simpleTextBuffers.m_size; i++) { @@ -197,7 +197,7 @@ namespace LinaVG SetDrawOrderLimits(drawOrder); - m_simpleTextBuffers.push_back(SimpleTextDrawBuffer(userData, font, drawOrder, isDropShadow, isSDF, m_clipPosX, m_clipPosY, m_clipSizeX, m_clipSizeY)); + m_simpleTextBuffers.push_back(DrawBufferText(userData, font, drawOrder, isDropShadow, isSDF, m_clipPosX, m_clipPosY, m_clipSizeX, m_clipSizeY)); return m_simpleTextBuffers.last_ref(); }