# HG changeset patch # User wycc # Date 1302291411 -28800 # Node ID d82a828e8e26051e58c49465c3aff8baa3d267a7 # Parent 84368f4bc98847610ba50dff0c733cb84ce61ba6 Optimize the performance. If properties is not changed, we don't call rdman_coord_changed. diff -r 84368f4bc988 -r d82a828e8e26 nodejs/coord.cc --- a/nodejs/coord.cc Fri Apr 08 09:47:00 2011 +0800 +++ b/nodejs/coord.cc Sat Apr 09 03:36:51 2011 +0800 @@ -201,6 +201,8 @@ return 0; } + if (coord_get_matrix(coord)[idx] == v) return v; + coord_get_matrix(coord)[idx] = v; js_rt = GET(self, "mbrt")->ToObject(); @@ -295,7 +297,7 @@ js_rt = GET(self, "mbrt")->ToObject(); ASSERT(js_rt != NULL); rdman = xnjsmb_rt_rdman(js_rt); - + if ((coord->flags & COF_HIDDEN) == 0) return; coord_show(coord); rdman_coord_changed(rdman, coord); } @@ -309,6 +311,7 @@ ASSERT(js_rt != NULL); rdman = xnjsmb_rt_rdman(js_rt); + if ((coord->flags & COF_HIDDEN) != 0) return; coord_hide(coord); rdman_coord_changed(rdman, coord); } @@ -323,6 +326,7 @@ ASSERT(js_rt != NULL); rdman = xnjsmb_rt_rdman(js_rt); + if (coord_get_opacity(coord) == value->NumberValue()) return; coord_set_opacity(coord, value->NumberValue()); rdman_coord_changed(rdman, coord);