Home » Community » U++ community news and announcements » Major Draw refactoring
| Major Draw refactoring [message #22349] |
Tue, 07 July 2009 10:04  |
 |
mirek
Messages: 14291 Registered: November 2005
|
Ultimate Member |
|
|
I am happy to announce that Draw development is getting to its final phase.
Current major step moved all GUI related issues to CtrlCore, leaving Draw "abstract", decoupling X11 (or GDI). Meanwhile, font/text support is still available (in POSIX using raw FontConfig).
Fonts are also much improved:
- new implementation allowed deprecating of FontInfo - you can now get all metrics directly from Font (FontInfo still exists to maintain compatibility).
- new system now supports font replacements - means you can now use CJK glyphs with any font and they will be taken from another font.
- Painter is now able to use both glyph composition and replacements.
Of course, as with any such major redesign, you can expect some issues and bugs...
The last phase should be relatively simple - moving Painter to Draw and fixing POSIX library requirements...
Mirek
[Updated on: Tue, 07 July 2009 13:54] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: Major Draw refactoring [message #22430 is a reply to message #22412] |
Tue, 14 July 2009 19:28   |
nixnixnix
Messages: 415 Registered: February 2007 Location: Kelowna, British Columbia
|
Senior Member |
|
|
I just updated my version of UPP from the SVN and my code appears to be broken.
It wont compile due to the following errors:
| Quote: |
D:\MyApps\OpenWind\WindMap.cpp(2745) : error C2664: 'Upp::ImageBuffer::ImageBuffer(Upp::Size)' : cannot convert parameter 1 from 'Upp::ImageDraw' to 'Upp::Size'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
D:\MyApps\OpenWind\main.cpp(1080) : error C2039: 'GetPagePixels' : is not a member of 'Upp::Draw'
C:\upp\uppsrc\Draw/Draw.h(412) : see declaration of 'Upp::Draw'
D:\MyApps\OpenWind\main.cpp(1105) : error C2039: 'GetPagePixels' : is not a member of 'Upp::PdfDraw'
C:\upp\uppsrc\PdfDraw/PdfDraw.h(228) : see declaration of 'Upp::PdfDraw'
D:\MyApps\OpenWind\main.cpp(1136) : error C2664: 'Upp::ImageBuffer::ImageBuffer(Upp::Size)' : cannot convert parameter 1 from 'Upp::ImageDraw' to 'Upp::Size'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
D:\MyApps\OpenWind\main.cpp(1163) : error C2664: 'Upp::ImageBuffer::ImageBuffer(Upp::Size)' : cannot convert parameter 1 from 'Upp::ImageDraw' to 'Upp::Size'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
D:\MyApps\OpenWind\main.cpp(1191) : error C2664: 'Upp::ImageBuffer::ImageBuffer(Upp::Size)' : cannot convert parameter 1 from 'Upp::ImageDraw' to 'Upp::Size'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
D:\MyApps\OpenWind\main.cpp(1219) : error C2664: 'Upp::ImageBuffer::ImageBuffer(Upp::Size)' : cannot convert parameter 1 from 'Upp::ImageDraw' to 'Upp::Size'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
D:\MyApps\OpenWind\WRGLayer.cpp(477) : error C2664: 'Upp::ImageBuffer::ImageBuffer(Upp::Size)' : cannot convert parameter 1 from 'Upp::ImageDraw' to 'Upp::Size'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
|
Is there any documentation on these changes please and are there equivalent replacement functions for those that have been removed? I thought that UPP was mature enough that this wasn't going to happen.
EDIT: ok well Vista was able to restore my previous version of UPP so I can continue working but of course I am now stuck in a limbo between 2008.1 and the latest version. Will these problems be fixed? I take it that there is another function instead of GetPagePixels (although I am not sure what other name could so perfectly sum up the function) but what about ImageDraw to ImageBuffer? How will that be accomplished in the new version?
Nick
[Updated on: Tue, 14 July 2009 19:53] Report message to a moderator
|
|
|
|
|
|
| Re: Major Draw refactoring [message #22432 is a reply to message #22431] |
Wed, 15 July 2009 06:56   |
nixnixnix
Messages: 415 Registered: February 2007 Location: Kelowna, British Columbia
|
Senior Member |
|
|
Hi Mirek,
Here is the code fragment that gives the error at main.cpp(1163).
void OpenWind::PrintTIF()
{
FileSel fs;
fs.Type("TIF files", "*.tif").AllFilesType().DefaultExt("tif");
fs.ActiveDir(GetCurrentDirectory());
if(!fs.ExecuteSaveAs("Output TIF file"))
return;
CUtils::SetCurrentDirectory_(fs.GetActiveDir());
// drawgrid
if(m_optionGrid.GetData())
{
Size sz = m_rcClient.Size();
ImageDraw id(sz);
id.DrawImage(0,0,sz.cx,sz.cy,m_view);
DrawGrid(id);
ImageBuffer ib(id); // I beleive this is the problem right here
m_view = Image(ib);
}
TIFEncoder tif;
tif.SaveFile(~fs,m_view);
SaveWorldFile(~fs);
}
thanks for taking a look at this.
Nick
[Updated on: Wed, 15 July 2009 06:58] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: Major Draw refactoring [message #22452 is a reply to message #22448] |
Thu, 16 July 2009 18:32   |
nixnixnix
Messages: 415 Registered: February 2007 Location: Kelowna, British Columbia
|
Senior Member |
|
|
When I test my software with the latest UPP, my fonts are messed up (when I reload a workbbok from disk) as well as the drop-downs not working (not readable and not dropping down) and the GridCtrl appears to have its y-dimension squashed.
Also, the message boxes (e.g. PromptOK) don't display properly. They are squashed.
Is this intended behaviour and if so, what do I need to do to fix my software?
Nick
p.s. these appear to be Vista issues. It doesn't happen on Ubuntu64 (I can't test on XP 32 just now). I use Vista 64 as my main development platform just now and believe me, on that UPP is not looking good. It was fine before the refactoring though.
I have had to revert again as I need to be able to show a working version of my software. Could you please post in this thread when its fixed. Mirek, if you don't have Vista 64 and want to see the problem I can show you using showmypc.
[Updated on: Fri, 17 July 2009 00:20] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: Major Draw refactoring [message #22467 is a reply to message #22463] |
Fri, 17 July 2009 17:24   |
Novo
Messages: 1431 Registered: December 2006
|
Ultimate Contributor |
|
|
| luzr wrote on Fri, 17 July 2009 08:18 |
If yes, you can use dynamic_cast<DrawingDraw *>.
|
Is it really necessary to use RTTI with UPP? It makes code bigger and used only at very limited number of places in UPP. Avoiding RTTI (and exceptions) would attract small platform users.
Sorry for the offtopic.
Regards,
Novo
|
|
|
|
|
|
| Re: Major Draw refactoring [message #22474 is a reply to message #22469] |
Fri, 17 July 2009 23:54   |
Novo
Messages: 1431 Registered: December 2006
|
Ultimate Contributor |
|
|
| luzr wrote on Fri, 17 July 2009 11:43 |
| Novo wrote on Fri, 17 July 2009 11:24 |
| luzr wrote on Fri, 17 July 2009 08:18 |
If yes, you can use dynamic_cast<DrawingDraw *>.
|
Is it really necessary to use RTTI with UPP? It makes code bigger and used only at very limited number of places in UPP. Avoiding RTTI (and exceptions) would attract small platform users.
Sorry for the offtopic.
|
RTTI is valid part of C++ standard and while minor feature, it has a nice ability to automatically provide solution to problems similiar to this one.
I do not believe that it makes code *significantly* bigger. There is not that much to store in memory in order to support RTTI (AFAIK).
Mirek
|
I couldn’t find a tool, which calculates size of RTTI info in an executable. Visually TheIDE has ~5% of overhead because of RTTI (you can see at least mangled names in data sections). This percentage depends on size of class’ names and complexity of templates. STL and BOOST would give much bigger overhead.
During research of this topic I found a very interesting article: http://connect.microsoft.com/VisualStudio/feedback/ViewFeedb ack.aspx?FeedbackID=471325
It looks like Visual C++ puts RTTI info into Read/Write segment. That doesn’t increase size of executable but increases run-time memory consumption. This explains why all windows applications require so much memory .
Probably, MINGW is not that bad after all. 
TheIDE according to dumpbin:
Summary
142000 .data
172000 .rdata
1000 .rsrc
257000 .text
SECTION HEADER #3
.data name
1412FC virtual size
3CA000 virtual address (007CA000 to 0090B2FB)
34000 size of raw data
3CA000 file pointer to raw data (003CA000 to 003FDFFF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0000040 flags
Initialized Data
Read Write
Summary
142000 .data
The ".data" segment is 13% of the ".text" segment. Not all ".data" is RTTI but still ...
And for some reason it requires 55% of ".text"'s size at run-time.
Any way, small device guys always compile with RTTI disabled.
Regards,
Novo
|
|
|
|
|
|
| Re: Major Draw refactoring [message #22478 is a reply to message #22476] |
Sat, 18 July 2009 02:55   |
Novo
Messages: 1431 Registered: December 2006
|
Ultimate Contributor |
|
|
| luzr wrote on Fri, 17 July 2009 20:12 |
| Novo wrote on Fri, 17 July 2009 17:54 |
The ".data" segment is 13% of the ".text" segment. Not all ".data" is RTTI but still ...
And for some reason it requires 55% of ".text"'s size at run-time.
Any way, small device guys always compile with RTTI disabled.
|
IMO, most of ".data" is .iml...
Mirek
|
IMO, that should go in ".rdata" because it is read-only.
Regards,
Novo
[Updated on: Sat, 18 July 2009 02:58] Report message to a moderator
|
|
|
|
|
|
| Re: Major Draw refactoring [message #22494 is a reply to message #22493] |
Sun, 19 July 2009 15:17   |
 |
mirek
Messages: 14291 Registered: November 2005
|
Ultimate Member |
|
|
| andrei_natanael wrote on Sun, 19 July 2009 06:58 |
| Novo wrote on Sat, 18 July 2009 03:55 |
| luzr wrote on Fri, 17 July 2009 20:12 |
| Novo wrote on Fri, 17 July 2009 17:54 |
The ".data" segment is 13% of the ".text" segment. Not all ".data" is RTTI but still ...
And for some reason it requires 55% of ".text"'s size at run-time.
Any way, small device guys always compile with RTTI disabled.
|
IMO, most of ".data" is .iml...
Mirek
|
IMO, that should go in ".rdata" because it is read-only.
|
I think it's not read-only because you can modify the content of an .iml file, replacing an image from Iml class with your own image.
|
Actually, that might be unrelated (original data are still in memory, just pointers get updated).
Mirek
|
|
|
|
|
|
|
|
|
|
| Re: Major Draw refactoring [message #22760 is a reply to message #22757] |
Tue, 11 August 2009 20:20  |
nixnixnix
Messages: 415 Registered: February 2007 Location: Kelowna, British Columbia
|
Senior Member |
|
|
I see. Good idea. You just need to add the Alpha() method then and I can convert to ImageAnyDraw and not include the CtrlCore package in my image processing console apps.
Cheers,
Nick
|
|
|
|
Goto Forum:
Current Time: Mon May 04 03:34:01 GMT+2 2026
Total time taken to generate the page: 0.01180 seconds
|