-
Notifications
You must be signed in to change notification settings - Fork 7.1k
add optimization for OPPO. #19631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
add optimization for OPPO. #19631
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e3fe24f
add optimization for OPPO.
xianyinchen 597ebfe
udate oppo sdk.
xianyinchen 996a7a0
update oppo sdk.
xianyinchen 5bc50e0
update oppo sdk.
xianyinchen 1526e3c
update Copyright.
xianyinchen 40f8ed3
add ProGuard rules.
xianyinchen cf6f322
add ProGuard rules for libCocos2dx.
xianyinchen 34f631d
update project template.
xianyinchen 45aed1b
update ProGuard rules for all tester.
xianyinchen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/**************************************************************************** | ||
Copyright (c) 2010-2012 cocos2d-x.org | ||
Copyright (c) 2013-2016 Chukong Technologies Inc. | ||
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. | ||
Copyright (c) 2019 Xiamen Yaji Software Co., Ltd. | ||
|
||
http://www.cocos2d-x.org | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
****************************************************************************/ | ||
|
||
#include "platform/CCDataManager.h" | ||
|
||
#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID | ||
# include "platform/android/jni/JniHelper.h" | ||
# define DataManagerClassName "org/cocos2dx/lib/Cocos2dxDataManager" | ||
#endif | ||
|
||
NS_CC_BEGIN | ||
|
||
void DataManager::setProcessID(int pid){ | ||
#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID | ||
JniHelper::callStaticVoidMethod(DataManagerClassName, "setProcessID", pid); | ||
#endif | ||
} | ||
void DataManager::setFrameSize(int width, int height){ | ||
#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID | ||
JniHelper::callStaticVoidMethod(DataManagerClassName, "setFrameSize", width, height); | ||
#endif | ||
} | ||
void DataManager::onSceneLoaderBegin(){ | ||
#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID | ||
JniHelper::callStaticVoidMethod(DataManagerClassName, "onSceneLoaderBegin"); | ||
#endif | ||
} | ||
void DataManager::onSceneLoaderEnd(){ | ||
#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID | ||
JniHelper::callStaticVoidMethod(DataManagerClassName, "onSceneLoaderEnd"); | ||
#endif | ||
} | ||
void DataManager::onShaderLoaderBegin(){ | ||
#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID | ||
JniHelper::callStaticVoidMethod(DataManagerClassName, "onShaderLoaderBegin"); | ||
#endif | ||
} | ||
void DataManager::onShaderLoaderEnd(){ | ||
#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID | ||
JniHelper::callStaticVoidMethod(DataManagerClassName, "onShaderLoaderEnd"); | ||
#endif | ||
} | ||
|
||
NS_CC_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/**************************************************************************** | ||
Copyright (c) 2010-2012 cocos2d-x.org | ||
Copyright (c) 2013-2016 Chukong Technologies Inc. | ||
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. | ||
Copyright (c) 2019 Xiamen Yaji Software Co., Ltd. | ||
|
||
http://www.cocos2d-x.org | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
****************************************************************************/ | ||
|
||
#ifndef __CC_DataManager_H__ | ||
#define __CC_DataManager_H__ | ||
|
||
#include "platform/CCPlatformMacros.h" | ||
#include "base/ccTypes.h" | ||
|
||
NS_CC_BEGIN | ||
|
||
/** | ||
* @addtogroup platform | ||
* @{ | ||
*/ | ||
|
||
class CC_DLL DataManager | ||
{ | ||
public: | ||
static void setProcessID(int pid); | ||
static void setFrameSize(int width, int height); | ||
static void onSceneLoaderBegin(); | ||
static void onSceneLoaderEnd(); | ||
static void onShaderLoaderBegin(); | ||
static void onShaderLoaderEnd(); | ||
}; | ||
|
||
// end of platform group | ||
/** @} */ | ||
|
||
NS_CC_END | ||
|
||
#endif // __CC_DataManager_H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
57 changes: 57 additions & 0 deletions
57
cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxDataManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/**************************************************************************** | ||
Copyright (c) 2010-2012 cocos2d-x.org | ||
Copyright (c) 2013-2016 Chukong Technologies Inc. | ||
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. | ||
Copyright (c) 2019 Xiamen Yaji Software Co., Ltd. | ||
|
||
http://www.cocos2d-x.org | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
****************************************************************************/ | ||
|
||
package org.cocos2dx.lib; | ||
import android.util.Log; | ||
|
||
import com.oppo.oiface.engine.OifaceGameEngineManager; | ||
|
||
public class Cocos2dxDataManager { | ||
public static void setOptimise(String thing, float value){ | ||
String jsonStr = "{\"" + thing + "\":" + String.valueOf(value) + "}"; | ||
OifaceGameEngineManager.getInstance().updateGameEngineInfo(jsonStr); | ||
} | ||
|
||
public static void setProcessID(int pid){ | ||
setOptimise("render_pid", pid); | ||
} | ||
public static void setFrameSize(int width, int height){ | ||
setOptimise("buffer_size", width * height); | ||
} | ||
public static void onSceneLoaderBegin(){ | ||
setOptimise("load_scene", 1); | ||
} | ||
public static void onSceneLoaderEnd(){ | ||
setOptimise("load_scene", 0); | ||
} | ||
public static void onShaderLoaderBegin(){ | ||
setOptimise("shader_compile", 1); | ||
} | ||
public static void onShaderLoaderEnd(){ | ||
setOptimise("shader_compile", 0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copyright (c) 2019 Xiamen Yaji Software Co., Ltd.