From c048d5642b19fad4c63b6e2dbeaeb813e9a32ac1 Mon Sep 17 00:00:00 2001 From: leda Date: Tue, 24 Jul 2018 17:06:24 +0800 Subject: [PATCH 1/4] change travis branch to v2.0-release (#1414) --- native/.travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/.travis.yml b/native/.travis.yml index 26fecdf97d..78013b3ebc 100644 --- a/native/.travis.yml +++ b/native/.travis.yml @@ -10,7 +10,7 @@ before_install: # blocklist branches: only: - - next + - v2.0-release env: global: From 41004c0dd85510b015a6a76e2c778b1e9d467318 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Tue, 24 Jul 2018 17:27:58 +0800 Subject: [PATCH 2/4] [AUTO][ci skip]: updating cocos2dx_files.json (#1415) --- native/templates/cocos2dx_files.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/native/templates/cocos2dx_files.json b/native/templates/cocos2dx_files.json index 3a5cd2330d..db0b917cb8 100644 --- a/native/templates/cocos2dx_files.json +++ b/native/templates/cocos2dx_files.json @@ -100,6 +100,8 @@ "cocos/audio/win32/AudioMacros.h", "cocos/audio/win32/AudioPlayer.cpp", "cocos/audio/win32/AudioPlayer.h", + "cocos/base/CCAsyncTaskPool.cpp", + "cocos/base/CCAsyncTaskPool.h", "cocos/base/CCAutoreleasePool.cpp", "cocos/base/CCAutoreleasePool.h", "cocos/base/CCConfiguration.cpp", @@ -413,8 +415,6 @@ "extensions/assets-manager/AssetsManagerEx.h", "extensions/assets-manager/CCEventAssetsManagerEx.cpp", "extensions/assets-manager/CCEventAssetsManagerEx.h", - "extensions/assets-manager/CCEventListenerAssetsManagerEx.cpp", - "extensions/assets-manager/CCEventListenerAssetsManagerEx.h", "extensions/assets-manager/Manifest.cpp", "extensions/assets-manager/Manifest.h", "extensions/cocos-ext.h", From b242a1abd73b07a1edd79104451d7a60c8b7db06 Mon Sep 17 00:00:00 2001 From: leda Date: Tue, 24 Jul 2018 20:33:42 +0800 Subject: [PATCH 3/4] call recreate canvas buffer if needed when width/height changes (#1417) * add more choice to call recreateBufferIfNeeded for canvas * win32 - add more choice to call recreateBufferIfNeeded for canvas --- .../platform/android/CCCanvasRenderingContext2D-android.cpp | 2 ++ native/cocos/platform/apple/CCCanvasRenderingContext2D-apple.mm | 2 ++ .../cocos/platform/win32/CCCanvasRenderingContext2D-win32.cpp | 2 ++ 3 files changed, 6 insertions(+) diff --git a/native/cocos/platform/android/CCCanvasRenderingContext2D-android.cpp b/native/cocos/platform/android/CCCanvasRenderingContext2D-android.cpp index 3dcda0222e..2b707b9c28 100644 --- a/native/cocos/platform/android/CCCanvasRenderingContext2D-android.cpp +++ b/native/cocos/platform/android/CCCanvasRenderingContext2D-android.cpp @@ -349,6 +349,7 @@ void CanvasRenderingContext2D::set__width(float width) // SE_LOGD("CanvasRenderingContext2D::set__width: %f\n", width); __width = width; _isBufferSizeDirty = true; + recreateBufferIfNeeded(); } void CanvasRenderingContext2D::set__height(float height) @@ -356,6 +357,7 @@ void CanvasRenderingContext2D::set__height(float height) // SE_LOGD("CanvasRenderingContext2D::set__height: %f\n", height); __height = height; _isBufferSizeDirty = true; + recreateBufferIfNeeded(); } void CanvasRenderingContext2D::set_lineWidth(float lineWidth) diff --git a/native/cocos/platform/apple/CCCanvasRenderingContext2D-apple.mm b/native/cocos/platform/apple/CCCanvasRenderingContext2D-apple.mm index 3453b0350f..57616d59cc 100644 --- a/native/cocos/platform/apple/CCCanvasRenderingContext2D-apple.mm +++ b/native/cocos/platform/apple/CCCanvasRenderingContext2D-apple.mm @@ -679,6 +679,7 @@ void CanvasRenderingContext2D::set__width(float width) // SE_LOGD("CanvasRenderingContext2D::set__width: %f\n", width); __width = width; _isBufferSizeDirty = true; + recreateBufferIfNeeded(); } void CanvasRenderingContext2D::set__height(float height) @@ -686,6 +687,7 @@ void CanvasRenderingContext2D::set__height(float height) // SE_LOGD("CanvasRenderingContext2D::set__height: %f\n", height); __height = height; _isBufferSizeDirty = true; + recreateBufferIfNeeded(); } void CanvasRenderingContext2D::set_lineWidth(float lineWidth) diff --git a/native/cocos/platform/win32/CCCanvasRenderingContext2D-win32.cpp b/native/cocos/platform/win32/CCCanvasRenderingContext2D-win32.cpp index da14d2ac3f..e4049be07c 100644 --- a/native/cocos/platform/win32/CCCanvasRenderingContext2D-win32.cpp +++ b/native/cocos/platform/win32/CCCanvasRenderingContext2D-win32.cpp @@ -737,6 +737,7 @@ void CanvasRenderingContext2D::set__width(float width) //SE_LOGD("CanvasRenderingContext2D::set__width: %f\n", width); __width = width; _isBufferSizeDirty = true; + recreateBufferIfNeeded(); } void CanvasRenderingContext2D::set__height(float height) @@ -744,6 +745,7 @@ void CanvasRenderingContext2D::set__height(float height) //SE_LOGD("CanvasRenderingContext2D::set__height: %f\n", height); __height = height; _isBufferSizeDirty = true; + recreateBufferIfNeeded(); } void CanvasRenderingContext2D::set_lineWidth(float lineWidth) From fdebbc77b7820e94ff10b39aa4aeb23b46055fd0 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 26 Jul 2018 09:32:37 +0800 Subject: [PATCH 4/4] dispatch show/hide event to js (#1424) --- .../frameworks/runtime-src/Classes/AppDelegate.cpp | 2 ++ .../frameworks/runtime-src/Classes/AppDelegate.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/native/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp b/native/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp index 3a78ffb04e..904b6a6d55 100755 --- a/native/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp +++ b/native/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp @@ -101,6 +101,7 @@ void AppDelegate::applicationDidEnterBackground() struct CustomEvent event; event.name = EVENT_COME_TO_BACKGROUND; EventDispatcher::dispatchCustomEvent(&event); + EventDispatcher::dispatchEnterBackgroundEvent(); } // this function will be called when the app is active again @@ -109,4 +110,5 @@ void AppDelegate::applicationWillEnterForeground() struct CustomEvent event; event.name = EVENT_COME_TO_FOREGROUND; EventDispatcher::dispatchCustomEvent(&event); + EventDispatcher::dispatchEnterForegroundEvent(); } diff --git a/native/templates/js-template-link/frameworks/runtime-src/Classes/AppDelegate.cpp b/native/templates/js-template-link/frameworks/runtime-src/Classes/AppDelegate.cpp index 3a78ffb04e..904b6a6d55 100755 --- a/native/templates/js-template-link/frameworks/runtime-src/Classes/AppDelegate.cpp +++ b/native/templates/js-template-link/frameworks/runtime-src/Classes/AppDelegate.cpp @@ -101,6 +101,7 @@ void AppDelegate::applicationDidEnterBackground() struct CustomEvent event; event.name = EVENT_COME_TO_BACKGROUND; EventDispatcher::dispatchCustomEvent(&event); + EventDispatcher::dispatchEnterBackgroundEvent(); } // this function will be called when the app is active again @@ -109,4 +110,5 @@ void AppDelegate::applicationWillEnterForeground() struct CustomEvent event; event.name = EVENT_COME_TO_FOREGROUND; EventDispatcher::dispatchCustomEvent(&event); + EventDispatcher::dispatchEnterForegroundEvent(); }