You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to skia-discuss
Hi I would like to know the difference between skpath and skpathbuilder. When i tried using both in my project, I found skpath showing variable and larger time for drawing compared to SkPathBuilder. I have measured time for the following snippet code :
SkPath : (time taken ~ 400 - 600 micro secs)
SkPath path;
int y = 0;
for ( int i = 0 ; i<= 50 ; i++){
int x = 0;
for(int j = 0; j<=50 ; j++){
path.moveTo(x, y);
path.lineTo(x+colWidth, y);
path.lineTo(x+colWidth, y+rowHt);
x +=5;
}
y += 5;
}
canvas->drawPath(path, paint);
SkPathBuilder: ( time taken ~ 150 - 300 micro sec)
SkPathBuilder builder;
int y = 0;
for ( int i = 0 ; i<= 50 ; i++){
int x = 0;
for(int j = 0; j<=50 ; j++){
builder.moveTo({x,y});
builder.lineTo({x+colWidth, y});
builder.lineTo({x+colWidth, y+rowHt});
x +=5;
}
y += 5;
}
canvas->drawPath(builder.detach(), paint);
Regrads Priya
w...@weltz-online.de
unread,
Oct 23, 2024, 4:37:18 AMOct 23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to skia-discuss
I assume, that is the way a builder should work. You add your drawing commands and at the end all calculations are done. When you use a normal path directly, these calculations had to be done each time you change something on the path.