Skip to content

Commit 4191a20

Browse files
committed
GUIFont: Switch remaining APIs to std::span
1 parent 8ad2cff commit 4191a20

File tree

4 files changed

+14
-16
lines changed

4 files changed

+14
-16
lines changed

xbmc/guilib/GUIFont.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ std::string& CGUIFont::GetFontName()
8787

8888
void CGUIFont::DrawText(float x,
8989
float y,
90-
const std::vector<KODI::UTILS::COLOR::Color>& colors,
90+
std::span<const KODI::UTILS::COLOR::Color> colors,
9191
KODI::UTILS::COLOR::Color shadowColor,
92-
const vecText& text,
92+
std::span<const character_t> text,
9393
uint32_t alignment,
9494
float maxPixelWidth)
9595
{
@@ -179,9 +179,9 @@ bool CGUIFont::UpdateScrollInfo(std::span<const character_t> text, CScrollInfo&
179179

180180
void CGUIFont::DrawScrollingText(float x,
181181
float y,
182-
const std::vector<KODI::UTILS::COLOR::Color>& colors,
182+
std::span<const KODI::UTILS::COLOR::Color> colors,
183183
KODI::UTILS::COLOR::Color shadowColor,
184-
const vecText& text,
184+
std::span<const character_t> text,
185185
uint32_t alignment,
186186
float maxWidth,
187187
const CScrollInfo& scrollInfo)

xbmc/guilib/GUIFont.h

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,28 +126,26 @@ class CGUIFont
126126
float y,
127127
KODI::UTILS::COLOR::Color color,
128128
KODI::UTILS::COLOR::Color shadowColor,
129-
const vecText& text,
129+
std::span<const character_t> text,
130130
uint32_t alignment,
131131
float maxPixelWidth)
132132
{
133-
std::vector<KODI::UTILS::COLOR::Color> colors;
134-
colors.push_back(color);
135-
DrawText(x, y, colors, shadowColor, text, alignment, maxPixelWidth);
133+
DrawText(x, y, std::span(&color, 1), shadowColor, text, alignment, maxPixelWidth);
136134
};
137135

138136
void DrawText(float x,
139137
float y,
140-
const std::vector<KODI::UTILS::COLOR::Color>& colors,
138+
std::span<const KODI::UTILS::COLOR::Color> colors,
141139
KODI::UTILS::COLOR::Color shadowColor,
142-
const vecText& text,
140+
std::span<const character_t> text,
143141
uint32_t alignment,
144142
float maxPixelWidth);
145143

146144
void DrawScrollingText(float x,
147145
float y,
148-
const std::vector<KODI::UTILS::COLOR::Color>& colors,
146+
std::span<const KODI::UTILS::COLOR::Color> colors,
149147
KODI::UTILS::COLOR::Color shadowColor,
150-
const vecText& text,
148+
std::span<const character_t> text,
151149
uint32_t alignment,
152150
float maxPixelWidth,
153151
const CScrollInfo& scrollInfo);

xbmc/guilib/GUIFontTTF.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,8 @@ void CGUIFontTTF::End()
365365
void CGUIFontTTF::DrawTextInternal(CGraphicContext& context,
366366
float x,
367367
float y,
368-
const std::vector<KODI::UTILS::COLOR::Color>& colors,
369-
const vecText& text,
368+
std::span<const KODI::UTILS::COLOR::Color> colors,
369+
std::span<const character_t> text,
370370
uint32_t alignment,
371371
float maxPixelWidth,
372372
bool scrolling,

xbmc/guilib/GUIFontTTF.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ class CGUIFontTTF
160160
void DrawTextInternal(CGraphicContext& context,
161161
float x,
162162
float y,
163-
const std::vector<KODI::UTILS::COLOR::Color>& colors,
164-
const vecText& text,
163+
std::span<const KODI::UTILS::COLOR::Color> colors,
164+
std::span<const character_t> text,
165165
uint32_t alignment,
166166
float maxPixelWidth,
167167
bool scrolling,

0 commit comments

Comments
 (0)