mirror of https://github.com/libsdl-org/SDL.git
Harmony port: review changes
This commit is contained in:
parent
c99ae6e155
commit
298581d269
|
|
@ -130,6 +130,15 @@ void OHOS_removeWindow(SDL_Window* w)
|
|||
#endif
|
||||
}
|
||||
|
||||
void OHOS_LockPage()
|
||||
{
|
||||
SDL_LockMutex(g_ohosPageMutex);
|
||||
}
|
||||
void OHOS_UnlockPage()
|
||||
{
|
||||
SDL_UnlockMutex(g_ohosPageMutex);
|
||||
}
|
||||
|
||||
static napi_value minus(napi_env env, napi_callback_info info)
|
||||
{
|
||||
size_t argc = 2;
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@
|
|||
#include "video/SDL_sysvideo.h"
|
||||
#include <native_window/external_window.h>
|
||||
|
||||
extern SDL_Mutex *g_ohosPageMutex;
|
||||
|
||||
void OHOS_windowDataFill(SDL_Window* w);
|
||||
void OHOS_removeWindow(SDL_Window* w);
|
||||
void OHOS_LockPage();
|
||||
void OHOS_UnlockPage();
|
||||
|
||||
typedef struct SDL_VideoData {
|
||||
SDL_Rect textRect;
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@ SDL_GLContext OHOS_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window
|
|||
{
|
||||
SDL_GLContext result;
|
||||
|
||||
SDL_LockMutex(g_ohosPageMutex);
|
||||
OHOS_LockPage();
|
||||
|
||||
result = SDL_EGL_CreateContext(_this, window->internal->egl_surface);
|
||||
|
||||
SDL_UnlockMutex(g_ohosPageMutex);
|
||||
OHOS_UnlockPage();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
@ -32,11 +32,11 @@ bool OHOS_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
|||
{
|
||||
bool result;
|
||||
|
||||
SDL_LockMutex(g_ohosPageMutex);
|
||||
OHOS_LockPage();
|
||||
|
||||
result = SDL_EGL_SwapBuffers(_this, window->internal->egl_surface);
|
||||
|
||||
SDL_UnlockMutex(g_ohosPageMutex);
|
||||
OHOS_UnlockPage();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue