Skip to content

Commit 810f204

Browse files
committed
Run format tool
Change-Id: Ie92776f15590e509eed6c477b5aed2527d6f9ca7
1 parent 0d871b5 commit 810f204

File tree

9 files changed

+39
-34
lines changed

9 files changed

+39
-34
lines changed

ios/xcode/MGLKit/MGLKViewController+Mac.mm

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,18 @@ - (void)viewDidAppear
5252
[self resume];
5353
}
5454

55-
- (void)windowWillClose:(NSNotification*)notification
55+
- (void)windowWillClose:(NSNotification *)notification
5656
{
5757
NSLog(@"MGLKViewController windowWillClose:");
5858
[self releaseTimer];
5959
}
6060

6161
static CVReturn CVFrameDisplayCallback(CVDisplayLinkRef displayLink,
62-
const CVTimeStamp* now,
63-
const CVTimeStamp* outputTime,
62+
const CVTimeStamp *now,
63+
const CVTimeStamp *outputTime,
6464
CVOptionFlags flagsIn,
65-
CVOptionFlags* flagsOut,
66-
void* displayLinkContext)
65+
CVOptionFlags *flagsOut,
66+
void *displayLinkContext)
6767
{
6868
// 'CVFrameDisplayCallback' is always called on a secondary thread. Merge the dispatch source
6969
// setup for the main queue so that rendering occurs on the main thread
@@ -119,10 +119,11 @@ - (void)resume
119119
// to execute rendering on the main thread.
120120
if (!_displaySource)
121121
{
122-
_displaySource = dispatch_source_create(DISPATCH_SOURCE_TYPE_DATA_ADD, 0, 0, dispatch_get_main_queue());
123-
__weak MGLKViewController* weakSelf = self;
124-
dispatch_source_set_event_handler(_displaySource, ^(){
125-
[weakSelf frameStep];
122+
_displaySource = dispatch_source_create(DISPATCH_SOURCE_TYPE_DATA_ADD, 0, 0,
123+
dispatch_get_main_queue());
124+
__weak MGLKViewController *weakSelf = self;
125+
dispatch_source_set_event_handler(_displaySource, ^() {
126+
[weakSelf frameStep];
126127
});
127128
dispatch_resume(_displaySource);
128129

@@ -138,10 +139,12 @@ - (void)resume
138139
if (!_displayLink)
139140
{
140141
CVDisplayLinkCreateWithActiveCGDisplays(&_displayLink);
141-
CVDisplayLinkSetOutputCallback(_displayLink, CVFrameDisplayCallback, (__bridge void *)_displaySource);
142+
CVDisplayLinkSetOutputCallback(_displayLink, CVFrameDisplayCallback,
143+
(__bridge void *)_displaySource);
142144
}
143-
CGDirectDisplayID displayID = (CGDirectDisplayID) [window.screen.deviceDescription[@"NSScreenNumber"]
144-
unsignedIntegerValue];
145+
CGDirectDisplayID displayID =
146+
(CGDirectDisplayID)[window.screen
147+
.deviceDescription[@"NSScreenNumber"] unsignedIntegerValue];
145148
CVDisplayLinkSetCurrentCGDisplay(_displayLink, displayID);
146149

147150
CVDisplayLinkStart(_displayLink);
@@ -152,7 +155,8 @@ - (void)resume
152155
_needDisableVsync = YES;
153156

154157
ASSERT(!_displayTimer);
155-
NSTimeInterval frameInterval = (_preferredFramesPerSecond <= 0) ? 0 : (1.0 / _preferredFramesPerSecond);
158+
NSTimeInterval frameInterval =
159+
(_preferredFramesPerSecond <= 0) ? 0 : (1.0 / _preferredFramesPerSecond);
156160
_displayTimer = [NSTimer scheduledTimerWithTimeInterval:frameInterval
157161
target:self
158162
selector:@selector(frameStep)

ios/xcode/MGLKit/MGLKViewController+Private.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
@interface MGLKViewController () {
1313
__weak MGLKView *_glView;
1414
#if TARGET_OS_OSX
15-
NSTimer *_displayTimer; // Used to render with irregular framerate
16-
CVDisplayLinkRef _displayLink; // Used to render in sync with display refresh rate
15+
NSTimer *_displayTimer; // Used to render with irregular framerate
16+
CVDisplayLinkRef _displayLink; // Used to render in sync with display refresh rate
1717
dispatch_source_t _displaySource; // Used together with displayLink
1818
NSWindow *_observedWindow;
1919
#else

ios/xcode/MGLKit/MGLKitPlatform.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515
@compatibility_alias MGLKNativeView UIView;
1616
@compatibility_alias MGLKNativeViewController UIViewController;
1717

18-
#define MGLKApplicationWillResignActiveNotification UIApplicationWillResignActiveNotification
19-
#define MGLKApplicationDidBecomeActiveNotification UIApplicationDidBecomeActiveNotification
18+
# define MGLKApplicationWillResignActiveNotification UIApplicationWillResignActiveNotification
19+
# define MGLKApplicationDidBecomeActiveNotification UIApplicationDidBecomeActiveNotification
2020

2121
#elif TARGET_OS_OSX
2222
# include <Cocoa/Cocoa.h>
2323

2424
@compatibility_alias MGLKNativeView NSView;
2525
@compatibility_alias MGLKNativeViewController NSViewController;
2626

27-
#define MGLKApplicationWillResignActiveNotification NSApplicationWillResignActiveNotification
28-
#define MGLKApplicationDidBecomeActiveNotification NSApplicationDidBecomeActiveNotification
27+
# define MGLKApplicationWillResignActiveNotification NSApplicationWillResignActiveNotification
28+
# define MGLKApplicationDidBecomeActiveNotification NSApplicationDidBecomeActiveNotification
2929
#else
3030
# error "Unsupported platform"
3131
#endif

ios/xcode/MGLKitSampleApp/AppDelegate.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
#include <TargetConditionals.h>
1010

1111
#if TARGET_OS_OSX
12-
#import <Cocoa/Cocoa.h>
12+
# import <Cocoa/Cocoa.h>
1313

1414
@interface AppDelegate : NSObject <NSApplicationDelegate>
1515
#else
16-
#import <UIKit/UIKit.h>
16+
# import <UIKit/UIKit.h>
1717

1818
@interface AppDelegate : UIResponder <UIApplicationDelegate>
1919
@property(nonatomic, retain) IBOutlet UIWindow *window;

ios/xcode/MGLKitSampleApp/AppDelegate.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ @interface AppDelegate ()
1515
@implementation AppDelegate
1616

1717
#if TARGET_OS_OSX
18-
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
18+
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
19+
{
1920
// Insert code here to initialize your application
2021
}
2122

22-
23-
- (void)applicationWillTerminate:(NSNotification *)aNotification {
23+
- (void)applicationWillTerminate:(NSNotification *)aNotification
24+
{
2425
// Insert code here to tear down your application
2526
}
2627

ios/xcode/MGLKitSampleApp/GLViewController.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,24 @@
1414

1515
#if TARGET_OS_OSX
1616
// macOS emulation of UIImage
17-
#import <AppKit/NSImage.h>
17+
# import <AppKit/NSImage.h>
1818

1919
typedef NSImage MGLKNativeImage;
2020

2121
@interface NSImage (MGLK)
22-
- (CGImageRef) CGImage;
22+
- (CGImageRef)CGImage;
2323
@end
2424

2525
@implementation NSImage (MGLK)
26-
- (CGImageRef) CGImage
26+
- (CGImageRef)CGImage
2727
{
2828
CGRect rect = CGRectMake(0, 0, self.size.width, self.size.height);
2929
return [self CGImageForProposedRect:&rect context:nil hints:nil];
3030
}
3131
@end
3232

3333
#else // TARGET_OS_OSX
34-
#import <UIKit/UIImage.h>
34+
# import <UIKit/UIImage.h>
3535

3636
typedef UIImage MGLKNativeImage;
3737
#endif // TARGET_OS_OSX

ios/xcode/samples/samples_env_setup.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
{
1717
@autoreleasepool
1818
{
19-
NSLog(@"%s:%d Setting MetalANGLE framework search path for the sample app", __FILE__, __LINE__);
19+
NSLog(@"%s:%d Setting MetalANGLE framework search path for the sample app", __FILE__,
20+
__LINE__);
2021

2122
#if TARGET_OS_OSX
2223
angle::SetEnvironmentVar("ANGLE_EGL_LIBRARY_NAME", "MetalANGLE");

src/libANGLE/renderer/metal/mtl_buffer_pool.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ namespace mtl
3434
class BufferPool
3535
{
3636
public:
37-
// - alwaysAllocNewBuffer=true will always allocate new buffer or reuse free buffer on allocate(),
38-
// regardless of whether current buffer still has unused portion or not.
37+
// - alwaysAllocNewBuffer=true will always allocate new buffer or reuse free buffer on
38+
// allocate(), regardless of whether current buffer still has unused portion or not.
3939
// - alwaysUseSharedMem: indicate the allocated buffers should be in shared memory or not.
4040
// If this flag is false. Buffer pool will automatically use shared mem if buffer size is small.
4141
BufferPool(bool alwaysAllocNewBuffer = false);
@@ -81,6 +81,7 @@ class BufferPool
8181

8282
// Set whether all subsequent allocated buffers should always use shared memory or not
8383
void setAlwaysUseSharedMem(bool e) { mAlwaysUseSharedMem = e; }
84+
8485
private:
8586
void reset();
8687
angle::Result allocateNewBuffer(ContextMtl *contextMtl);

src/libANGLE/renderer/metal/mtl_buffer_pool.mm

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
}
2525

2626
// BufferPool implementation.
27-
BufferPool::BufferPool(bool alwaysAllocNewBuffer)
28-
: BufferPool(alwaysAllocNewBuffer, false)
29-
{}
27+
BufferPool::BufferPool(bool alwaysAllocNewBuffer) : BufferPool(alwaysAllocNewBuffer, false) {}
3028
BufferPool::BufferPool(bool alwaysAllocNewBuffer, bool alwaysUseSharedMem)
3129
: mInitialSize(0),
3230
mBuffer(nullptr),

0 commit comments

Comments
 (0)