ultimatepp/uppdev/GlyphBench/main.cpp
cxl 169c484322 syncing uppdev
git-svn-id: svn://ultimatepp.org/upp/trunk@1474 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2009-08-04 13:05:28 +00:00

30 lines
561 B
C++

#include <CtrlLib/CtrlLib.h>
using namespace Upp;
struct MyApp : TopWindow {
virtual void Paint(Draw& w)
{
w.DrawRect(GetSize(), White());
Font fnt = Arial(16);
int fcx = fnt['X'];
{
RTIMING("Optimized");
for(int q = 0; q < 100000; q++)
w.DrawText(0, 0, String('X', 30), fnt);
}
{
RTIMING("One char");
for(int q = 0; q < 100000; q++)
for(int i = 0; i < 30; i++)
w.DrawText(i * fcx, 40, String('X', 1), fnt);
}
w.DrawText(100, 100, "Finished");
}
};
GUI_APP_MAIN
{
MyApp().Run();
}