Repository navigation
Add graphics worlds to libQuickDraw - #72
Merged
Merged
Conversation
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.
libQuickDraw gains graphics worlds: offscreen color ports at 1, 2, 4, 8, 16 and 32 bits, built on what Mac OS 9.2.2 did with a new probe (
ReferenceTests/Retro68/GWorldCapture.c).What changed
NewGWorld,UpdateGWorld,DisposeGWorld,Get/SetGWorld, the device calls,LockPixelsand the other pixel calls.RGBForeColor,RGBBackColor,GetForeColor,GetBackColor,GetCPixel,SetCPixel.CopyBitscalls work in color ports, andCopyBits/CopyMaskcopy between any depths.Quickdraw.hnow declaresCGrafPort,GDevice,SProcRecandCProcRec.28 more functions, so 149 of 305 are implemented.
Engine changes (these affect every Graphite2D user)
clipPixandstretchPixhad the wrong bits; they are now bits 28 and 29.PixelBuffer.alphaBytechooses the alpha byte written to 32-bit pixels.Limits
UpdateGWorldkeeps the same world and pixel map, andstretchPixdoes not mix colors as the Mac did.portRect,visRgnandclipRgnare at the same offsets inGrafPortandCGrafPort; readingpnLoc,txFontand later fields of a world through aGrafPtrgets the wrong field.RGBForeColoron aGrafPortand the main device's flags were not measured.OpenCPort, pixel patterns, palettes,CopyDeepMaskand pictures are still stubs.Testing
GWorldCaptureTestsreplays the probe; 15 lines differ and the test lists each one.swift testpasses on macOS.swift:6.4-trixie, FreeType off): 305 exports as declared,pure.c26 checks anddrawing.c58 checks pass.Commits are one file each, so intermediate ones may not build on their own.