You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@pandamicro Hello again. Today i have batch fixing day for my project:) ccui.ScrollView and ccui.ListView have terrible performance, cause every sprite render at single batch.
Steps to reproduce:
Create ccui.ListView or ccui.ScrollView;
Create ccui.Widget with few (for example 5) Sprites from same atlas in it;
Add few (for example 5) Items from previous step to list view;
Get bunch draw calls except one. (In example 25);
The problem is in UIScrollViewWebGLRenderCmd.js. It called render command for every sprite.
Solution is call renderer when data dont have uploadData function.
Your code:
for (i = 0, len = locCmds.length; i < len; ++i) {
cmd = locCmds[i];
checkNode = cmd._node;
if (checkNode && checkNode._parent && checkNode._inViewRect == false)
continue;
if (cmd.uploadData) {
cc.renderer._uploadBufferData(cmd);
}
else {
if (cmd._batchingSize > 0) {
cc.renderer._batchRendering();
}
cmd.rendering(context);
}
cc.renderer._batchRendering();
}
Fix:
for (i = 0, len = locCmds.length; i < len; ++i) {
cmd = locCmds[i];
checkNode = cmd._node;
if (checkNode && checkNode._parent && checkNode._inViewRect == false)
continue;
if (cmd.uploadData) {
cc.renderer._uploadBufferData(cmd);
}
else {
cc.renderer._batchRendering();
cmd.rendering(context);
}
}
cc.renderer._batchRendering();
The text was updated successfully, but these errors were encountered:
@pandamicro Hello again. Today i have batch fixing day for my project:) ccui.ScrollView and ccui.ListView have terrible performance, cause every sprite render at single batch.
Steps to reproduce:
The problem is in UIScrollViewWebGLRenderCmd.js. It called render command for every sprite.
Solution is call renderer when data dont have uploadData function.
Your code:
Fix:
The text was updated successfully, but these errors were encountered: