-
Content Count
392 -
Joined
-
Last visited
-
Days Won
5
Everything posted by Cristian Peța
-
Actually I changed my code some years ago and now I'm painting on a bitmap scaled with Canvas.Scale (an UI Canvas) and then use Canvas.DrawBitmap() to draw UI.
-
If you meant using TCanvas, this was possible at least when mobile compilers rolled out. The way to do this changed a little over time but now you need to apply a transformation matrix to the canvas to reverse scaling and all you paint using canvas will match 1:1. There was needed also a translation of (-0.5, -0.5) in that matrix because you needed to use (0.5, 0.5) to use only one pixel. I don't know if this is the case also now.
-
High-level abstractions - Difficulties in choosing and using appropriate strategies for solving my task.
Cristian Peța replied to Shrinavat's topic in OmniThreadLibrary
@Schokohase if you are speaking about my suggestion to read bigger chunks from DB then this is not exactly parallelization. And the second suggestion was about what to optimize. If reading from DB takes 10ms and rendering 0.1ms per piece then I would not care about rendering. -
High-level abstractions - Difficulties in choosing and using appropriate strategies for solving my task.
Cristian Peța replied to Shrinavat's topic in OmniThreadLibrary
First you need to know much time takes GetTitleFromDB and RenderTitleToBitmap32. Then you will know where to optimize. For SQL servers hawing many small requests is costly. I don't know how much KB GetTitleFromDB is asking but generally reducing the number of requests (bigger data chunks) is better for client and for server also. -
High-level abstractions - Difficulties in choosing and using appropriate strategies for solving my task.
Cristian Peța replied to Shrinavat's topic in OmniThreadLibrary
If GetTitleFromDB() is using more DB connections and is multi-threaded and if this function is the main bottleneck then it makes sense to parallelize this for loop. Otherwise you can test but I think it will be no gain or even worse because LargeImage will not execute anything in parallel. Looking is per instance and you have only one instance. -
No more Transparent Forms on Android, now they are black
Cristian Peța replied to Jose Morango's topic in FMX
https://community.embarcadero.com/blogs/entry/simulating-transparent-dialog-on-firemonkey-mobile?utm_source=DeveloperNewsletter&utm_medium=Email&utm_content=Newsletter_25 -
There are four buttons on top-right corner. I use the second button that is like a file. It will show the unread content. P.S. I prefer also "condensed" mode.
-
Delphi 10.3 and supported version of Android
Cristian Peța replied to Yaron's topic in Delphi IDE and APIs
@Dalija Prasnikar in the "Platform Status" says that it's Android 5 (API 21) http://docwiki.embarcadero.com/PlatformStatus/en/Main_Page -
IDE hangs on code completion, find declaration, parameters tooltip.
Cristian Peța replied to vhanla's topic in Delphi IDE and APIs
I just tried out of curiosity to see unit cycles. Just too much for today Delphi compilers and parsers. -
The code you posted can't give any exception. Try for yourself in a new project. And us Uwe Raabe said: static arrays can't be freed manually, nor modify the length. Don't do this. P.S. for string static arrays you can free memory allocated by strings (assign null string or modify length) but not the array itself.
-
[3D] Why do i need to use negative Y values to go UP?
Cristian Peța replied to Memnarch's topic in FMX
Probably because they started from 2D. For screens (0, 0) point is up-left and you need to use positive values to go down. This originates from old TVs where the analog signal starts from up-left. -
Strange and Random Access Violations
Cristian Peța replied to Ugochukwu Mmaduekwe's topic in RTL and Delphi Object Pascal
It can brake reference counting only if you move() to string. When you only move() from string the string is not affected in any way. Move() doesn't change the source. -
Custom Managed Records Coming in Delphi 10.3
Cristian Peța replied to Marco Cantu's topic in RTL and Delphi Object Pascal
Compiler optimizations can bite sometimes. -
Custom Managed Records Coming in Delphi 10.3
Cristian Peța replied to Marco Cantu's topic in RTL and Delphi Object Pascal
For protection against modifying const parameters the language shouldn't have pointers. When ARC was introduced with iOS compiler there was a warning that in the future pointers can be banned by NEXTGEN compilers. But I don't think this will ever happen. -
IDE hangs on code completion, find declaration, parameters tooltip.
Cristian Peța replied to vhanla's topic in Delphi IDE and APIs
I don't see any issues after I build camera_shake in 10.2.3 with IDE FixPack. Code completion and others are instant. BTW build time is the same as in 10 Seattle. -
IDE hangs on code completion, find declaration, parameters tooltip.
Cristian Peța replied to vhanla's topic in Delphi IDE and APIs
Which project have you compiled in 10.2.3? I have an error in TERRA_OGG: function stb_vorbis_get_samples_short_interleaved(f:pvorb; channels:integer; buffer:array of SmallInt; num_shorts:integer):integer; var outputs: TOutput; len,n,z,k,kk,ch:integer; buf:array of SmallInt; begin len := num_shorts div channels; n:=0; kk:=0; z := f.channels; if z>channels then z:=channels; buf:=@buffer[kk]; <---[dcc32 Error] TERRA_OGG.pas(5391): E2010 Incompatible types: 'Dynamic array' and 'Pointer' -
IDE hangs on code completion, find declaration, parameters tooltip.
Cristian Peța replied to vhanla's topic in Delphi IDE and APIs
First I recommend you to install Andy's IDE FixPack. It will be much better. And I tried to compile in 10 Seattle out of curiosity but: - particles_simple sample does not compile because TERRA_SpriteManager unit is missing. - linetest sample does not compile because TERRA_Scene unit is missing. - camera_shake finally compiles.... And there is soooo much noise at compilation.... a lot of hints and warnings. Someone must clean this before take this project seriously. And 167 kloc in 127 seconds for camera_shake sample (win32)? I have a project with 243 kloc that compiles in 10 seconds on the same machine. I'm not surprised that CodeInsight is so slow. PS. In 10 Seattle CodeInsight is instant after a build (FixPack installed). -
Custom Managed Records Coming in Delphi 10.3
Cristian Peța replied to Marco Cantu's topic in RTL and Delphi Object Pascal
Nice if we optionally can modify the source. For example we can mark that a copy was made or to increment a counter of copies. -
Directions for ARC Memory Management
Cristian Peța replied to Marco Cantu's topic in RTL and Delphi Object Pascal
New.Of() can also be a simple function that returns a record like: function Keep(AObject: TObject): TKeepObjectAndFreeRecord; -
Directions for ARC Memory Management
Cristian Peța replied to Marco Cantu's topic in RTL and Delphi Object Pascal
A record without a reference will stay alive up to routine end? I must test this. .... Just verified in Lazarus and suppose it's similar in Delphi. That record lives on stack up to the routine end. -
Directions for ARC Memory Management
Cristian Peța replied to Marco Cantu's topic in RTL and Delphi Object Pascal
Perhaps that New record must also be declared next to s1. Otherwise how can it go out of scope? -
Directions for ARC Memory Management
Cristian Peța replied to Marco Cantu's topic in RTL and Delphi Object Pascal
I only wanted a simple way to clear my code of that "try finally end" for local, short lived instances. They are the wast majority in my code. For other objects (the minority) I prefer manual memory management and not to fight an automatic one. IShared<T> is nice but a little convoluted. -
Directions for ARC Memory Management
Cristian Peța replied to Marco Cantu's topic in RTL and Delphi Object Pascal
It would be wrong if somewhere is an unsafe reference. But this is true also if using Shared<T> or IShared<T>. Or any other smart pointer. -
Directions for ARC Memory Management
Cristian Peța replied to Marco Cantu's topic in RTL and Delphi Object Pascal
I don't understand what would be wrong to enable ARC for objects and to consider [unsafe] as default. It will not brake old code. And using [safe] or [arc] we can have automatic memory management. At least for simple scenarios. -
How to make a component available to all platforms
Cristian Peța replied to John Kouraklis's topic in FMX
I discovered this looking in FMX sources.