diff --git a/native/cocos/platform/android/AndroidPlatform.cpp b/native/cocos/platform/android/AndroidPlatform.cpp index 5744c8fe7d..89c7e9130a 100644 --- a/native/cocos/platform/android/AndroidPlatform.cpp +++ b/native/cocos/platform/android/AndroidPlatform.cpp @@ -74,11 +74,11 @@ void AndroidPlatform::pollEvent() { _jniNativeGlue->flushTasksOnGameThread(); } -void *AndroidPlatform::getActivity() { +void* AndroidPlatform::getActivity() { return _jniNativeGlue->getActivity(); } -void *AndroidPlatform::getEnv() { +void* AndroidPlatform::getEnv() { return _jniNativeGlue->getEnv(); } diff --git a/native/cocos/platform/android/AndroidPlatform.h b/native/cocos/platform/android/AndroidPlatform.h index b9b291e0f8..741d5ccc85 100644 --- a/native/cocos/platform/android/AndroidPlatform.h +++ b/native/cocos/platform/android/AndroidPlatform.h @@ -36,8 +36,9 @@ public: int32_t run(int argc, const char** argv) override; int getSdkVersion() const override; int32_t loop() override; - void* getActivity(); - void* getEnv(); + void* getActivity(); + void* getEnv(); + private: void waitWindowInitialized(); diff --git a/native/cocos/renderer/gfx-gles2/GLES2GPUContext.cpp b/native/cocos/renderer/gfx-gles2/GLES2GPUContext.cpp index 3360930da8..05c221f07f 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2GPUContext.cpp +++ b/native/cocos/renderer/gfx-gles2/GLES2GPUContext.cpp @@ -294,7 +294,7 @@ void GLES2GPUContext::present(const GLES2GPUSwapchain *swapchain) { #if CC_SWAPPY_ENABLED if (swapchain->swappyEnabled) { //fallback to normal eglswap if swappy_swap failed - if(SwappyGL_swap(eglDisplay, swapchain->eglSurface)) { + if (SwappyGL_swap(eglDisplay, swapchain->eglSurface)) { return; } } diff --git a/native/cocos/renderer/gfx-gles2/GLES2Swapchain.cpp b/native/cocos/renderer/gfx-gles2/GLES2Swapchain.cpp index a3c0991f5c..c78434d3bc 100644 --- a/native/cocos/renderer/gfx-gles2/GLES2Swapchain.cpp +++ b/native/cocos/renderer/gfx-gles2/GLES2Swapchain.cpp @@ -64,10 +64,10 @@ void GLES2Swapchain::doInit(const SwapchainInfo& info) { } #if CC_SWAPPY_ENABLED - bool enableSwappy = true; - auto* platform = static_cast(cc::BasePlatform::getPlatform()); + bool enableSwappy = true; + auto* platform = static_cast(cc::BasePlatform::getPlatform()); enableSwappy &= SwappyGL_init(static_cast(platform->getEnv()), static_cast(platform->getActivity())); - int32_t fps = cc::BasePlatform::getPlatform()->getFps(); + int32_t fps = cc::BasePlatform::getPlatform()->getFps(); if (enableSwappy) { if (!fps) SwappyGL_setSwapIntervalNS(SWAPPY_SWAP_60FPS); diff --git a/native/cocos/renderer/gfx-gles3/GLES3GPUContext.cpp b/native/cocos/renderer/gfx-gles3/GLES3GPUContext.cpp index 2cf225a911..c8fb93d5aa 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3GPUContext.cpp +++ b/native/cocos/renderer/gfx-gles3/GLES3GPUContext.cpp @@ -302,8 +302,8 @@ void GLES3GPUContext::present(const GLES3GPUSwapchain *swapchain) { #if CC_SWAPPY_ENABLED if (swapchain->swappyEnabled) { // fallback to normal eglswap if swappy swap failed. - if(SwappyGL_swap(eglDisplay, swapchain->eglSurface)) { - return; + if (SwappyGL_swap(eglDisplay, swapchain->eglSurface)) { + return; } } #endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3Swapchain.cpp b/native/cocos/renderer/gfx-gles3/GLES3Swapchain.cpp index 32519857df..d89299ba4e 100644 --- a/native/cocos/renderer/gfx-gles3/GLES3Swapchain.cpp +++ b/native/cocos/renderer/gfx-gles3/GLES3Swapchain.cpp @@ -64,10 +64,10 @@ void GLES3Swapchain::doInit(const SwapchainInfo& info) { } #if CC_SWAPPY_ENABLED - bool enableSwappy = true; - auto* platform = static_cast(cc::BasePlatform::getPlatform()); + bool enableSwappy = true; + auto* platform = static_cast(cc::BasePlatform::getPlatform()); enableSwappy &= SwappyGL_init(static_cast(platform->getEnv()), static_cast(platform->getActivity())); - int32_t fps = cc::BasePlatform::getPlatform()->getFps(); + int32_t fps = cc::BasePlatform::getPlatform()->getFps(); if (enableSwappy) { if (!fps) SwappyGL_setSwapIntervalNS(SWAPPY_SWAP_60FPS); diff --git a/native/cocos/renderer/gfx-vulkan/VKDevice.cpp b/native/cocos/renderer/gfx-vulkan/VKDevice.cpp index b4895ca17d..cf639e97bc 100644 --- a/native/cocos/renderer/gfx-vulkan/VKDevice.cpp +++ b/native/cocos/renderer/gfx-vulkan/VKDevice.cpp @@ -154,8 +154,8 @@ bool CCVKDevice::doInit(const DeviceInfo & /*info*/) { uint32_t swappyRequiredExtensionCount = 0; SwappyVk_determineDeviceExtensions(_gpuContext->physicalDevice, availableExtensionCount, _gpuDevice->extensions.data(), &swappyRequiredExtensionCount, nullptr); - std::vector swappyRequiredExtensions(swappyRequiredExtensionCount); - std::vector swappyRequiredExtensionsData(swappyRequiredExtensionCount * (VK_MAX_EXTENSION_NAME_SIZE + 1)); + std::vector swappyRequiredExtensions(swappyRequiredExtensionCount); + std::vector swappyRequiredExtensionsData(swappyRequiredExtensionCount * (VK_MAX_EXTENSION_NAME_SIZE + 1)); for (uint32_t i = 0; i < swappyRequiredExtensionCount; i++) { swappyRequiredExtensions[i] = &swappyRequiredExtensionsData[i * (VK_MAX_EXTENSION_NAME_SIZE + 1)]; }