From b8a15f2b79ff4ed96e557b225dd8615d04df2e94 Mon Sep 17 00:00:00 2001 From: cxl Date: Sun, 11 Nov 2018 12:41:20 +0000 Subject: [PATCH] .examples git-svn-id: svn://ultimatepp.org/upp/trunk@12507 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- examples/PainterExamples/Lion.cpp | 4 ++-- examples/PainterExamples/RadialMaskBlending.cpp | 2 +- examples/PainterExamples/main.cpp | 10 ++++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/examples/PainterExamples/Lion.cpp b/examples/PainterExamples/Lion.cpp index cbe74d118..9414fa888 100644 --- a/examples/PainterExamples/Lion.cpp +++ b/examples/PainterExamples/Lion.cpp @@ -181,9 +181,9 @@ void PaintLion(Painter& sw) static Vector l = Lion(); for(int i = 0; i < l.GetCount(); i++) { Vector& p = l[i].point; - sw.Move(p[0].x, p[0].y); + sw.Move(p[0]); for(int j = 1; j < p.GetCount(); j++) - sw.Line(p[j].x, p[j].y); + sw.Line(p[j]); sw.Fill(l[i].color); } } diff --git a/examples/PainterExamples/RadialMaskBlending.cpp b/examples/PainterExamples/RadialMaskBlending.cpp index 887e7cb56..10fb5209c 100644 --- a/examples/PainterExamples/RadialMaskBlending.cpp +++ b/examples/PainterExamples/RadialMaskBlending.cpp @@ -12,7 +12,7 @@ void RadialMaskBlending(Painter& sw) sw.End(); for(int y = 0; y < tsz.cx; y += tsz.cy) sw.Text(10, y, txt, Roman(40)) - .Fill(Blue()); + .Fill(Red()); sw.End(); sw.Begin(); sw.BeginMask(); diff --git a/examples/PainterExamples/main.cpp b/examples/PainterExamples/main.cpp index f9b80924c..a947901a9 100644 --- a/examples/PainterExamples/main.cpp +++ b/examples/PainterExamples/main.cpp @@ -57,25 +57,27 @@ void App::Print() void App::Benchmark() { double tm[2]; + ImageBuffer ib(2000, 2000); for(int pass = 0; pass < 1 + !!ctrl.mt; pass++) { int time0 = GetTickCount(); int n = 0; int time; + BufferPainter sw(ib, ctrl.quality); for(;;) { time = GetTickCount(); if(time - time0 > 1000) break; - ImageBuffer ib(800, 600); - BufferPainter sw(ib, ctrl.quality); sw.Co(pass); + sw.Begin(); DoPaint(sw); + sw.End(); n++; } tm[pass] = double(time - time0) / n; } if(ctrl.mt) - PromptOK(Format("ST %.2f ms, MT %.2f ms, ST/MT %.2f", tm[0], tm[1], tm[0] / tm[1])); + PromptOK(Format("ST %.3f ms, MT %.3f ms, ST/MT %.3f", tm[0], tm[1], tm[0] / tm[1])); else - PromptOK(Format("%.2f ms", tm[0])); + PromptOK(Format("%.3f ms", tm[0])); } void App::Paint(Draw& w)