Redesign TASImage::Paint() - #23246
Merged
Merged
Conversation
These classes should handle image drawing directly without complex logic in TASImage::Paint method. Now it is just entry points
Just call Merge for target image
Instead calling 4 different methods, just create PNG buffer and embed it into SVG file. Make implementation straight-forward
Test Results 22 files 22 suites 3d 8h 59m 43s ⏱️ For more details on these failures, see this check. Results for commit d8ab7ae. ♻️ This comment has been updated with latest results. |
Simplify logic how image placed in the PDF file Old API was not clear enough for that
Use correct coordinates calculations to properly scale image from pixel to PS coordinates Partially use old API - until old will be deprecated
Redirect to fPS instance, recalculate to global coordinates while all image formats operate with global coordinates
Simple redirection to existing DrawPixels method, can be eliminated in the future while only used from ASImage
Use gVirtualX-based code like in original Image2Drawable method of TASImage. There are now several shortcuts, therefore methods looks much simpler. Also GL handling will be implemented in correspondent painter
Radical paradigm change. Now image painting delegated to pad painter instance, which knows better details of platform. Thus lot of magic around virtualX, virtualPS, GL completely vanishes. Extra palette painting made very simple and works exactly the same as image painting itself plut TGaxis. Special implementation provided for: - gVirtualX and TGX11 in TPadPainter - GL support in TGLPadPainter - SVG, PS, PDF, ImageDump via TPadPainterPS New approach opens possibility to provide image painting for any external platforms like Qt6 or Gtk4 or any other
Remove support of the GL - while it now handles in TGLPadPainter Simplify several places
After change in TASImage::Paint there are minimal changes in scaling/offset because of different rounding Therefore in SVG file image offset changed sometime by one pixel or scaling factor by 0.1%.
After change code to TTFhandle wrong align was applied. One should use 13 instead 11
When image object drawn on the pad - just use pp->DrawImage(). It is natural way now.
linev
force-pushed
the
pp_image_paint
branch
from
September 4, 2026 05:27
77bd512 to
d8ab7ae
Compare
couet
approved these changes
Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Radical paradigm change.
Now image painting delegated to pad painter instance, which knows better
details of the platform. Thus lot of magic around
gVirtualX,gVirtualPS,gPad->GetGLDevice()completely vanishes and move to correspondent back-end. Extra palette painting made very simple.
Special implementation provided for:
gVirtualXandTGX11inTPadPainterGLsupport in TGLPadPainterSVG,PS,PDF,ImageDumpviaTPadPainterPSSimplify
TASImage::PaintImagemethod which used for painting only on regulargVirtualXdevices.Remove
GLsupport there.New approach opens possibility to provide image painting for
any external platforms like Qt6 or Gtk4 or any other
Later one can remove old ugly API from
TVirtualPS:and from
TVirtualPadPainter:This was last hard place with complex dependency from
gVirtualX,