Skip to content

Commit

Permalink
Rename internal GetDisplayDPI to GetDisplayPhysicalDPI
Browse files Browse the repository at this point in the history
  • Loading branch information
1bsyl authored and slouken committed Jan 25, 2023
1 parent 724d92f commit 78cc95e
Show file tree
Hide file tree
Showing 19 changed files with 31 additions and 31 deletions.
10 changes: 5 additions & 5 deletions src/core/android/SDL_android.c
Expand Up @@ -304,7 +304,7 @@ static jmethodID midClipboardSetText;
static jmethodID midCreateCustomCursor;
static jmethodID midDestroyCustomCursor;
static jmethodID midGetContext;
static jmethodID midGetDisplayDPI;
static jmethodID midGetDisplayPhysicalDPI;
static jmethodID midGetManifestEnvironmentVariables;
static jmethodID midGetNativeSurface;
static jmethodID midInitTouch;
Expand Down Expand Up @@ -593,7 +593,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeSetupJNI)(JNIEnv *env, jclass cl
midCreateCustomCursor = (*env)->GetStaticMethodID(env, mActivityClass, "createCustomCursor", "([IIIII)I");
midDestroyCustomCursor = (*env)->GetStaticMethodID(env, mActivityClass, "destroyCustomCursor", "(I)V");
midGetContext = (*env)->GetStaticMethodID(env, mActivityClass, "getContext", "()Landroid/content/Context;");
midGetDisplayDPI = (*env)->GetStaticMethodID(env, mActivityClass, "getDisplayDPI", "()Landroid/util/DisplayMetrics;");
midGetDisplayPhysicalDPI = (*env)->GetStaticMethodID(env, mActivityClass, "getDisplayDPI", "()Landroid/util/DisplayMetrics;");
midGetManifestEnvironmentVariables = (*env)->GetStaticMethodID(env, mActivityClass, "getManifestEnvironmentVariables", "()Z");
midGetNativeSurface = (*env)->GetStaticMethodID(env, mActivityClass, "getNativeSurface", "()Landroid/view/Surface;");
midInitTouch = (*env)->GetStaticMethodID(env, mActivityClass, "initTouch", "()V");
Expand Down Expand Up @@ -624,7 +624,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeSetupJNI)(JNIEnv *env, jclass cl
!midCreateCustomCursor ||
!midDestroyCustomCursor ||
!midGetContext ||
!midGetDisplayDPI ||
!midGetDisplayPhysicalDPI ||
!midGetManifestEnvironmentVariables ||
!midGetNativeSurface ||
!midInitTouch ||
Expand Down Expand Up @@ -1650,11 +1650,11 @@ SDL_DisplayOrientation Android_JNI_GetDisplayOrientation(void)
return displayOrientation;
}

int Android_JNI_GetDisplayDPI(float *ddpi, float *xdpi, float *ydpi)
int Android_JNI_GetDisplayPhysicalDPI(float *ddpi, float *xdpi, float *ydpi)
{
JNIEnv *env = Android_JNI_GetEnv();

jobject jDisplayObj = (*env)->CallStaticObjectMethod(env, mActivityClass, midGetDisplayDPI);
jobject jDisplayObj = (*env)->CallStaticObjectMethod(env, mActivityClass, midGetDisplayPhysicalDPI);
jclass jDisplayClass = (*env)->GetObjectClass(env, jDisplayObj);

jfieldID fidXdpi = (*env)->GetFieldID(env, jDisplayClass, "xdpi", "F");
Expand Down
2 changes: 1 addition & 1 deletion src/core/android/SDL_android.h
Expand Up @@ -44,7 +44,7 @@ extern SDL_bool Android_JNI_IsScreenKeyboardShown(void);
extern ANativeWindow *Android_JNI_GetNativeWindow(void);

extern SDL_DisplayOrientation Android_JNI_GetDisplayOrientation(void);
extern int Android_JNI_GetDisplayDPI(float *ddpi, float *xdpi, float *ydpi);
extern int Android_JNI_GetDisplayPhysicalDPI(float *ddpi, float *xdpi, float *ydpi);

/* Audio support */
extern void Android_DetectDevices(void);
Expand Down
2 changes: 1 addition & 1 deletion src/video/SDL_sysvideo.h
Expand Up @@ -196,7 +196,7 @@ struct SDL_VideoDevice
/*
* Get the dots/pixels-per-inch of a display
*/
int (*GetDisplayDPI)(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi);
int (*GetDisplayPhysicalDPI)(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi);

/*
* Get a list of the available display modes for a display.
Expand Down
4 changes: 2 additions & 2 deletions src/video/SDL_video.c
Expand Up @@ -754,8 +754,8 @@ int SDL_GetDisplayPhysicalDPI(int displayIndex, float *ddpi, float *hdpi, float

display = &_this->displays[displayIndex];

if (_this->GetDisplayDPI) {
if (_this->GetDisplayDPI(_this, display, ddpi, hdpi, vdpi) == 0) {
if (_this->GetDisplayPhysicalDPI) {
if (_this->GetDisplayPhysicalDPI(_this, display, ddpi, hdpi, vdpi) == 0) {
return 0;
}
} else {
Expand Down
8 changes: 4 additions & 4 deletions src/video/android/SDL_androidvideo.c
Expand Up @@ -44,7 +44,7 @@
/* Initialization/Query functions */
static int Android_VideoInit(_THIS);
static void Android_VideoQuit(_THIS);
int Android_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi);
int Android_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi);

#include "../SDL_egl_c.h"
#define Android_GLES_GetProcAddress SDL_EGL_GetProcAddressInternal
Expand Down Expand Up @@ -109,7 +109,7 @@ static SDL_VideoDevice *Android_CreateDevice(void)
device->PumpEvents = Android_PumpEvents_NonBlocking;
}

device->GetDisplayDPI = Android_GetDisplayDPI;
device->GetDisplayPhysicalDPI = Android_GetDisplayPhysicalDPI;

device->CreateSDLWindow = Android_CreateWindow;
device->SetWindowTitle = Android_SetWindowTitle;
Expand Down Expand Up @@ -206,9 +206,9 @@ void Android_VideoQuit(_THIS)
Android_QuitTouch();
}

int Android_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi)
int Android_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi)
{
return Android_JNI_GetDisplayDPI(ddpi, hdpi, vdpi);
return Android_JNI_GetDisplayPhysicalDPI(ddpi, hdpi, vdpi);
}

void Android_SetScreenResolution(int surfaceWidth, int surfaceHeight, int deviceWidth, int deviceHeight, float rate)
Expand Down
2 changes: 1 addition & 1 deletion src/video/cocoa/SDL_cocoamodes.h
Expand Up @@ -37,7 +37,7 @@ extern void Cocoa_InitModes(_THIS);
extern int Cocoa_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect);
extern int Cocoa_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect);
extern void Cocoa_GetDisplayModes(_THIS, SDL_VideoDisplay *display);
extern int Cocoa_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi);
extern int Cocoa_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi);
extern int Cocoa_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode);
extern void Cocoa_QuitModes(_THIS);

Expand Down
2 changes: 1 addition & 1 deletion src/video/cocoa/SDL_cocoamodes.m
Expand Up @@ -413,7 +413,7 @@ int Cocoa_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rec
return 0;
}

int Cocoa_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi)
int Cocoa_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi)
{
@autoreleasepool {
const float MM_IN_INCH = 25.4f;
Expand Down
2 changes: 1 addition & 1 deletion src/video/cocoa/SDL_cocoavideo.m
Expand Up @@ -81,7 +81,7 @@ static void Cocoa_DeleteDevice(SDL_VideoDevice *device)
device->VideoQuit = Cocoa_VideoQuit;
device->GetDisplayBounds = Cocoa_GetDisplayBounds;
device->GetDisplayUsableBounds = Cocoa_GetDisplayUsableBounds;
device->GetDisplayDPI = Cocoa_GetDisplayDPI;
device->GetDisplayPhysicalDPI = Cocoa_GetDisplayPhysicalDPI;
device->GetDisplayModes = Cocoa_GetDisplayModes;
device->SetDisplayMode = Cocoa_SetDisplayMode;
device->PumpEvents = Cocoa_PumpEvents;
Expand Down
6 changes: 3 additions & 3 deletions src/video/emscripten/SDL_emscriptenvideo.c
Expand Up @@ -39,7 +39,7 @@ static int Emscripten_VideoInit(_THIS);
static int Emscripten_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode);
static void Emscripten_VideoQuit(_THIS);
static int Emscripten_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect);
static int Emscripten_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi);
static int Emscripten_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi);

