Commit Graph

64 Commits

Author SHA1 Message Date
James Chen cad6cb9971 Uses the same CCCanvasRenderingContext2D for apple platforms (iOS/macOS). (#1281) 2018-06-02 17:52:54 +08:00
James Chen cf7f3770b7 Supports drawing path API and refactor CCCanvasRenderingContext2D for macOS. (#1280)
* Uses CGBitmapContextCreate instead of NSImage for macOS, the CCCanvasRenderingContext2D is similiar as which on iOS now.

* Supports drawing line API.

* Supports drawing line API for Android too.
2018-06-01 22:59:07 +08:00
James Chen 5245664704 Adds Device::getDeviceModel method. (#1276) 2018-05-31 14:13:28 +08:00
James Chen 712173a8de Supports DeviceMotionEvent and removes more unused code. (#1275)
* Binds Device class

* Removes ccFPSImage.c/h

* Updates Android.mk

* Supports DeviceMotionEvent and removes more unused code.

* Uses fprintf to implement SE_LOGD & SE_LOGE .
2018-05-31 14:08:20 +08:00
James Chen 61accc6d11 Fixed the issue that text is probably cut. (#1268) 2018-05-28 11:45:07 +08:00
James Chen 1bb1806099 Supports Compressed Textures. (#1260)
* Updates CCConfiguration.h/.cpp.

* Supports Compressed Textures.

* Constructs Configuration singleton in Application constructor.

* Move Configuration::getInstance after createView.
2018-05-23 19:10:49 +08:00
James Chen 442c149053 Implements Application::restart and some fixes. (#1253)
* Implements Application::restart.

* SAFE_DEC_REF should reset pointer to nullptr.

* Class::cleanup should be after of JSGlobalContextRelease.

* WebGLObject needs to be released if ScriptEngine is in cleanup process.

* Fixes memory leak in JSB_glGetActiveAttrib
2018-05-21 18:46:12 +08:00
James Chen 391e6e536e Supports text stroke for macOS, iOS and Android. (#1250)
* Supports stroke for mac.

* Supports text stroke for ios.

* Supports text stroke for android.

* typo fix in CanvasRenderingContext2DImpl.java.
2018-05-21 11:38:05 +08:00
minggo 8a76997242 adapt mac resolution (#1248) 2018-05-18 11:57:12 +08:00
minggo 4a13d0e15e Downsample (#1245)
* support render texture

* use texture unit 0

* add functions to set device pixel ratio

* add ccDeleteBuffers again

* fix according comments
2018-05-17 14:05:05 +08:00
James Chen 07cc734c8c setAnimationInterval -> setPreferredFramesPerSecond and binds setPreferredFramesPerSeconds. (#1244)
* setAnimationInterval -> setPreferredFramesPerSecond.

* Binds setPreferredFramesPerSeconds.

* typo fix in CCApplication-win32.cpp
2018-05-16 18:06:26 +08:00
James Chen 58361e1b2d Avoid to create canvas buffer twice. (#1242)
* Avoid to create canvas buffer twice.

* Remove unused condition code in Cocos2dxActivity.java
2018-05-15 11:00:52 +08:00
James Chen 727a4911d4 [runtime] Adds jsb.openURL, __getOSVersion, __getCurrentLanguage interfaces. (#1238) 2018-05-11 16:03:17 +08:00
minggo d98484654f Optimize (#1202)
* fix some bugs

* fix binding codes of Texture2D::updateSubImage()
2018-04-20 14:31:52 +08:00
James Chen b34b517435 DeviceGraphics::getInstance fix. 2018-04-19 13:41:08 +08:00
James Chen 1fa4ea0e6f Merge branch 'new-renderer' of git://github.com/cocos-creator/cocos2d-x-lite into runtime
# Conflicts:
#	cocos/renderer/gfx/IndexBuffer.cpp
#	cocos/renderer/gfx/VertexBuffer.cpp
2018-04-19 11:23:36 +08:00
James Chen 58310293f2 more cache fix. 2018-04-14 15:59:18 +08:00
James Chen 3dfe05f4cc glBindXXX glActiveTexture cache. 2018-04-14 13:43:44 +08:00
James Chen 00675026d9 [mac] Fix CanvasRenderingContext2D. 2018-04-09 13:55:36 +08:00
James Chen ed017b2e01 Merge branch 'runtime' into new-renderer
# Conflicts:
#	cocos/renderer/gfx/Texture2D.cpp
2018-04-03 21:04:15 +08:00
James Chen 3c1da2db6c alphabetic textBaseline support. (#1173) 2018-03-29 16:24:36 +08:00
James Chen a668496b8e Comments initializing DeviceGraphics and textAlign supports middle. (#1171)
* Comments initializing DeviceGraphics since runtime doesn't need renderer stuff temporarily.

* textAlign supports middle.

* reverts.
2018-03-28 21:26:08 +08:00
James Chen 4ee7981630 Merge branch 'new-renderer' of git://github.com/cocos-creator/cocos2d-x-lite into runtime
# Conflicts:
#	cocos/platform/mac/CCCanvasRenderingContext2D-mac.mm
#	cocos/scripting/js-bindings/manual/jsb_gfx_manual.cpp
2018-03-23 15:42:12 +08:00
James Chen 7667b00f87 More WebGL binding fixes. (#1160)
* Less opengl binding files.

* recreateBuffer in CanvasRendereringContext2D constructor.

* gl.bindFrameBuffer(gl.FRAME_BUFFER, null) needs to set to default frame buffer .

* Fixes JSB_glGetActiveUniform use GL_ACTIVE_ATTRIBUTE_MAX_LENGTH to get the max length, we need to use GL_ACTIVE_UNIFORM_MAX_LENGTH instead.

* glBufferSubData supports typedarray with 0 length. Adds more API for CanvasRenderingContext2D.
2018-03-22 16:03:34 +08:00
minggo 610658e5a6 h5 adpator (#1156) 2018-03-21 09:30:05 +08:00
James Chen 1edc19dd3d Custom ttf font works on iOS/macOS (#1154)
* Custom ttf font works.

* Remove unused log.

* better code logic, less if .

* comment debugging code.
2018-03-20 14:51:24 +08:00
James Chen 9b2aaf1cd0 getImageInfo is async method now. Clear autoreleasepool at the end of frame. (#1150) 2018-03-17 09:48:32 +08:00
James Chen 26e8259389 Merge branch 'new-renderer' of git://github.com/cocos-creator/cocos2d-x-lite into new-renderer 2018-03-12 15:34:45 +08:00
James Chen fe91680060 Adds ctx.fillRect interface, JSB_get_arraybufferview_dataptr supports null or undefine converstion. 2018-03-12 15:25:47 +08:00
James Chen f02faf5a15 Updates CanvasRendereringContext2D-ios/mac.mm. 2018-03-12 11:12:24 +08:00
James Chen 3627778a35 Updates canvasrenderingcontext2d-mac.mm 2018-03-11 20:35:54 +08:00
minggo 0d483a9b07 add back network (#1141)
* add back network

* add network back on windows
2018-03-09 16:20:48 +08:00
James Chen 15370e52db ios label works.TODO: outline, bold, underline. 2018-03-09 12:37:57 +08:00
James Chen 1a064feed2 Label color works. 2018-03-08 18:14:46 +08:00
James Chen 4eccfbcba8 Mac font display ok. 2018-03-08 17:38:45 +08:00
James Chen 44fa82d9cc CanvasRenderering obj-c object release fix. 2018-03-08 11:22:44 +08:00
James Chen 48ab875fe2 Adds CCCanvasRenderingContext2D. 2018-03-07 18:44:57 +08:00
James Chen 1cd2166684 continue. 2018-03-06 10:41:10 +08:00
James Chen 88123dbb7b Updates opengl binding and module fix. 2018-03-05 11:00:02 +08:00
minggo aa3d6f0cde remove unneed files (#1135) 2018-02-28 17:24:34 +08:00
minggo 6f54248b7f fix iOS scale issue (#1134) 2018-02-28 16:07:20 +08:00
minggo a3dc57d9b7 js sample work on iOS (#1132)
* js sample work on iOS

* beautify codes
2018-02-26 16:58:10 +08:00
minggo e99f2401fd fix viewport issue on retina displays (#1130)
* fix viewport issue on retina displays

* remove include file
2018-02-24 18:13:03 +08:00
James Chen f001d1135d Adds swapBuffer to GLView, bunny test works again on Mac. (#1129) 2018-02-24 14:22:06 +08:00
minggo 93090fea87 can run js on iOS and Mac (#1124) 2018-02-24 10:27:31 +08:00
minggo c01325313d refactor ios gl context setting process (#1123) 2018-02-23 11:18:16 +08:00
minggo fee7afc74a mac main loop work (#1112)
* mac main loop work

* fix some issue
2018-02-11 14:25:14 +08:00
minggo 802e48080e New renderer (#1097)
* build work on mac

* build ok on iOS

* fix compiling error on android

* fix android link error
2018-02-08 10:40:29 +08:00
Jare Guo d9bd3d763c update license (#1089)
* updating license

* update license
2018-02-01 15:20:01 +08:00
James Chen 69798998db Adds cc.sys.getBatteryLevel & cc.sys.getNetworkType APIs (#1071)
* Adds cc.Device.getBatteryLevel interface.

* Adds CCReachability.h/.cpp

* Adds CCReachability.h/.cpp

* Reachability supports macOS either.

* Adds cc.Device.getNetworkStatus interface.

* Removed debug log.

* cc.Device.NetworkStatus -> cc.Device.NetworkType

* API to sys namespace

* Update CCDevice-win32.cpp
2018-01-29 17:37:15 +08:00