From 169c484322929fcc054d01d299aefa414e7abb31 Mon Sep 17 00:00:00 2001 From: cxl Date: Tue, 4 Aug 2009 13:05:28 +0000 Subject: [PATCH] syncing uppdev git-svn-id: svn://ultimatepp.org/upp/trunk@1474 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppdev/GlyphBench/GlyphBench.upp | 9 +++++++++ uppdev/GlyphBench/main.cpp | 30 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 uppdev/GlyphBench/GlyphBench.upp create mode 100644 uppdev/GlyphBench/main.cpp diff --git a/uppdev/GlyphBench/GlyphBench.upp b/uppdev/GlyphBench/GlyphBench.upp new file mode 100644 index 000000000..5872304d3 --- /dev/null +++ b/uppdev/GlyphBench/GlyphBench.upp @@ -0,0 +1,9 @@ +uses + CtrlLib; + +file + main.cpp; + +mainconfig + "" = "GUI"; + diff --git a/uppdev/GlyphBench/main.cpp b/uppdev/GlyphBench/main.cpp new file mode 100644 index 000000000..cc5fd76d0 --- /dev/null +++ b/uppdev/GlyphBench/main.cpp @@ -0,0 +1,30 @@ +#include + +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(); +} +