We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1357 - [Mac] Blank video in SheepShaver with SDL 1.2 HEAD
Summary: [Mac] Blank video in SheepShaver with SDL 1.2 HEAD
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 1.2
Hardware: x86 Mac OS X 10.6
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-02 18:17 UTC by Alexei Svitkine
Modified: 2012-01-03 19:40 UTC (History)
1 user (show)

See Also:


Attachments
Patch (826 bytes, patch)
2012-01-02 18:17 UTC, Alexei Svitkine
Details | Diff
Alternate approach (2.62 KB, patch)
2012-01-02 21:28 UTC, Ryan C. Gordon
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexei Svitkine 2012-01-02 18:17:05 UTC
A change from SDL 1.2.14 to QZ_UpdateRects() made SDL use [NSGraphicsContext currentContext] for drawing. For SheepShaver, this ended up being nil, and no drawing took place.

The attached patch fixes this by reverting to using [NSGraphicsContext graphicsContextWithWindow: qz_window], which works correctly.

It also wraps the whole thing in an NSAutoreleasePool, since the above returns an auto-released context, which prevents memory leaks for users of this API on threads other than the main thread, like SheepShaver. (The leak was introduced in SDL 1.2.14, the code before 1.2.14 didn't have the issue.)
Comment 1 Alexei Svitkine 2012-01-02 18:17:39 UTC
Created attachment 757 [details]
Patch
Comment 2 Alexei Svitkine 2012-01-02 18:19:25 UTC
Note: Without this change, SheepShaver doesn't work at all with SDL 1.2 hg HEAD - i.e. nothing is displayed.
Comment 3 Ryan C. Gordon 2012-01-02 21:28:38 UTC
Created attachment 758 [details]
Alternate approach


Can you try this patch instead, and see if it works?

Thanks,
--ryan.
Comment 4 Ryan C. Gordon 2012-01-02 21:31:43 UTC
(In reply to comment #2)
> Note: Without this change, SheepShaver doesn't work at all with SDL 1.2 hg HEAD
> - i.e. nothing is displayed.

Also: this has happened to work before, but the SDL API doesn't allow rendering from background threads...this is simple enough to fix on Mac OS X that it's silly to leave it broken, but just be warned: other platforms will definitely fail and/or crash if you try to do this.

--ryan.
Comment 5 Alexei Svitkine 2012-01-03 15:01:20 UTC
Patch from comment 3 works fine.
Comment 6 Ryan C. Gordon 2012-01-03 19:40:08 UTC
(In reply to comment #5)
> Patch from comment 3 works fine.

Cool, that is now hg changeset 8a1bc41db6bb, thanks!

--ryan.