Commit Graph

30 Commits

Author SHA1 Message Date
minggo d381a16142 change namespace from cocos2d to cc (#2572) 2020-06-16 14:34:46 +08:00
minggo 743f91a3a8 remove some unneed codes (#2182) 2020-02-25 18:33:41 +08:00
minggo bd68b01b4d Android native dpi (#2173)
* fix compiling error

* android get dpi in C++
2020-02-24 16:09:13 +08:00
minggo 2801316866 fix accuracy of RGB value (#1773)
* fix accuracy of RGB value

* don't have to check less than 0
2019-07-16 17:45:41 +08:00
minggo 875acde984 native returns unpremultiplied data (#1765)
* unpremultiply alpha on ios/mac

* unpremultiply alpha on Android and windows
2019-07-02 15:00:15 +08:00
bofeng-song 1d642605e1 [features] support oblique(font-style) and smallCaps(font-variant) (#1577)
* [features] support oblique(font-style) and smallCaps(font-variant)

* [refine] add Remarks, change constant value to system default
2018-10-31 20:06:03 +08:00
wen xing liao 5bef70b34d fix java IllegalArgumentException (#1570)
* fix java IllegalArgumentException

* Remove multiple parameter checks
2018-10-30 11:59:31 +08:00
bofeng-song 77e5eb3e56 [feature] support lineCap and lineJoin (#1569)
* [feature] support lineCap and lineJoin

* [refine] move precondition to c++ layer
2018-10-29 20:50:54 +08:00
leda 7c93a11905 runtime require: add context2d fill/rect method for android (#1561)
* add context2d fill & rect method for android

* workaround: draw a hairline to cover the border

* fix clear&fillrect parameter error

* add empty impl on Apple

* add empty Imple in win32

* enable "SUBPIXEL_TEXT_FLAG" flag to make the text more clear on Android

* move putImageData impl to native

* add empty _fillImageData impl on win32 & apple
2018-10-26 13:44:03 +08:00
leda ef4b74ee1e support parse font size with float value (#1543) 2018-10-12 11:49:07 +08:00
yongminghuang f30a886cd3 Fixed font size not recognized after setting Chinese font (#1534) 2018-10-09 15:50:44 +08:00
wdzhangchukong 687a798b20 fix: can not use italic font in canvas (#1520) 2018-09-26 02:37:27 -07:00
W-MTZing 935a759cf4 rename c++ call java function by macro (#1468) 2018-08-22 14:07:17 +08:00
leda 19ab61b252 refine TODO & FIXME flag (#1450)
* change TODO to REFINE

* change REFINE:cjh to REFINE

* change FIXME to IDEA

* improve format
2018-08-10 12:52:00 +08:00
leda 9b775e711d fix catch font name error when ttf font name with space (#1423)
* support catch fontName with space when canvas set font

* do same above on android

* improve regex

* add empty loadFont impl for win32 platform

* correct win32 parse font info regex on win32

* add win32 support ttf when font name = font face name

* another space line for win32 platforms

* improve regex when parse font name

* fix regex error

* correct typo
2018-07-26 17:57:25 +08:00
leda b242a1abd7 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
2018-07-24 20:33:42 +08:00
James Chen 0b85e67caf Supports text with bold. (#1282) 2018-06-02 18:46:12 +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 73537df727 bufferWidth and bufferHeight check in CCCanvasRenderingContext2D. (#1262)
* Removes unused logic in EventDispatcher::dispatchTickEvent.

* Uses __jsbObj directly, dispatch enter background & foreground event

* bufferWidth and bufferHeight check in CCCanvasRenderingContext2D.
2018-05-24 14:38:55 +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
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 53ffc817ee Fixes JNI memory leak in CanvasRenderingContext2DImpl::fillData (#1230)
* Fixes JNI memory leak in CanvasRenderingContext2DImpl::fillData

* typo fix.
2018-05-08 10:56:48 +08:00
James Chen b6a3153435 [android] Fix CanvasRenderingContext2D. Call fillData after recreateBuffer. System Font is displayed correctly on Android now. 2018-04-09 13:56:40 +08:00
James Chen 4397330777 [runtime, android] Fix local reference table overflow error problem in CCCanvasRenderingContext2D-android.cpp. (#1180) 2018-04-03 14:34:48 +08:00
James Chen 3c1da2db6c alphabetic textBaseline support. (#1173) 2018-03-29 16:24:36 +08:00
James Chen 73eb73c690 [android] textAlign supports 'middle'. recreate buffer in the constructor of CanvasRenderingContext2D. (#1172)
* [android] textAlign supports 'middle'. recreate buffer in the constructor of CanvasRenderingContext2D.

* bug fix in CanvasRenderingContext2DImpl.java

* java version 1.8
2018-03-29 15:50:38 +08:00
James Chen c341d94d1a Adds missing function implementation. (#1161) 2018-03-22 16:16:10 +08:00
James Chen c3602eb1e3 [runtime] Android testcase works. (#1148)
* Adds jsb_run_script_module for CommonJS module, reverts original `require`.

* Uses window.gameTick for sending tick event.

* Removes unused scripts.

* Android testcase works.
2018-03-15 18:12:38 +08:00
James Chen 2c3a86f7b1 [new-renderer] Label on android works. (#1146)
* Android HelloWorld without label works.

* Label on android works.
2018-03-14 21:19:51 +08:00
James Chen f0a79242d7 Android compile ok. (#1145)
* Android compile ok.

* Fixes for Android build .
2018-03-14 10:28:03 +08:00