Skip to content
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

native returns unpremultiplied data #1765

Merged
merged 2 commits into from Jul 2, 2019

Conversation

@minggo
Copy link
Contributor

commented Jul 2, 2019

  • 重构 CCCanvasRenderingContext2D-apple.mm 部分代码
  • 所有平台返回的纹理数据进行了反预乘
  • Android 本应该在 API 19+ 后使用非预乘,但是通过在小米 MIX 2S(API 28) 测试,发现反射调用 Bitmap. setPremultiplied() 不成功。没找到具体原因,所以也和 iOS/mac 一样,都进行了反预乘

通过在原生平台进行反预乘,效率确实比在 JS 层进行反预乘速度比较快。开发者给的 demo 测试效率也有大幅提升,基本满足需求。

对应的 JSB 适配代码改动在 https://github.com/cocos-creator-packages/jsb-adapter/pull/143。

@minggo minggo requested review from knoxHuang and caryliu1999 Jul 2, 2019

@minggo minggo merged commit ad52fe3 into cocos-creator:v2.1.2 Jul 2, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.