static int Emscripten_CreateWindow(_THIS, SDL_Window *window);
static void Emscripten_SetWindowSize(_THIS, SDL_Window *window);
Expand Down Expand Up @@ -77,7 +77,7 @@ static SDL_VideoDevice *Emscripten_CreateDevice(void)
device->VideoInit = Emscripten_VideoInit;
device->VideoQuit = Emscripten_VideoQuit;
device->GetDisplayUsableBounds = Emscripten_GetDisplayUsableBounds;
device->GetDisplayDPI = Emscripten_GetDisplayDPI;
device->GetDisplayPhysicalDPI = Emscripten_GetDisplayPhysicalDPI;
device->SetDisplayMode = Emscripten_SetDisplayMode;

device->PumpEvents = Emscripten_PumpEvents;
Expand Down Expand Up @@ -170,7 +170,7 @@ static int Emscripten_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, S
return 0;
}

static int Emscripten_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi_out, float *hdpi_out, float *vdpi_out)
static int Emscripten_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *display, float *ddpi_out, float *hdpi_out, float *vdpi_out)
{
const float dpi_reference = 96.0f;
float dpi;
Expand Down
2 changes: 1 addition & 1 deletion src/video/uikit/SDL_uikitmodes.h
Expand Up @@ -46,7 +46,7 @@ extern int UIKit_InitModes(_THIS);
extern int UIKit_AddDisplay(UIScreen *uiscreen, SDL_bool send_event);
extern void UIKit_DelDisplay(UIScreen *uiscreen);
extern void UIKit_GetDisplayModes(_THIS, SDL_VideoDisplay *display);
extern int UIKit_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi);
extern int UIKit_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi);
extern int UIKit_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode);
extern void UIKit_QuitModes(_THIS);
extern int UIKit_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect);
Expand Down
2 changes: 1 addition & 1 deletion src/video/uikit/SDL_uikitmodes.m
Expand Up @@ -431,7 +431,7 @@ void UIKit_GetDisplayModes(_THIS, SDL_VideoDisplay *display)
}
}

int UIKit_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi)
int UIKit_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi)
{
@autoreleasepool {
SDL_DisplayData *data = (__bridge SDL_DisplayData *)display->driverdata;
Expand Down
2 changes: 1 addition & 1 deletion src/video/uikit/SDL_uikitvideo.m
Expand Up @@ -93,7 +93,7 @@ static void UIKit_DeleteDevice(SDL_VideoDevice *device)
device->DestroyWindow = UIKit_DestroyWindow;
device->GetWindowWMInfo = UIKit_GetWindowWMInfo;
device->GetDisplayUsableBounds = UIKit_GetDisplayUsableBounds;
device->GetDisplayDPI = UIKit_GetDisplayDPI;
device->GetDisplayPhysicalDPI = UIKit_GetDisplayPhysicalDPI;
device->GetWindowSizeInPixels = UIKit_GetWindowSizeInPixels;

#if SDL_IPHONE_KEYBOARD
Expand Down
6 changes: 3 additions & 3 deletions src/video/wayland/SDL_waylandvideo.c
Expand Up @@ -68,7 +68,7 @@ static int Wayland_VideoInit(_THIS);

static int Wayland_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect);

static int Wayland_GetDisplayDPI(_THIS, SDL_VideoDisplay *sdl_display, float *ddpi, float *hdpi, float *vdpi);
static int Wayland_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *sdl_display, float *ddpi, float *hdpi, float *vdpi);

static void Wayland_VideoQuit(_THIS);

Expand Down Expand Up @@ -208,7 +208,7 @@ static SDL_VideoDevice *Wayland_CreateDevice(void)
device->VideoInit = Wayland_VideoInit;
device->VideoQuit = Wayland_VideoQuit;
device->GetDisplayBounds = Wayland_GetDisplayBounds;
device->GetDisplayDPI = Wayland_GetDisplayDPI;
device->GetDisplayPhysicalDPI = Wayland_GetDisplayPhysicalDPI;
device->GetWindowWMInfo = Wayland_GetWindowWMInfo;
device->SuspendScreenSaver = Wayland_SuspendScreenSaver;

Expand Down Expand Up @@ -972,7 +972,7 @@ static int Wayland_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *
return 0;
}

