Skip to content

support alipay minigame#4880

Merged
jareguo merged 2 commits intococos:v2.1.3from
PPpro:v2.1.3
Jul 22, 2019
Merged

support alipay minigame#4880
jareguo merged 2 commits intococos:v2.1.3from
PPpro:v2.1.3

Conversation

@PPpro
Copy link
Copy Markdown
Contributor

@PPpro PPpro commented Jul 15, 2019

Re: https://github.com/cocos-creator/2d-tasks/issues/1615

由于支付宝创建离屏 canvas 的成本较高,测试是创建 30 个 canvas 内存就会崩
目前是尽量回收 canvas,在提交完 texture 之后就回收 canvas,之后优化的方向是尽量使用一个 canvas 来绘制

pr 里还有一些平台相关的代码, 2.2 分支里要移到 adapter 层

@PPpro PPpro force-pushed the v2.1.3 branch 2 times, most recently from e990d8a to ae7dfb7 Compare July 15, 2019 12:27
Comment thread cocos2d/core/components/CCLabel.js Outdated
this._assemblerData = this._assembler._getAssemblerData();
this._ttfTexture.on('load', function () {
self._assembler && self._assembler._resetAssemblerData && self._assembler._resetAssemblerData(self._assemblerData);
});
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里麻烦 @caryliu1999 review 下有没有问题

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里确认一下是否会多次注册事件,用代码动态切换字体来测试。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

测试是不会重复注册,不过这里确实应该取消注册会比较好。我更新一下

let width = ctx.measureText(char).width;
let measureResult = ctx.measureText(char);
let width = measureResult.width;
// NOTE: not merge into v2.2.0, move into Alipay adapter
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注释好评

@jareguo jareguo requested a review from caryliu1999 July 18, 2019 16:40
@jareguo jareguo merged commit 0c29f37 into cocos:v2.1.3 Jul 22, 2019
jareguo added a commit that referenced this pull request Jul 23, 2019
* commit '94e490299e0e5c860305ae3f0324a1bb5c222852':
  fixed api link error. (#4920)
  support alipay minigame (#4880)
  fixed api docs (#4918)
  add Edge browser type && fix webAudio bug on Edge and Baidu browser (#4910)
  remove warning when upgrading editBox compnent (#4916)
  refine code (#4900)
  fix scrollView bug for 2d-tasks/issues/1555 (#4894)

# Conflicts:
#	cocos2d/core/mesh/CCMesh.js
#	cocos2d/core/platform/CCSys.js
#	cocos2d/core/platform/CCView.js
#	cocos2d/videoplayer/video-player-impl.js
jareguo added a commit that referenced this pull request Jul 23, 2019
* v2.2.0:
  fixed api link error. (#4920)
  support alipay minigame (#4880)
  fixed api docs (#4918)
  add Edge browser type && fix webAudio bug on Edge and Baidu browser (#4910)
  remove warning when upgrading editBox compnent (#4916)
  move platform related code (#4913)
  fix warn after subContextView modules are excluded (#4737)
  refine code (#4900)
  fix scrollView bug for 2d-tasks/issues/1555 (#4894)

# Conflicts:
#	cocos2d/core/mesh/CCMesh.js
#	cocos2d/core/platform/CCSys.js
#	cocos2d/core/utils/profiler/CCProfiler.js
@PPpro PPpro deleted the v2.1.3 branch December 16, 2020 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants