use macro for single maintenance.
Change-Id: I8a76b5f13abc371cd1f9fa3c9d797becc294f0b2
return (c * a) >> 8;
}
+static inline SwCoord HALF_STROKE(float width)
+{
+ return TO_SWCOORD(width * 0.5);
+}
+
int64_t mathMultiply(int64_t a, int64_t b);
int64_t mathDivide(int64_t a, int64_t b);
int64_t mathMulDiv(int64_t a, int64_t b, int64_t c);
//Valid Stroking?
uint8_t strokeAlpha = 0;
auto strokeWidth = sdata->strokeWidth();
- if (TO_SWCOORD(strokeWidth * 0.5) > 0) {
+ if (HALF_STROKE(strokeWidth) > 0) {
sdata->strokeColor(nullptr, nullptr, nullptr, &strokeAlpha);
}
stroke->sx = stroke->sy = 1.0f;
}
- stroke->width = TO_SWCOORD(sdata->strokeWidth() * 0.5);
+ stroke->width = HALF_STROKE(sdata->strokeWidth());
stroke->cap = sdata->strokeCap();
//Save line join: it can be temporarily changed when stroking curves...