21 #include "../../SDL_internal.h"
23 #if SDL_VIDEO_DRIVER_COCOA
28 #include "../../events/SDL_events_c.h"
32 #ifndef kIOPMAssertPreventUserIdleDisplaySleep
33 #define kIOPMAssertPreventUserIdleDisplaySleep kIOPMAssertionTypePreventUserIdleDisplaySleep
35 #ifndef NSAppKitVersionNumber10_8
36 #define NSAppKitVersionNumber10_8 1187
39 @interface SDLApplication : NSApplication
42 - (
void)sendEvent:(NSEvent *)theEvent;
44 + (
void)registerUserDefaults;
48 @implementation SDLApplication
58 static void Cocoa_DispatchEvent(NSEvent *theEvent)
62 switch ([theEvent
type]) {
63 case NSEventTypeLeftMouseDown:
64 case NSEventTypeOtherMouseDown:
65 case NSEventTypeRightMouseDown:
66 case NSEventTypeLeftMouseUp:
67 case NSEventTypeOtherMouseUp:
68 case NSEventTypeRightMouseUp:
69 case NSEventTypeLeftMouseDragged:
70 case NSEventTypeRightMouseDragged:
71 case NSEventTypeOtherMouseDragged:
72 case NSEventTypeMouseMoved:
73 case NSEventTypeScrollWheel:
76 case NSEventTypeKeyDown:
77 case NSEventTypeKeyUp:
78 case NSEventTypeFlagsChanged:
89 - (
void)sendEvent:(NSEvent *)theEvent
91 if (s_bShouldHandleEventsInSDLApplication) {
92 Cocoa_DispatchEvent(theEvent);
95 [
super sendEvent:theEvent];
98 + (
void)registerUserDefaults
100 NSDictionary *appDefaults = [[NSDictionary alloc] initWithObjectsAndKeys:
101 [NSNumber numberWithBool:NO], @"AppleMomentumScrollSupported",
102 [NSNumber numberWithBool:NO], @"ApplePressAndHoldEnabled",
103 [NSNumber numberWithBool:YES], @"ApplePersistenceIgnoreState",
105 [[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];
106 [appDefaults release];
112 @interface NSApplication(NSAppleMenu)
113 - (
void)setAppleMenu:(NSMenu *)menu;
116 @interface SDLAppDelegate : NSObject <NSApplicationDelegate> {
118 BOOL seenFirstActivate;
122 - (
void)localeDidChange:(NSNotification *)notification;
125 @implementation SDLAppDelegate : NSObject
130 NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
132 seenFirstActivate = NO;
134 [center addObserver:self
135 selector:@selector(windowWillClose:)
136 name:NSWindowWillCloseNotification
139 [center addObserver:self
140 selector:@selector(focusSomeWindow:)
141 name:NSApplicationDidBecomeActiveNotification
144 [center addObserver:self
145 selector:@selector(localeDidChange:)
146 name:NSCurrentLocaleDidChangeNotification
155 NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
157 [center removeObserver:self name:NSWindowWillCloseNotification object:nil];
158 [center removeObserver:self name:NSApplicationDidBecomeActiveNotification object:nil];
159 [center removeObserver:self name:NSCurrentLocaleDidChangeNotification object:nil];
164 - (
void)windowWillClose:(NSNotification *)notification;
166 NSWindow *win = (NSWindow*)[notification
object];
168 if (![win isKeyWindow]) {
181 for (NSWindow *
window in [NSApp orderedWindows]) {
183 if (![
window isOnActiveSpace]) {
195 for (NSNumber *
num in [NSWindow windowNumbersWithOptions:0]) {
198 [window makeKeyAndOrderFront:self];
204 - (
void)focusSomeWindow:(NSNotification *)aNotification
211 if (!seenFirstActivate) {
212 seenFirstActivate = YES;
220 for (
i = 0;
i <
device->num_displays; ++
i) {
222 if (fullscreen_window) {
224 SDL_RestoreWindow(fullscreen_window);
231 SDL_RestoreWindow(window);
233 SDL_RaiseWindow(window);
238 - (
void)localeDidChange:(NSNotification *)notification;
243 - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
248 - (
void)applicationDidFinishLaunching:(NSNotification *)notification
257 for (NSRunningApplication *
i in [NSRunningApplication runningApplicationsWithBundleIdentifier:
@"com.apple.dock"]) {
258 [i activateWithOptions:NSApplicationActivateIgnoringOtherApps];
262 [NSApp activateIgnoringOtherApps:YES];
265 [[NSAppleEventManager sharedAppleEventManager]
267 andSelector:@selector(handleURLEvent:withReplyEvent:)
268 forEventClass:kInternetEventClass
269 andEventID:kAEGetURL];
273 [SDLApplication registerUserDefaults];
276 - (
void)handleURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent
278 NSString*
path = [[event paramDescriptorForKeyword:keyDirectObject] stringValue];
285 static SDLAppDelegate *appDelegate = nil;
288 GetApplicationName(
void)
293 appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
295 appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];
299 appName = [[NSProcessInfo processInfo] processName];
306 LoadMainMenuNibIfAvailable(
void)
308 NSDictionary *infoDict;
309 NSString *mainNibFileName;
310 bool success =
false;
312 if (
floor(NSAppKitVersionNumber) < NSAppKitVersionNumber10_8) {
315 infoDict = [[NSBundle mainBundle] infoDictionary];
317 mainNibFileName = [infoDict valueForKey:@"NSMainNibFile"];
319 if (mainNibFileName) {
320 success = [[NSBundle mainBundle] loadNibNamed:mainNibFileName owner:[NSApplication sharedApplication] topLevelObjects:nil];
328 CreateApplicationMenus(
void)
335 NSMenuItem *menuItem;
342 mainMenu = [[NSMenu alloc] init];
345 [NSApp setMainMenu:mainMenu];
351 appName = GetApplicationName();
352 appleMenu = [[NSMenu alloc] initWithTitle:@""];
355 title = [@"About " stringByAppendingString:appName];
356 [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
358 [appleMenu addItem:[NSMenuItem separatorItem]];
360 [appleMenu addItemWithTitle:@"Preferencesâ €¦" action:nil keyEquivalent:@","];
362 [appleMenu addItem:[NSMenuItem separatorItem]];
364 serviceMenu = [[NSMenu alloc] initWithTitle:@""];
365 menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:
@"Services" action:nil keyEquivalent:
@""];
366 [menuItem setSubmenu:serviceMenu];
368 [NSApp setServicesMenu:serviceMenu];
369 [serviceMenu release];
371 [appleMenu addItem:[NSMenuItem separatorItem]];
373 title = [@"Hide " stringByAppendingString:appName];
374 [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];
376 menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:
@"Hide Others" action:
@selector(hideOtherApplications:) keyEquivalent:
@"h"];
377 [menuItem setKeyEquivalentModifierMask:(NSEventModifierFlagOption|NSEventModifierFlagCommand)];
379 [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
381 [appleMenu addItem:[NSMenuItem separatorItem]];
383 title = [@"Quit " stringByAppendingString:appName];
384 [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
387 menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
388 [menuItem setSubmenu:appleMenu];
389 [[NSApp mainMenu] addItem:menuItem];
393 [NSApp setAppleMenu:appleMenu];
398 windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
401 [windowMenu addItemWithTitle:@"Close" action:@selector(performClose:) keyEquivalent:@"w"];
403 [windowMenu addItemWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
405 [windowMenu addItemWithTitle:@"Zoom" action:@selector(performZoom:) keyEquivalent:@""];
408 if (
floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6) {
412 menuItem = [[NSMenuItem alloc] initWithTitle:@"Toggle Full Screen" action:@selector(toggleFullScreen:) keyEquivalent:@"f"];
413 [menuItem setKeyEquivalentModifierMask:NSEventModifierFlagControl | NSEventModifierFlagCommand];
414 [windowMenu addItem:menuItem];
419 menuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
420 [menuItem setSubmenu:windowMenu];
421 [[NSApp mainMenu] addItem:menuItem];
425 [NSApp setWindowsMenu:windowMenu];
426 [windowMenu release];
436 [SDLApplication sharedApplication];
439 s_bShouldHandleEventsInSDLApplication =
SDL_TRUE;
442 [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
449 if ([NSApp mainMenu] == nil) {
452 nibLoaded = LoadMainMenuNibIfAvailable();
454 CreateApplicationMenus();
457 [NSApp finishLaunching];
458 if ([NSApp delegate]) {
462 [SDLApplication registerUserDefaults];
465 if (NSApp && !appDelegate) {
466 appDelegate = [[SDLAppDelegate alloc] init];
471 if (![NSApp delegate]) {
472 [(NSApplication *)NSApp setDelegate:appDelegate];
474 appDelegate->seenFirstActivate = YES;
483 #if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
488 if (!
data->screensaver_activity ||
490 UpdateSystemActivity(UsrActivity);
491 data->screensaver_activity = now;
497 NSEvent *
event = [NSApp nextEventMatchingMask:NSEventMaskAny untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES ];
498 if (
event == nil ) {
502 if (!s_bShouldHandleEventsInSDLApplication) {
503 Cocoa_DispatchEvent(
event);
507 [NSApp sendEvent:event];
517 if (!
data->screensaver_use_iopm) {
521 if (
data->screensaver_assertion) {
522 IOPMAssertionRelease(
data->screensaver_assertion);
523 data->screensaver_assertion = 0;
532 NSString *
name = [GetApplicationName() stringByAppendingString:@" using SDL_DisableScreenSaver"];
533 IOPMAssertionCreateWithDescription(kIOPMAssertPreventUserIdleDisplaySleep,
536 &
data->screensaver_assertion);
#define SDL_assert(condition)
void Cocoa_RegisterApp(void)
void Cocoa_SuspendScreenSaver(_THIS)
void Cocoa_PumpEvents(_THIS)
void Cocoa_HandleKeyEvent(_THIS, NSEvent *event)
void Cocoa_HandleMouseEvent(_THIS, NSEvent *event)
int SDL_SendDropFile(SDL_Window *window, const char *file)
int SDL_SendDropComplete(SDL_Window *window)
#define SDL_GetHintBoolean
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 void
int SDL_SendLocaleChangedEvent(void)
#define SDL_HINT_MAC_BACKGROUND_APP
When set don't force the SDL app to become a foreground process.
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLuint GLuint GLsizei GLenum type
GLuint const GLchar * name
GLsizei const GLchar *const * path
GLuint GLsizei GLsizei * length
SDL_VideoDevice * SDL_GetVideoDevice(void)
Uint32 SDL_GetTicks(void)
Get the number of milliseconds since the SDL library initialization.
#define SDL_TICKS_PASSED(A, B)
Compare SDL ticks values, and return true if A has passed B.
static SDL_VideoDevice * _this
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
EGLSurface EGLNativeWindowType * window
static SDL_AudioDeviceID device
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d ®2 endm macro vzip8 reg2 vzip d d ®2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld init[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1 beq endif SRC MASK if dst_r_bpp DST_R else add endif PF add sub src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head pixblock_size cache_preload_simple process_pixblock_tail pixinterleave dst_w_basereg irp beq endif process_pixblock_tail_head tst beq irp if pixblock_size chunk_size tst beq pixld_src SRC pixld MASK if DST_R else pixld DST_R endif if src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head if pixblock_size cache_preload_simple endif process_pixblock_tail pixinterleave dst_w_basereg irp if pixblock_size chunk_size tst beq if DST_W else pixst DST_W else mov ORIG_W endif add lsl if lsl endif if lsl endif lsl endif lsl endif lsl endif subs mov DST_W if regs_shortage str endif bge start_of_loop_label endm macro generate_composite_function
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d ®2 endm macro vzip8 reg2 vzip d d ®2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld if[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1(dst_w_bpp<=(lowbit *8)) &&((lowbit *8)<(pixblock_size *dst_w_bpp)) .if lowbit< 16 tst DST_R
set set set set set set set set set set set set set set set set set set set set *set set set macro pixldst op &r &cond WK op &r &cond WK op &r &cond WK else op &m &cond &ia op &r &cond WK else op &m &cond &ia elseif elseif else error unsupported base if elseif elseif else error unsupported unaligned pixldst unaligned endm macro pixst base base else pixldst base endif endm macro PF base if bpp PF set rept prefetch_distance PF set OFFSET endr endif endm macro preload_leading_step2 base if bpp ifc DST PF PF else if bpp lsl PF PF lsl PF PF lsl PF PF PF else PF lsl PF lsl PF lsl PF endif SIZE macro preload_middle scratch_holds_offset if bpp if else PF PF endif endif endif endm macro preload_trailing base if bpp if bpp *pix_per_block PF PF lsl PF PF PF PF PF else PF lsl PF lsl PF PF PF PF PF base if bpp if narrow_case &&bpp<=dst_w_bpp) PF bic, WK0, base, #31 PF pld,[WK0] PF add, WK1, base, X, LSL #bpp_shift PF sub, WK1, WK1, #1 PF bic, WK1, WK1, #31 PF cmp, WK1, WK0 PF beq, 90f PF pld,[WK1]90:.else PF bic, WK0, base, #31 PF pld,[WK0] PF add, WK1, base, X, lsl #bpp_shift PF sub, WK1, WK1, #1 PF bic, WK1, WK1, #31 PF cmp, WK1, WK0 PF beq, 92f91:PF add, WK0, WK0, #32 PF cmp, WK0, WK1 PF pld,[WK0] PF bne, 91b92:.endif .endif.endm.macro conditional_process1_helper cond, process_head, process_tail, numbytes, firstreg, unaligned_src, unaligned_mask, decrementx process_head cond, numbytes, firstreg, unaligned_src, unaligned_mask, 0 .if decrementx sub &cond X, X, #8 *numbytes/dst_w_bpp .endif process_tail cond, numbytes, firstreg .if !((flags) &FLAG_PROCESS_DOES_STORE) pixst cond, numbytes, firstreg, DST .endif.endm.macro conditional_process1 cond, process_head, process_tail, numbytes, firstreg, unaligned_src, unaligned_mask, decrementx .if(flags) &FLAG_BRANCH_OVER .ifc cond, mi bpl 100f .endif .ifc cond, cs bcc 100f .endif .ifc cond, ne beq 100f .endif conditional_process1_helper, process_head, process_tail, numbytes, firstreg, unaligned_src, unaligned_mask, decrementx100:.else conditional_process1_helper cond, process_head, process_tail, numbytes, firstreg, unaligned_src, unaligned_mask, decrementx .endif.endm.macro conditional_process2 test, cond1, cond2, process_head, process_tail, numbytes1, numbytes2, firstreg1, firstreg2, unaligned_src, unaligned_mask, decrementx .if(flags) &(FLAG_DST_READWRITE|FLAG_BRANCH_OVER|FLAG_PROCESS_CORRUPTS_PSR|FLAG_PROCESS_DOES_STORE) test conditional_process1 cond1, process_head, process_tail, numbytes1, firstreg1, unaligned_src, unaligned_mask, decrementx .if(flags) &FLAG_PROCESS_CORRUPTS_PSR test .endif conditional_process1 cond2, process_head, process_tail, numbytes2, firstreg2, unaligned_src, unaligned_mask, decrementx .else test process_head cond1, numbytes1, firstreg1, unaligned_src, unaligned_mask, 0 process_head cond2, numbytes2, firstreg2, unaligned_src, unaligned_mask, 0 .if decrementx sub &cond1 X, X, #8 *numbytes1/dst_w_bpp sub &cond2 X, X, #8 *numbytes2/dst_w_bpp .endif process_tail cond1, numbytes1, firstreg1 process_tail cond2, numbytes2, firstreg2 pixst cond1, numbytes1, firstreg1, DST pixst cond2, numbytes2, firstreg2, DST .endif.endm.macro test_bits_1_0_ptr .if(flags) &FLAG_PROCESS_CORRUPTS_WK0 movs SCRATCH, X, lsl #32-1 .else movs SCRATCH, WK0, lsl #32-1 .endif.endm.macro test_bits_3_2_ptr .if(flags) &FLAG_PROCESS_CORRUPTS_WK0 movs SCRATCH, X, lsl #32-3 .else movs SCRATCH, WK0, lsl #32-3 .endif.endm.macro leading_15bytes process_head, process_tail .set DECREMENT_X, 1 .if(flags) &FLAG_PROCESS_CORRUPTS_WK0 .set DECREMENT_X, 0 sub X, X, WK0, lsr #dst_bpp_shift str X,[sp, #LINE_SAVED_REG_COUNT *4] mov X, WK0 .endif .if dst_w_bpp==8 conditional_process2 test_bits_1_0_ptr, mi, cs, process_head, process_tail, 1, 2, 1, 2, 1, 1, DECREMENT_X .elseif dst_w_bpp==16 test_bits_1_0_ptr conditional_process1 cs, process_head, process_tail, 2, 2, 1, 1, DECREMENT_X .endif conditional_process2 test_bits_3_2_ptr, mi, cs, process_head, process_tail, 4, 8, 1, 2, 1, 1, DECREMENT_X .if(flags) &FLAG_PROCESS_CORRUPTS_WK0 ldr X,[sp, #LINE_SAVED_REG_COUNT *4] .endif.endm.macro test_bits_3_2_pix movs SCRATCH, X, lsl #dst_bpp_shift+32-3.endm.macro test_bits_1_0_pix .if dst_w_bpp==8 movs SCRATCH, X, lsl #dst_bpp_shift+32-1 .else movs SCRATCH, X, lsr #1 .endif.endm.macro trailing_15bytes process_head, process_tail, unaligned_src, unaligned_mask conditional_process2 test_bits_3_2_pix, cs, mi, process_head, process_tail, 8, 4, 0, 2, unaligned_src, unaligned_mask, 0 .if dst_w_bpp==16 test_bits_1_0_pix conditional_process1 cs, process_head, process_tail, 2, 0, unaligned_src, unaligned_mask, 0 .elseif dst_w_bpp==8 conditional_process2 test_bits_1_0_pix, cs, mi, process_head, process_tail, 2, 1, 0, 1, unaligned_src, unaligned_mask, 0 .endif.endm.macro wide_case_inner_loop process_head, process_tail, unaligned_src, unaligned_mask, dst_alignment110:.set SUBBLOCK, 0 .rept pix_per_block *dst_w_bpp/128 process_head, 16, 0, unaligned_src, unaligned_mask, 1 .if(src_bpp > 0) &&(mask_bpp==0) &&((flags) &FLAG_PROCESS_PRESERVES_SCRATCH) preload_middle src_bpp, SRC, 1 .elseif(src_bpp==0) &&(mask_bpp > 0) &&((flags) &FLAG_PROCESS_PRESERVES_SCRATCH) preload_middle mask_bpp, MASK, 1 .else preload_middle src_bpp, SRC, 0 preload_middle mask_bpp, MASK, 0 .endif .if(dst_r_bpp > 0) &&((SUBBLOCK % 2)==0) &&(((flags) &FLAG_NO_PRELOAD_DST)==0) PF pld,[DST, #32 *prefetch_distance - dst_alignment] .endif process_tail, 16, 0 .if !((flags) &FLAG_PROCESS_DOES_STORE) pixst, 16, 0, DST .endif .set SUBBLOCK, SUBBLOCK+1 .endr subs X, X, #pix_per_block bhs 110b.endm.macro wide_case_inner_loop_and_trailing_pixels process_head, process_tail, process_inner_loop, exit_label, unaligned_src, unaligned_mask .if dst_r_bpp > tst bne process_inner_loop DST_PRELOAD_BIAS endif preload_trailing SRC preload_trailing MASK DST endif add medium_case_inner_loop_and_trailing_pixels unaligned_mask endm macro medium_case_inner_loop_and_trailing_pixels DST endif subs bhs tst beq exit_label trailing_15bytes unaligned_mask endm macro narrow_case_inner_loop_and_trailing_pixels unaligned_mask tst conditional_process1 trailing_15bytes unaligned_mask endm macro switch_on_alignment action
SDL_bool suspend_screensaver
The type used to identify a window.