Mercurial > sdl-ios-xcode
comparison src/video/cocoa/SDL_cocoashape.m @ 4835:40b5293d0598
Finally figured out how to use autorelease pools.
author | egottlieb |
---|---|
date | Thu, 05 Aug 2010 21:27:32 -0400 |
parents | fd5bb97ec05d |
children | 05d172e92b52 |
comparison
equal
deleted
inserted
replaced
4834:fd5bb97ec05d | 4835:40b5293d0598 |
---|---|
84 [NSGraphicsContext setCurrentContext:data->context]; | 84 [NSGraphicsContext setCurrentContext:data->context]; |
85 SDL_WindowData* window_data = (SDL_WindowData*)shaper->window->driverdata; | 85 SDL_WindowData* window_data = (SDL_WindowData*)shaper->window->driverdata; |
86 | 86 |
87 data->shape = SDL_CalculateShapeTree(*shapeMode,shape,SDL_FALSE); | 87 data->shape = SDL_CalculateShapeTree(*shapeMode,shape,SDL_FALSE); |
88 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | 88 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; |
89 NSBezierPath* clipPath = [[NSBezierPath bezierPath] autorelease]; | 89 NSBezierPath* clipPath = [NSBezierPath bezierPath]; |
90 | 90 |
91 SDL_PathConglomeration cong = {clipPath,shaper->window}; | 91 SDL_PathConglomeration cong = {clipPath,shaper->window}; |
92 | 92 |
93 SDL_TraverseShapeTree(data->shape,(SDL_TraversalFunction)&ConglomerateShapeTree,(void*)&cong); | 93 SDL_TraverseShapeTree(data->shape,(SDL_TraversalFunction)&ConglomerateShapeTree,(void*)&cong); |
94 | 94 |
95 SDL_assert([NSGraphicsContext currentContext] != NULL); | 95 SDL_assert([NSGraphicsContext currentContext] != Nil); |
96 [clipPath addClip]; | 96 [clipPath addClip]; |
97 | 97 |
98 [NSGraphicsContext restoreGraphicsState]; | 98 [NSGraphicsContext restoreGraphicsState]; |
99 [pool release]; | 99 [pool release]; |
100 } | 100 } |