if (freetype_inited) FT_Done_Face(ft_face);
- // I think the following is broken as it is, but also possibly it shouldn't be free()ing the memory
- // pointed at anyway, so it's correctly not working?!
-
- if (!fontnames.size())
- {
- std::vector<char*>::iterator itty = fontnames.begin();
-
- while (itty != fontnames.end())
- {
- free(*itty);
- itty++;
- }
- }
-
- // end
-
-
- if (fontnames_keys.size())
- {
- std::vector<char*>::iterator itty = fontnames_keys.begin();
-
- while (itty != fontnames_keys.end())
- {
- free(*itty);
- itty++;
- }
- }
+ for (char* c : fontnames) free(c);
+ for (char* c : fontnames_keys) free(c);
vgmutex.unlock();
taskmutex.unlock();
int OsdOpenVG::stopUpdate()
{
threadStop();
- processTasks();
+ processOpenVGCommands();
return 1;
}
}
Log::getInstance()->log("OSD", Log::DEBUG, "shutdown mark2");
- processTasks();
+ processOpenVGCommands();
Log::getInstance()->log("OSD", Log::DEBUG, "shutdown mark3");
taskmutex.lock();
ts = time1 - lastrendertime;
}
- if (processTasks()) ts = 0;
+ if (processOpenVGCommands()) ts = 0;
}
if (!threadIsActive())
}
//int imcount=0;// this is debug code and should not go into release
-unsigned int OsdOpenVG::handleTask(OpenVGCommand& command)
+unsigned int OsdOpenVG::handleOpenVGCommand(OpenVGCommand& command)
{
switch (command.task)
{
for (int i = 0; i < (style->num_colors - 1); i++)
{
colorramp[0 + (i + 1) * 5] = style->grad_pos[i];
- colorramp[1 + (i + 1) * 5] = style->grad_col[i].red / 255.f;
- colorramp[2 + (i + 1) * 5] = style->grad_col[i].green / 255.f;
- colorramp[3 + (i + 1) * 5] = style->grad_col[i].blue / 255.f;
- colorramp[4 + (i + 1) * 5] = style->grad_col[i].alpha / 255.f;
+ colorramp[1 + (i + 1) * 5] = static_cast<float>(style->grad_col[i].red) / 255.f;
+ colorramp[2 + (i + 1) * 5] = static_cast<float>(style->grad_col[i].green) / 255.f;
+ colorramp[3 + (i + 1) * 5] = static_cast<float>(style->grad_col[i].blue) / 255.f;
+ colorramp[4 + (i + 1) * 5] = static_cast<float>(style->grad_col[i].alpha) / 255.f;
}
colorramp[0 + (style->num_colors) * 5] = 1.f;
- colorramp[1 + (style->num_colors) * 5] = style->grad_col[style->num_colors - 1].red / 255.f;
- colorramp[2 + (style->num_colors) * 5] = style->grad_col[style->num_colors - 1].green / 255.f;
- colorramp[3 + (style->num_colors) * 5] = style->grad_col[style->num_colors - 1].blue / 255.f;
- colorramp[4 + (style->num_colors) * 5] = style->grad_col[style->num_colors - 1].alpha / 255.f;
+ colorramp[1 + (style->num_colors) * 5] = static_cast<float>(style->grad_col[style->num_colors - 1].red) / 255.f;
+ colorramp[2 + (style->num_colors) * 5] = static_cast<float>(style->grad_col[style->num_colors - 1].green) / 255.f;
+ colorramp[3 + (style->num_colors) * 5] = static_cast<float>(style->grad_col[style->num_colors - 1].blue) / 255.f;
+ colorramp[4 + (style->num_colors) * 5] = static_cast<float>(style->grad_col[style->num_colors - 1].alpha) / 255.f;
vgSetParameteri(handle, VG_PAINT_COLOR_RAMP_SPREAD_MODE, VG_COLOR_RAMP_SPREAD_REFLECT);
vgSetParameteri(handle, VG_PAINT_COLOR_RAMP_PREMULTIPLIED, VG_FALSE);
vgSetParameterfv(handle, VG_PAINT_COLOR_RAMP_STOPS, 5 + (style->num_colors) * 5, colorramp);
return 0;
}
-bool OsdOpenVG::processTasks()
+bool OsdOpenVG::processOpenVGCommands()
{
bool worked = false;
taskmutex.lock();
taskmutex.unlock();
OpenVGResponse resp;
- resp.result = handleTask(comm);
+ resp.result = handleOpenVGCommand(comm);
resp.id = comm.id;
taskmutex.lock();