mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-09 06:04:03 +00:00
common: style fixes (#644)
This commit is contained in:
parent
e56476b7bd
commit
934a95777c
6 changed files with 9 additions and 9 deletions
|
@ -70,7 +70,7 @@ struct SwPoint
|
||||||
return {x - rhs.x, y - rhs.y};
|
return {x - rhs.x, y - rhs.y};
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const SwPoint& rhs ) const
|
bool operator==(const SwPoint& rhs) const
|
||||||
{
|
{
|
||||||
return (x == rhs.x && y == rhs.y);
|
return (x == rhs.x && y == rhs.y);
|
||||||
}
|
}
|
||||||
|
|
|
@ -271,7 +271,7 @@ int64_t mathMultiply(int64_t a, int64_t b)
|
||||||
b = -b;
|
b = -b;
|
||||||
s = -s;
|
s = -s;
|
||||||
}
|
}
|
||||||
int64_t c = (a * b + 0x8000L ) >> 16;
|
int64_t c = (a * b + 0x8000L) >> 16;
|
||||||
return (s > 0) ? c : -c;
|
return (s > 0) ? c : -c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ static uint32_t _argbJoin(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
|
||||||
|
|
||||||
static bool _inverse(const Matrix* transform, Matrix* invM)
|
static bool _inverse(const Matrix* transform, Matrix* invM)
|
||||||
{
|
{
|
||||||
// computes the inverse of a matrix m
|
//computes the inverse of a matrix m
|
||||||
auto det = transform->e11 * (transform->e22 * transform->e33 - transform->e32 * transform->e23) -
|
auto det = transform->e11 * (transform->e22 * transform->e33 - transform->e32 * transform->e23) -
|
||||||
transform->e12 * (transform->e21 * transform->e33 - transform->e23 * transform->e31) +
|
transform->e12 * (transform->e21 * transform->e33 - transform->e23 * transform->e31) +
|
||||||
transform->e13 * (transform->e21 * transform->e32 - transform->e22 * transform->e31);
|
transform->e13 * (transform->e21 * transform->e32 - transform->e22 * transform->e31);
|
||||||
|
|
|
@ -614,7 +614,7 @@ SwSpan* _intersectSpansRegion(const SwRleData *clip, const SwRleData *targetRle,
|
||||||
auto clipSpans = clip->spans;
|
auto clipSpans = clip->spans;
|
||||||
auto clipEnd = clip->spans + clip->size;
|
auto clipEnd = clip->spans + clip->size;
|
||||||
|
|
||||||
while (spanCnt > 0 && spans < end ) {
|
while (spanCnt > 0 && spans < end) {
|
||||||
if (clipSpans == clipEnd) {
|
if (clipSpans == clipEnd) {
|
||||||
spans = end;
|
spans = end;
|
||||||
break;
|
break;
|
||||||
|
@ -680,7 +680,7 @@ SwSpan* _intersectMaskRegion(const SwRleData *clip, const SwRleData *targetRle,
|
||||||
clipSpans1++;
|
clipSpans1++;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (spanCnt && spans < end ) {
|
while (spanCnt && spans < end) {
|
||||||
if (clipSpans > clipEnd) {
|
if (clipSpans > clipEnd) {
|
||||||
spans = end;
|
spans = end;
|
||||||
break;
|
break;
|
||||||
|
@ -737,7 +737,7 @@ SwSpan* _intersectSpansRect(const SwBBox *bbox, const SwRleData *targetRle, SwSp
|
||||||
auto maxx = minx + static_cast<int16_t>(bbox->max.x - bbox->min.x) - 1;
|
auto maxx = minx + static_cast<int16_t>(bbox->max.x - bbox->min.x) - 1;
|
||||||
auto maxy = miny + static_cast<int16_t>(bbox->max.y - bbox->min.y) - 1;
|
auto maxy = miny + static_cast<int16_t>(bbox->max.y - bbox->min.y) - 1;
|
||||||
|
|
||||||
while (spanCnt && spans < end ) {
|
while (spanCnt && spans < end) {
|
||||||
if (spans->y > maxy) {
|
if (spans->y > maxy) {
|
||||||
spans = end;
|
spans = end;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -89,8 +89,8 @@ void bezSplitLeft(Bezier& cur, float at, Bezier& left)
|
||||||
left.ctrl1.x = cur.start.x + at * (cur.ctrl1.x - cur.start.x);
|
left.ctrl1.x = cur.start.x + at * (cur.ctrl1.x - cur.start.x);
|
||||||
left.ctrl1.y = cur.start.y + at * (cur.ctrl1.y - cur.start.y);
|
left.ctrl1.y = cur.start.y + at * (cur.ctrl1.y - cur.start.y);
|
||||||
|
|
||||||
left.ctrl2.x = cur.ctrl1.x + at * (cur.ctrl2.x - cur.ctrl1.x); // temporary holding spot
|
left.ctrl2.x = cur.ctrl1.x + at * (cur.ctrl2.x - cur.ctrl1.x); //temporary holding spot
|
||||||
left.ctrl2.y = cur.ctrl1.y + at * (cur.ctrl2.y - cur.ctrl1.y); // temporary holding spot
|
left.ctrl2.y = cur.ctrl1.y + at * (cur.ctrl2.y - cur.ctrl1.y); //temporary holding spot
|
||||||
|
|
||||||
cur.ctrl2.x = cur.ctrl2.x + at * (cur.end.x - cur.ctrl2.x);
|
cur.ctrl2.x = cur.ctrl2.x + at * (cur.end.x - cur.ctrl2.x);
|
||||||
cur.ctrl2.y = cur.ctrl2.y + at * (cur.end.y - cur.ctrl2.y);
|
cur.ctrl2.y = cur.ctrl2.y + at * (cur.end.y - cur.ctrl2.y);
|
||||||
|
|
|
@ -69,7 +69,7 @@ bool PngLoader::read()
|
||||||
image->format = PNG_FORMAT_BGRA;
|
image->format = PNG_FORMAT_BGRA;
|
||||||
buffer = static_cast<png_bytep>(malloc(PNG_IMAGE_SIZE((*image))));
|
buffer = static_cast<png_bytep>(malloc(PNG_IMAGE_SIZE((*image))));
|
||||||
if (!buffer) {
|
if (!buffer) {
|
||||||
// out of memory, only time when libpng doesnt free its data
|
//out of memory, only time when libpng doesnt free its data
|
||||||
png_image_free(image);
|
png_image_free(image);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue