Home » Community » U++ community news and announcements » Painter improvements
|
Re: Painter improvements [message #60384 is a reply to message #60364] |
Wed, 27 December 2023 13:42   |
Tom1
Messages: 1301 Registered: March 2007
|
Ultimate Contributor |
|
|
Hi Mirek,
Thanks, this is very interesting. However, unfortunately, when built with MSBT22x64 the text rendering is very broken. It shows on PainterExamples (and elsewhere too). Can you check this?
Best regards,
Tom
EDIT: In Core/ValueCache.h add String() conversion for return fixes the text rendering issue. MSBT actually warns about automatic conversion here:
template <class K, class M>
String MakeKey_(const K& k, const M& m)
{
StringBuffer key;
RawCat(key, StaticTypeNo<K>());
RawCat(key, StaticTypeNo<M>());
key.Cat(k());
return String(key); // << Add String() here!
}
I will do further tests...
[Updated on: Wed, 27 December 2023 14:02] Report message to a moderator
|
|
|
Re: Painter improvements [message #60385 is a reply to message #60384] |
Wed, 27 December 2023 14:08   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
Tom1 wrote on Wed, 27 December 2023 13:42Hi Mirek,
Thanks, this is very interesting. However, unfortunately, when built with MSBT22x64 the text rendering is very broken. It shows on PainterExamples (and elsewhere too). Can you check this?
Best regards,
Tom
EDIT: In Core/ValueCache.h add String() conversion for return fixes the text rendering issue. MSBT actually warns about automatic conversion here:
template <class K, class M>
String MakeKey_(const K& k, const M& m)
{
StringBuffer key;
RawCat(key, StaticTypeNo<K>());
RawCat(key, StaticTypeNo<M>());
key.Cat(k());
return String(key); // << Add String() here!
}
I will do further tests...
Thank you!
|
|
|
Re: Painter improvements [message #60386 is a reply to message #60385] |
Wed, 27 December 2023 16:47   |
Tom1
Messages: 1301 Registered: March 2007
|
Ultimate Contributor |
|
|
Mirek,
It seems that the rendering speed has decreased to about half on my hardware:
Processor 12th Gen Intel(R) Core(TM) i9-12900K 3.20 GHz
Installed RAM 32,0 GB (31,7 GB usable)
System type 64-bit operating system, x64-based processor
I will send you a download link to the Sample50k.Painting (a vector based map as a Painting) file separately.
Here's the code for testing:
#include <CtrlLib/CtrlLib.h>
#include <Painter/Painter.h>
using namespace Upp;
struct MyApp : TopWindow {
Painting painting;
MyApp(){
Maximize();
LoadFromFile(painting, GetDesktopFolder() + DIR_SEPS + "Sample50k.Painting");
}
virtual void Paint(Draw& dw)
{
Size sz = GetSize();
ImageBuffer ib(sz);
BufferPainter painter(ib);
painter.Co(true);
painter.Clear(White());
int64 t0=usecs();
painter.Paint(painting);
painter.Finish();
Title(Format("Render took %lld usecs",usecs(t0)));
Image im(ib);
dw.DrawImage(0,0,im);
}
bool Key(dword key, int count){
switch(key){
case K_SPACE:
Refresh();
return true;
}
return false;
}
};
GUI_APP_MAIN
{
MyApp app;
app.MaximizeBox().MinimizeBox().Sizeable();
app.Run();
}
I'm getting about 30 milliseconds for the old (17045) Painter and about 60 milliseconds for the new one.
Hope you're using an UHD/4k or larger display.
Best regards,
Tom
|
|
|
|
Re: Painter improvements [message #60390 is a reply to message #60389] |
Wed, 27 December 2023 17:47   |
Tom1
Messages: 1301 Registered: March 2007
|
Ultimate Contributor |
|
|
mirek wrote on Wed, 27 December 2023 18:13Just curious: Are you stroking texts to get thin white margins around glyphs?
As a matter of fact, I am. It makes it much easier to read them when there are underlaying items getting covered. Is there a more optimized way to do that?
Best regards,
Tom
|
|
|
|
Re: Painter improvements [message #60395 is a reply to message #60394] |
Thu, 28 December 2023 12:43  |
Tom1
Messages: 1301 Registered: March 2007
|
Ultimate Contributor |
|
|
Hi Mirek,
Thanks! Now it performs equally with the old version.
I can create more detailed maps (as Paintings) if you need them for optimization of Painter.
Best regards,
Tom
EDIT: Well, at least almost as good. The new is at 35 ms on the average and the old 17045 runs in 30 ms.
[Updated on: Thu, 28 December 2023 13:37] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Tue Apr 29 09:47:17 CEST 2025
Total time taken to generate the page: 0.00777 seconds
|