[ci skip][AUTO]: Automated clang-format update: f9971a5a25b7a78c29f81b633160a7b55ee1cc97 (#10327) (#10478)

Co-authored-by: cocos-robot <cocos-robot@cocos.com>
This commit is contained in:
Cocos Robot
2022-03-24 18:02:46 +08:00
committed by GitHub
parent e64301ad34
commit da2bb3c5db
7 changed files with 16 additions and 15 deletions
@@ -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();
}
@@ -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();
@@ -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;
}
}
@@ -64,10 +64,10 @@ void GLES2Swapchain::doInit(const SwapchainInfo& info) {
}
#if CC_SWAPPY_ENABLED
bool enableSwappy = true;
auto* platform = static_cast<AndroidPlatform*>(cc::BasePlatform::getPlatform());
bool enableSwappy = true;
auto* platform = static_cast<AndroidPlatform*>(cc::BasePlatform::getPlatform());
enableSwappy &= SwappyGL_init(static_cast<JNIEnv*>(platform->getEnv()), static_cast<jobject>(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);
@@ -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
@@ -64,10 +64,10 @@ void GLES3Swapchain::doInit(const SwapchainInfo& info) {
}
#if CC_SWAPPY_ENABLED
bool enableSwappy = true;
auto* platform = static_cast<AndroidPlatform*>(cc::BasePlatform::getPlatform());
bool enableSwappy = true;
auto* platform = static_cast<AndroidPlatform*>(cc::BasePlatform::getPlatform());
enableSwappy &= SwappyGL_init(static_cast<JNIEnv*>(platform->getEnv()), static_cast<jobject>(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);
@@ -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<char*> swappyRequiredExtensions(swappyRequiredExtensionCount);
std::vector<char> swappyRequiredExtensionsData(swappyRequiredExtensionCount * (VK_MAX_EXTENSION_NAME_SIZE + 1));
std::vector<char *> swappyRequiredExtensions(swappyRequiredExtensionCount);
std::vector<char> 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)];
}