static int Wayland_GetDisplayDPI(_THIS, SDL_VideoDisplay *sdl_display, float *ddpi, float *hdpi, float *vdpi)
static int Wayland_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *sdl_display, float *ddpi, float *hdpi, float *vdpi)
{
SDL_WaylandOutputData *driverdata = (SDL_WaylandOutputData *)sdl_display->driverdata;

Expand Down
2 changes: 1 addition & 1 deletion src/video/windows/SDL_windowsmodes.c
Expand Up @@ -507,7 +507,7 @@ int WIN_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect)
return 0;
}

int WIN_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi_out, float *hdpi_out, float *vdpi_out)
int WIN_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *display, float *ddpi_out, float *hdpi_out, float *vdpi_out)
{
const SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata;
const SDL_VideoData *videodata = (SDL_VideoData *)display->device->driverdata;
Expand Down
2 changes: 1 addition & 1 deletion src/video/windows/SDL_windowsmodes.h
Expand Up @@ -43,7 +43,7 @@ extern void WIN_ScreenPointFromSDL(int *x, int *y, int *dpiOut);
extern void WIN_ScreenPointFromSDLFloat(float x, float y, LONG *xOut, LONG *yOut, int *dpiOut);
extern void WIN_ScreenPointToSDL(int *x, int *y);
extern void WIN_ScreenPointToSDLFloat(LONG x, LONG y, float *xOut, float *yOut);
extern int WIN_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi);
extern int WIN_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi);
extern void WIN_GetDisplayModes(_THIS, SDL_VideoDisplay *display);
extern int WIN_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode);
extern void WIN_RefreshDisplays(_THIS);
Expand Down
2 changes: 1 addition & 1 deletion src/video/windows/SDL_windowsvideo.c
Expand Up @@ -156,7 +156,7 @@ static SDL_VideoDevice *WIN_CreateDevice(void)
device->RefreshDisplays = WIN_RefreshDisplays;
device->GetDisplayBounds = WIN_GetDisplayBounds;
device->GetDisplayUsableBounds = WIN_GetDisplayUsableBounds;
device->GetDisplayDPI = WIN_GetDisplayDPI;
device->GetDisplayPhysicalDPI = WIN_GetDisplayPhysicalDPI;
device->GetDisplayModes = WIN_GetDisplayModes;
device->SetDisplayMode = WIN_SetDisplayMode;
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/video/x11/SDL_x11modes.c
Expand Up @@ -838,7 +838,7 @@ int X11_GetDisplayBounds(_THIS, SDL_VideoDisplay *sdl_display, SDL_Rect *rect)
return 0;
}

int X11_GetDisplayDPI(_THIS, SDL_VideoDisplay *sdl_display, float *ddpi, float *hdpi, float *vdpi)
int X11_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *sdl_display, float *ddpi, float *hdpi, float *vdpi)
{
SDL_DisplayData *data = (SDL_DisplayData *)sdl_display->driverdata;

Expand Down
2 changes: 1 addition & 1 deletion src/video/x11/SDL_x11modes.h
Expand Up @@ -63,7 +63,7 @@ extern Uint32 X11_GetPixelFormatFromVisualInfo(Display *display,
XVisualInfo *vinfo);
extern int X11_GetDisplayBounds(_THIS, SDL_VideoDisplay *sdl_display, SDL_Rect *rect);
extern int X11_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *sdl_display, SDL_Rect *rect);
extern int X11_GetDisplayDPI(_THIS, SDL_VideoDisplay *sdl_display, float *ddpi, float *hdpi, float *vdpi);
extern int X11_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *sdl_display, float *ddpi, float *hdpi, float *vdpi);

#if SDL_VIDEO_DRIVER_X11_XRANDR
extern void X11_HandleXRandREvent(_THIS, const XEvent *xevent);
Expand Down
2 changes: 1 addition & 1 deletion src/video/x11/SDL_x11video.c
Expand Up @@ -215,7 +215,7 @@ static SDL_VideoDevice *X11_CreateDevice(void)
device->GetDisplayModes = X11_GetDisplayModes;
device->GetDisplayBounds = X11_GetDisplayBounds;
device->GetDisplayUsableBounds = X11_GetDisplayUsableBounds;
device->GetDisplayDPI = X11_GetDisplayDPI;
device->GetDisplayPhysicalDPI = X11_GetDisplayPhysicalDPI;
device->GetWindowICCProfile = X11_GetWindowICCProfile;
device->SetDisplayMode = X11_SetDisplayMode;
device->SuspendScreenSaver = X11_SuspendScreenSaver;
Expand Down

0 comments on commit 78cc95e

Please sign in to comment.