mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-20 06:52:03 +00:00
common: fix compile warnings.
--Werror=unused-parameter Change-Id: If4c04e3e20b67be62b50c3b1e2e909dbd848eccc
This commit is contained in:
parent
ad48f7d8ba
commit
7214559ad9
8 changed files with 32 additions and 32 deletions
|
@ -63,7 +63,7 @@ bool GlGeometry::decomposeOutline(const Shape &shape)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GlGeometry::generateAAPoints(const Shape &shape, float strokeWd, RenderUpdateFlag flag)
|
bool GlGeometry::generateAAPoints(TVG_UNUSED const Shape &shape, float strokeWd, RenderUpdateFlag flag)
|
||||||
{
|
{
|
||||||
for (auto& shapeGeometry : mPrimitives)
|
for (auto& shapeGeometry : mPrimitives)
|
||||||
{
|
{
|
||||||
|
@ -128,7 +128,7 @@ bool GlGeometry::generateAAPoints(const Shape &shape, float strokeWd, RenderUpda
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GlGeometry::tesselate(const Shape &shape, float viewWd, float viewHt, RenderUpdateFlag flag)
|
bool GlGeometry::tesselate(TVG_UNUSED const Shape &shape, float viewWd, float viewHt, RenderUpdateFlag flag)
|
||||||
{
|
{
|
||||||
for (auto& shapeGeometry : mPrimitives)
|
for (auto& shapeGeometry : mPrimitives)
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,7 +41,7 @@ bool GlRenderer::clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool GlRenderer::target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h)
|
bool GlRenderer::target(TVG_UNUSED uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h)
|
||||||
{
|
{
|
||||||
assert(w > 0 && h > 0);
|
assert(w > 0 && h > 0);
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ bool GlRenderer::render(const Shape& shape, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool GlRenderer::dispose(const Shape& shape, void *data)
|
bool GlRenderer::dispose(TVG_UNUSED const Shape& shape, void *data)
|
||||||
{
|
{
|
||||||
GlShape* sdata = static_cast<GlShape*>(data);
|
GlShape* sdata = static_cast<GlShape*>(data);
|
||||||
if (!sdata) return false;
|
if (!sdata) return false;
|
||||||
|
@ -119,7 +119,7 @@ bool GlRenderer::dispose(const Shape& shape, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void* GlRenderer::prepare(const Shape& shape, void* data, const RenderTransform* transform, RenderUpdateFlag flags)
|
void* GlRenderer::prepare(const Shape& shape, void* data, TVG_UNUSED const RenderTransform* transform, RenderUpdateFlag flags)
|
||||||
{
|
{
|
||||||
//prepare shape data
|
//prepare shape data
|
||||||
GlShape* sdata = static_cast<GlShape*>(data);
|
GlShape* sdata = static_cast<GlShape*>(data);
|
||||||
|
|
|
@ -129,7 +129,7 @@ bool SwRenderer::flush()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SwRenderer::render(const Shape& sdata, void *data)
|
bool SwRenderer::render(TVG_UNUSED const Shape& sdata, TVG_UNUSED void *data)
|
||||||
{
|
{
|
||||||
//Do Nothing
|
//Do Nothing
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ bool SwRenderer::render(const Shape& sdata, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SwRenderer::dispose(const Shape& sdata, void *data)
|
bool SwRenderer::dispose(TVG_UNUSED const Shape& sdata, void *data)
|
||||||
{
|
{
|
||||||
auto task = static_cast<SwTask*>(data);
|
auto task = static_cast<SwTask*>(data);
|
||||||
if (!task) return true;
|
if (!task) return true;
|
||||||
|
|
|
@ -470,7 +470,7 @@ bool shapePrepare(SwShape& shape, const Shape* sdata, const SwSize& clip, const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool shapeGenRle(SwShape& shape, const Shape* sdata, const SwSize& clip, bool antiAlias)
|
bool shapeGenRle(SwShape& shape, TVG_UNUSED const Shape* sdata, const SwSize& clip, bool antiAlias)
|
||||||
{
|
{
|
||||||
//FIXME: Should we draw it?
|
//FIXME: Should we draw it?
|
||||||
//Case: Stroke Line
|
//Case: Stroke Line
|
||||||
|
|
|
@ -141,7 +141,7 @@ bool simpleXmlParse(const char* buf, unsigned bufLength, bool strip, simpleXMLCb
|
||||||
do { \
|
do { \
|
||||||
size_t _sz = end - start; \
|
size_t _sz = end - start; \
|
||||||
bool _ret; \
|
bool _ret; \
|
||||||
_ret = func((void*)data, type, start, start - buf, _sz); \
|
_ret = func((void*)data, type, start, _sz); \
|
||||||
if (!_ret) \
|
if (!_ret) \
|
||||||
return false; \
|
return false; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
|
@ -20,7 +20,7 @@ enum class SimpleXMLType
|
||||||
DoctypeChild //!< \<!doctype_child
|
DoctypeChild //!< \<!doctype_child
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef bool (*simpleXMLCb)(void* data, SimpleXMLType type, const char* content, unsigned offset, unsigned length);
|
typedef bool (*simpleXMLCb)(void* data, SimpleXMLType type, const char* content, unsigned length);
|
||||||
typedef bool (*simpleXMLAttributeCb)(void* data, const char* key, const char* value);
|
typedef bool (*simpleXMLAttributeCb)(void* data, const char* key, const char* value);
|
||||||
|
|
||||||
bool simpleXmlParseAttributes(const char* buf, unsigned buflen, simpleXMLAttributeCb func, const void* data);
|
bool simpleXmlParseAttributes(const char* buf, unsigned buflen, simpleXMLAttributeCb func, const void* data);
|
||||||
|
|
|
@ -727,7 +727,7 @@ static bool _attrParseSvgNode(void* data, const char* key, const char* value)
|
||||||
|
|
||||||
|
|
||||||
//https://www.w3.org/TR/SVGTiny12/painting.html#SpecifyingPaint
|
//https://www.w3.org/TR/SVGTiny12/painting.html#SpecifyingPaint
|
||||||
static void _handlePaintAttr(SvgLoaderData* loader, SvgPaint* paint, const char* value)
|
static void _handlePaintAttr(SvgPaint* paint, const char* value)
|
||||||
{
|
{
|
||||||
if (!strcmp(value, "none")) {
|
if (!strcmp(value, "none")) {
|
||||||
//No paint property
|
//No paint property
|
||||||
|
@ -743,30 +743,30 @@ static void _handlePaintAttr(SvgLoaderData* loader, SvgPaint* paint, const char*
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void _handleColorAttr(SvgLoaderData* loader, SvgNode* node, const char* value)
|
static void _handleColorAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value)
|
||||||
{
|
{
|
||||||
SvgStyleProperty* style = node->style;
|
SvgStyleProperty* style = node->style;
|
||||||
_toColor(value, &style->r, &style->g, &style->b, nullptr);
|
_toColor(value, &style->r, &style->g, &style->b, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void _handleFillAttr(SvgLoaderData* loader, SvgNode* node, const char* value)
|
static void _handleFillAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value)
|
||||||
{
|
{
|
||||||
SvgStyleProperty* style = node->style;
|
SvgStyleProperty* style = node->style;
|
||||||
style->fill.flags = (SvgFillFlags)((int)style->fill.flags | (int)SvgFillFlags::Paint);
|
style->fill.flags = (SvgFillFlags)((int)style->fill.flags | (int)SvgFillFlags::Paint);
|
||||||
_handlePaintAttr(loader, &style->fill.paint, value);
|
_handlePaintAttr(&style->fill.paint, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void _handleStrokeAttr(SvgLoaderData* loader, SvgNode* node, const char* value)
|
static void _handleStrokeAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value)
|
||||||
{
|
{
|
||||||
SvgStyleProperty* style = node->style;
|
SvgStyleProperty* style = node->style;
|
||||||
style->stroke.flags = (SvgStrokeFlags)((int)style->stroke.flags | (int)SvgStrokeFlags::Paint);
|
style->stroke.flags = (SvgStrokeFlags)((int)style->stroke.flags | (int)SvgStrokeFlags::Paint);
|
||||||
_handlePaintAttr(loader, &style->stroke.paint, value);
|
_handlePaintAttr(&style->stroke.paint, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void _handleStrokeOpacityAttr(SvgLoaderData* loader, SvgNode* node, const char* value)
|
static void _handleStrokeOpacityAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value)
|
||||||
{
|
{
|
||||||
node->style->stroke.flags = (SvgStrokeFlags)((int)node->style->stroke.flags | (int)SvgStrokeFlags::Opacity);
|
node->style->stroke.flags = (SvgStrokeFlags)((int)node->style->stroke.flags | (int)SvgStrokeFlags::Opacity);
|
||||||
node->style->stroke.opacity = _toOpacity(value);
|
node->style->stroke.opacity = _toOpacity(value);
|
||||||
|
@ -780,47 +780,47 @@ static void _handleStrokeWidthAttr(SvgLoaderData* loader, SvgNode* node, const c
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void _handleStrokeLineCapAttr(SvgLoaderData* loader, SvgNode* node, const char* value)
|
static void _handleStrokeLineCapAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value)
|
||||||
{
|
{
|
||||||
node->style->stroke.flags = (SvgStrokeFlags)((int)node->style->stroke.flags | (int)SvgStrokeFlags::Cap);
|
node->style->stroke.flags = (SvgStrokeFlags)((int)node->style->stroke.flags | (int)SvgStrokeFlags::Cap);
|
||||||
node->style->stroke.cap = _toLineCap(value);
|
node->style->stroke.cap = _toLineCap(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void _handleStrokeLineJoinAttr(SvgLoaderData* loader, SvgNode* node, const char* value)
|
static void _handleStrokeLineJoinAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value)
|
||||||
{
|
{
|
||||||
node->style->stroke.flags = (SvgStrokeFlags)((int)node->style->stroke.flags | (int)SvgStrokeFlags::Join);
|
node->style->stroke.flags = (SvgStrokeFlags)((int)node->style->stroke.flags | (int)SvgStrokeFlags::Join);
|
||||||
node->style->stroke.join = _toLineJoin(value);
|
node->style->stroke.join = _toLineJoin(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void _handleFillRuleAttr(SvgLoaderData* loader, SvgNode* node, const char* value)
|
static void _handleFillRuleAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value)
|
||||||
{
|
{
|
||||||
node->style->fill.flags = (SvgFillFlags)((int)node->style->fill.flags | (int)SvgFillFlags::FillRule);
|
node->style->fill.flags = (SvgFillFlags)((int)node->style->fill.flags | (int)SvgFillFlags::FillRule);
|
||||||
node->style->fill.fillRule = _toFillRule(value);
|
node->style->fill.fillRule = _toFillRule(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void _handleOpacityAttr(SvgLoaderData* loader, SvgNode* node, const char* value)
|
static void _handleOpacityAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value)
|
||||||
{
|
{
|
||||||
node->style->opacity = _toOpacity(value);
|
node->style->opacity = _toOpacity(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void _handleFillOpacityAttr(SvgLoaderData* loader, SvgNode* node, const char* value)
|
static void _handleFillOpacityAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value)
|
||||||
{
|
{
|
||||||
node->style->fill.flags = (SvgFillFlags)((int)node->style->fill.flags | (int)SvgFillFlags::Opacity);
|
node->style->fill.flags = (SvgFillFlags)((int)node->style->fill.flags | (int)SvgFillFlags::Opacity);
|
||||||
node->style->fill.opacity = _toOpacity(value);
|
node->style->fill.opacity = _toOpacity(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void _handleTransformAttr(SvgLoaderData* loader, SvgNode* node, const char* value)
|
static void _handleTransformAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value)
|
||||||
{
|
{
|
||||||
node->transform = _parseTransformationMatrix(value);
|
node->transform = _parseTransformationMatrix(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void _handleDisplayAttr(SvgLoaderData* loader, SvgNode* node, const char* value)
|
static void _handleDisplayAttr(TVG_UNUSED SvgLoaderData* loader, SvgNode* node, const char* value)
|
||||||
{
|
{
|
||||||
//TODO : The display attribute can have various values as well as "none".
|
//TODO : The display attribute can have various values as well as "none".
|
||||||
// The default is "inline" which means visible and "none" means invisible.
|
// The default is "inline" which means visible and "none" means invisible.
|
||||||
|
@ -946,7 +946,7 @@ static SvgNode* _createNode(SvgNode* parent, SvgNodeType type)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static SvgNode* _createDefsNode(SvgLoaderData* loader, SvgNode* parent, const char* buf, unsigned bufLength)
|
static SvgNode* _createDefsNode(TVG_UNUSED SvgLoaderData* loader, TVG_UNUSED SvgNode* parent, const char* buf, unsigned bufLength)
|
||||||
{
|
{
|
||||||
SvgNode* node = _createNode(nullptr, SvgNodeType::Defs);
|
SvgNode* node = _createNode(nullptr, SvgNodeType::Defs);
|
||||||
simpleXmlParseAttributes(buf, bufLength, nullptr, node);
|
simpleXmlParseAttributes(buf, bufLength, nullptr, node);
|
||||||
|
@ -954,7 +954,7 @@ static SvgNode* _createDefsNode(SvgLoaderData* loader, SvgNode* parent, const ch
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static SvgNode* _createGNode(SvgLoaderData* loader, SvgNode* parent, const char* buf, unsigned bufLength)
|
static SvgNode* _createGNode(TVG_UNUSED SvgLoaderData* loader, SvgNode* parent, const char* buf, unsigned bufLength)
|
||||||
{
|
{
|
||||||
loader->svgParse->node = _createNode(parent, SvgNodeType::G);
|
loader->svgParse->node = _createNode(parent, SvgNodeType::G);
|
||||||
|
|
||||||
|
@ -1907,7 +1907,7 @@ static constexpr struct
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static void _svgLoaderParerXmlClose(SvgLoaderData* loader, const char* content, unsigned int length)
|
static void _svgLoaderParerXmlClose(SvgLoaderData* loader, const char* content)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
|
@ -1999,7 +1999,7 @@ static void _svgLoaderParserXmlOpen(SvgLoaderData* loader, const char* content,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static bool _svgLoaderParser(void* data, SimpleXMLType type, const char* content, unsigned int offset, unsigned int length)
|
static bool _svgLoaderParser(void* data, SimpleXMLType type, const char* content, unsigned int length)
|
||||||
{
|
{
|
||||||
SvgLoaderData* loader = (SvgLoaderData*)data;
|
SvgLoaderData* loader = (SvgLoaderData*)data;
|
||||||
|
|
||||||
|
@ -2013,7 +2013,7 @@ static bool _svgLoaderParser(void* data, SimpleXMLType type, const char* content
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SimpleXMLType::Close: {
|
case SimpleXMLType::Close: {
|
||||||
_svgLoaderParerXmlClose(loader, content, length);
|
_svgLoaderParerXmlClose(loader, content);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SimpleXMLType::Data:
|
case SimpleXMLType::Data:
|
||||||
|
@ -2238,7 +2238,7 @@ static bool _svgLoaderParserForValidCheckXmlOpen(SvgLoaderData* loader, const ch
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static bool _svgLoaderParserForValidCheck(void* data, SimpleXMLType type, const char* content, unsigned int offset, unsigned int length)
|
static bool _svgLoaderParserForValidCheck(void* data, SimpleXMLType type, const char* content, unsigned int length)
|
||||||
{
|
{
|
||||||
SvgLoaderData* loader = (SvgLoaderData*)data;
|
SvgLoaderData* loader = (SvgLoaderData*)data;
|
||||||
bool res = true;;
|
bool res = true;;
|
||||||
|
|
|
@ -36,7 +36,7 @@ static bool _parseLong(char** content, int* number)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _pathAppendArcTo(vector<PathCommand>* cmds, vector<Point>* pts, float* arr, Point* cur, Point* curCtl, float x, float y, float rx, float ry, float angle, bool largeArc, bool sweep)
|
void _pathAppendArcTo(vector<PathCommand>* cmds, vector<Point>* pts, Point* cur, Point* curCtl, float x, float y, float rx, float ry, float angle, bool largeArc, bool sweep)
|
||||||
{
|
{
|
||||||
float cxp, cyp, cx, cy;
|
float cxp, cyp, cx, cy;
|
||||||
float sx, sy;
|
float sx, sy;
|
||||||
|
@ -394,7 +394,7 @@ static void _processCommand(vector<PathCommand>* cmds, vector<Point>* pts, char
|
||||||
}
|
}
|
||||||
case 'a':
|
case 'a':
|
||||||
case 'A': {
|
case 'A': {
|
||||||
_pathAppendArcTo(cmds, pts, arr, cur, curCtl, arr[5], arr[6], arr[0], arr[1], arr[2], arr[3], arr[4]);
|
_pathAppendArcTo(cmds, pts, cur, curCtl, arr[5], arr[6], arr[0], arr[1], arr[2], arr[3], arr[4]);
|
||||||
*cur = {arr[5] ,arr[6]};
|
*cur = {arr[5] ,arr[6]};
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue