mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
syncing uppdev
git-svn-id: svn://ultimatepp.org/upp/trunk@1474 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
74c5c369b0
commit
169c484322
2 changed files with 39 additions and 0 deletions
9
uppdev/GlyphBench/GlyphBench.upp
Normal file
9
uppdev/GlyphBench/GlyphBench.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
uses
|
||||
CtrlLib;
|
||||
|
||||
file
|
||||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
|
||||
30
uppdev/GlyphBench/main.cpp
Normal file
30
uppdev/GlyphBench/main.cpp
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#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();
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue