[Bf-blender-cvs] [f9575ce9eac] temp-benchmark: Benchmark: fixes for macOS.

Brecht Van Lommel noreply at git.blender.org
Tue Aug 7 17:16:13 CEST 2018


Commit: f9575ce9eac17ed14b500f14ef29b5a57e2849dc
Author: Brecht Van Lommel
Date:   Tue Aug 7 16:17:29 2018 +0200
Branches: temp-benchmark
https://developer.blender.org/rBf9575ce9eac17ed14b500f14ef29b5a57e2849dc

Benchmark: fixes for macOS.

===================================================================

M	GNUmakefile
M	release/darwin/blender.app/Contents/Info.plist
M	source/blender/windowmanager/intern/wm_window.c

===================================================================

diff --git a/GNUmakefile b/GNUmakefile
index c1be177ddc0..aea1f6a5b81 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -71,6 +71,10 @@ ifneq "$(findstring full, $(MAKECMDGOALS))" ""
 	BUILD_DIR:=$(BUILD_DIR)_full
 	BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_full.cmake"
 endif
+ifneq "$(findstring benchmark, $(MAKECMDGOALS))" ""
+	BUILD_DIR:=$(BUILD_DIR)_benchmark
+	BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_benchmark.cmake"
+endif
 ifneq "$(findstring lite, $(MAKECMDGOALS))" ""
 	BUILD_DIR:=$(BUILD_DIR)_lite
 	BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_lite.cmake"
@@ -146,6 +150,7 @@ all: .FORCE
 debug: all
 full: all
 lite: all
+benchmark: all
 cycles: all
 headless: all
 bpy: all
diff --git a/release/darwin/blender.app/Contents/Info.plist b/release/darwin/blender.app/Contents/Info.plist
index 92e8d8cc761..1f86b31a18d 100644
--- a/release/darwin/blender.app/Contents/Info.plist
+++ b/release/darwin/blender.app/Contents/Info.plist
@@ -26,17 +26,17 @@
 		</dict>
 	</array>
 	<key>CFBundleExecutable</key>
-	<string>blender</string>
+	<string>blender-benchmark</string>
 	<key>CFBundleGetInfoString</key>
 	<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}, Blender Foundation</string>
 	<key>CFBundleIconFile</key>
 	<string>blender icon.icns</string>
 	<key>CFBundleIdentifier</key>
-	<string>org.blenderfoundation.blender</string>
+	<string>org.blenderfoundation.blender-benchmark</string>
 	<key>CFBundleInfoDictionaryVersion</key>
 	<string>6.0</string>
 	<key>CFBundleName</key>
-	<string>Blender</string>
+	<string>Blender Benchmark</string>
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index b86026623c0..13637a4ea3c 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -694,7 +694,7 @@ static void wm_window_ghostwindow_add(wmWindowManager *wm, const char *title, wm
 }
 
 /* Benchmark: ugly hack to get DPI before we have opened any windows. */
-static void wm_window_set_startup_dpi(wmWindow *win)
+static void wm_window_set_startup_dpi(wmWindow *win, float *native_pixel_size)
 {
 	GHOST_GLSettings glSettings = {0};
 
@@ -706,6 +706,8 @@ static void wm_window_set_startup_dpi(wmWindow *win)
 
 	WM_window_set_dpi(win);
 
+	*native_pixel_size = GHOST_GetNativePixelSize(win->ghostwin);
+
 	GHOST_DisposeWindow(g_system, win->ghostwin);
 	win->ghostwin = NULL;
 }
@@ -778,9 +780,10 @@ void wm_window_ghostwindows_ensure(wmWindowManager *wm)
 			}
 
 			/* Benchmark: fixed size and centered window. */
-			wm_window_set_startup_dpi(win);
-			win->sizex = 800 * UI_DPI_FAC;
-			win->sizey = 570 * UI_DPI_FAC;
+			float native_pixel_size;
+			wm_window_set_startup_dpi(win, &native_pixel_size);
+			win->sizex = 800 * UI_DPI_FAC / native_pixel_size;
+			win->sizey = 570 * UI_DPI_FAC / native_pixel_size;
 
 			int scr_w, scr_h;
 			wm_get_screensize(&scr_w, &scr_h);



More information about the Bf-blender-cvs mailing list