mirror of
https://github.com/godotengine/godot.git
synced 2026-02-07 19:32:36 +00:00
Add some important profiling hooks.
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#import "godot_window.h"
|
||||
#import "key_mapping_macos.h"
|
||||
|
||||
#include "core/profiling/profiling.h"
|
||||
#include "main/main.h"
|
||||
|
||||
@implementation GodotContentLayerDelegate
|
||||
@@ -56,6 +57,9 @@
|
||||
- (void)displayLayer:(CALayer *)layer {
|
||||
DisplayServerMacOS *ds = (DisplayServerMacOS *)DisplayServer::get_singleton();
|
||||
if (OS::get_singleton()->get_main_loop() && ds->get_is_resizing() && need_redraw) {
|
||||
GodotProfileFrameMark;
|
||||
GodotProfileZone("[GodotContentLayerDelegate displayLayer]");
|
||||
|
||||
Main::force_redraw();
|
||||
if (!Main::is_iterating()) { // Avoid cyclic loop.
|
||||
Main::iteration();
|
||||
|
||||
@@ -1106,6 +1106,9 @@ void OS_MacOS_NSApp::start_main() {
|
||||
pre_wait_observer = CFRunLoopObserverCreateWithHandler(kCFAllocatorDefault, kCFRunLoopBeforeWaiting, true, 0, ^(CFRunLoopObserverRef observer, CFRunLoopActivity activity) {
|
||||
@autoreleasepool {
|
||||
@try {
|
||||
GodotProfileFrameMark;
|
||||
GodotProfileZone("macOS main loop");
|
||||
|
||||
if (ds_mac) {
|
||||
ds_mac->_process_events(false);
|
||||
} else if (ds) {
|
||||
@@ -1279,6 +1282,9 @@ void OS_MacOS_Embedded::run() {
|
||||
while (true) {
|
||||
@autoreleasepool {
|
||||
@try {
|
||||
GodotProfileFrameMark;
|
||||
GodotProfileZone("macOS embedded main loop");
|
||||
|
||||
ds->process_events();
|
||||
|
||||
#ifdef SDL_ENABLED
|
||||
|
||||
Reference in New Issue
Block a user