Patches item #3526887, was opened at 2012-05-15 03:33 Message generated for change (Comment added) made by eldruin You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=757418&aid=3526887&group_id=144022
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Workarea renderer optimizations Initial Comment: Reduces amount of float computations used when rendering the workarea. Common division expressions were solved and declared as constants. ---------------------------------------------------------------------- >Comment By: Diego Barrios Romero (eldruin) Date: 2012-05-24 04:37 Message: Hello! According to: http://cairographics.org/documentation/cairomm/reference/classCairo_1_1Context.html#aff3f3fc62bdf862646bb8cc568c30b2a I'd name the constants CAIRO_SOURCE_GRAY, CAIRO_SOURCE_LIGHTGRAY, CAIRO_SOURCE_DARKGREY. I'd place this definitions as protected float members of the class WorkAreaRenderer. i.e.: const float CAIRO_SOURCE_GRAY = 175.0/255.0; There are more constants that follow this pattern in the workarearenderer classes: gui/workarearenderer/renderer_ducks.cpp:166: cr->set_source_rgb(175.0/255.0,175.0/255.0,175.0/255.0); //DUCK_COLOR_BEZIER_2 gui/workarearenderer/renderer_ducks.cpp:179: cr->set_source_rgb(175.0/255.0,175.0/255.0,175.0/255.0); //DUCK_COLOR_BEZIER_2 gui/workarearenderer/renderer_ducks.cpp:411: cr->set_source_rgb(175.0/255.0,175.0/255.0,175.0/255.0); gui/workarearenderer/renderer_timecode.cpp:119: cr->set_source_rgb(95.0/255.0,0,0); gui/workarearenderer/renderer_grid.cpp:112: cr->set_source_rgb(159.0/255.0,159.0/255.0,159.0/255.0); gui/workarearenderer/renderer_guides.cpp:235: cr->set_source_rgb(1.0,111.0/255.0,111.0/255.0); gui/workarearenderer/renderer_guides.cpp:237: cr->set_source_rgb(111.0/255.0,111.0/255.0,1.0); gui/workarearenderer/renderer_guides.cpp:255: cr->set_source_rgb(1.0,111.0/255.0,111.0/255.0); gui/workarearenderer/renderer_guides.cpp:257: cr->set_source_rgb(111.0/255.0,111.0/255.0,1.0); Please define constants for all the colors and use them all across these files. We must be consistent all along the code and if we are going to define constants for base colors, we have to do it globally and then use them in every place. Please leave the division, don't substitute the calculated value in any case. Thank you! :) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=757418&aid=3526887&group_id=144022 ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Synfig-devl mailing list Synfig-devl@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/synfig-devl