Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

put in some more consts #194

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/nanosvgrast.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ NSVGrasterizer* nsvgCreateRasterizer();
// h - height of the image to render
// stride - number of bytes per scaleline in the destination buffer
void nsvgRasterize(NSVGrasterizer* r,
NSVGimage* image, float tx, float ty, float scale,
const NSVGimage* image, float tx, float ty, float scale,
unsigned char* dst, int w, int h, int stride);

// Deletes rasterizer context.
Expand Down Expand Up @@ -368,10 +368,10 @@ static void nsvg__flattenCubicBez(NSVGrasterizer* r,
nsvg__flattenCubicBez(r, x1234,y1234, x234,y234, x34,y34, x4,y4, level+1, type);
}

static void nsvg__flattenShape(NSVGrasterizer* r, NSVGshape* shape, float scale)
static void nsvg__flattenShape(NSVGrasterizer* r, const NSVGshape* shape, float scale)
{
int i, j;
NSVGpath* path;
const NSVGpath* path;

for (path = shape->paths; path != NULL; path = path->next) {
r->npoints = 0;
Expand Down Expand Up @@ -732,7 +732,7 @@ static void nsvg__prepareStroke(NSVGrasterizer* r, float miterLimit, int lineJoi
}
}

static void nsvg__flattenShapeStroke(NSVGrasterizer* r, NSVGshape* shape, float scale)
static void nsvg__flattenShapeStroke(NSVGrasterizer* r, const NSVGshape* shape, float scale)
{
int i, j, closed;
NSVGpath* path;
Expand Down Expand Up @@ -1260,7 +1260,7 @@ static void nsvg__unpremultiplyAlpha(unsigned char* image, int w, int h, int str
}


static void nsvg__initPaint(NSVGcachedPaint* cache, NSVGpaint* paint, float opacity)
static void nsvg__initPaint(NSVGcachedPaint* cache, const NSVGpaint* paint, float opacity)
{
int i, j;
NSVGgradient* grad;
Expand Down Expand Up @@ -1363,7 +1363,7 @@ static void dumpEdges(NSVGrasterizer* r, const char* name)
*/

void nsvgRasterize(NSVGrasterizer* r,
NSVGimage* image, float tx, float ty, float scale,
const NSVGimage* image, float tx, float ty, float scale,
unsigned char* dst, int w, int h, int stride)
{
NSVGshape *shape = NULL;
Expand Down