Network image loading in test programs + local-image render fixes#1
Merged
Network image loading in test programs + local-image render fixes#1
Conversation
SimpleTest and LibLoad_Test now exercise the full MCC capability surface (images, forms, tables, fonts, entities) and render both local PROGDIR: files and plain-HTTP URLs through a shared image-load hook (test_image_hook.h). HTTPS is rejected cleanly (stock bsdsocket has no TLS) by aborting on any non-200 status code. Core fixes required to make images render at all: - IM_Render: RenderEngine::RenderEngine now zeroes FirstFrame. The LastFrame self-ref trick relies on it starting NULL, which the stack- allocated instance never guaranteed -- AllocateFrame's first-frame detection misfired and StatusItem->Start() was skipped. - Dispatcher: DefaultLoadFunc now strips "file://" only when present; bare paths (PROGDIR:foo.png) used to get the first 7 chars sliced off. - Hook wiring: m68k/MorphOS route through HookEntry trampoline so CallHookPkt's register args reach the plain-C handler; OS4 assigns TestImageHookFunc directly (HookEntry isn't declared there). - LibLoad_Test: defer MUIA_HTMLview_Contents until after the window is open -- the image decoder needs a screen, which isn't known at MUI_NewObject time. - test_image_hook.h: per-hook bsdsocket.library OpenLibrary with task-scoped shadow globals, so the socket base is valid in the decoder task (m68k bsdsocket is task-local). - Makefile: copy testdata/test.png into bin_$(OS)/ for PROGDIR: loads; add -Wl,-u,_startu on OS4 so C++ static init runs.
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.
Summary
PROGDIR:files and plain-HTTP URLs via a shared image-load hook (test_image_hook.h).RenderEngineFirstFrame-uninitialized bug that silently broke image decoding for stack-allocated instances, afile://-prefix slicing bug inDefaultLoadFunc, and gets the m68k hook calling convention right (HookEntry trampoline on m68k/MorphOS, direct assignment on OS4).Test plan
HTMLview.mcc,SimpleTest,LibLoad_Testcompile clean viaamigadev/crosstools:m68k-amigaosPROGDIR:test.pngrenders in both test programshttp://aminet.net/pics/aminet.pngfetched and renderedhttp://www.amigaworld.net/...(302 → HTTPS) fails cleanly with placeholder, no crash