feat(fe+harmony): add canvas feature toDataURL, getImageData, canvassToTempFilePath#252
Conversation
|
临时支持 toDataURL, toBlob, getImageData, canvasToTempFile 的异步调用。这里当前和 wx 有点不一样。正在开发一个基于 skia + 同层渲染的框架,让 canvas 渲染再 service (jscore)这边执行。这样就 context 就能像 wx 一样同步调用 |
|
cpp 修复 int value = JS_VALUE_GET_INT(jsValue) 的语法问题,cpp 上游依赖包没有锁版本导致语法有所改变 |
| } | ||
| } | ||
|
|
||
| canvasGetImageData({ bridgeId, params }) { |
There was a problem hiding this comment.
这个新增的 canvasGetImageData render handler 目前不可达。
service 侧没有对应 wrapper,缺失 API 会从 api/index.js (line 48) 走默认 invokeAPI,而默认 target 是 container (line 162),不会调用到 render 层。
如果这次要支持 wx.canvasGetImageData,需要在 core/ui/canvas/index.js 增加 target 为 render 的 API;如果只支持 canvas node API,这段 render handler 建议移除,避免误以为旧 API 已支持。
There was a problem hiding this comment.
让 AI 切换了一次方案,代码漏删了。 render 侧的代码已经删除。全部由 service 侧发起, render 实现, service 处理 callback
| width, | ||
| height, | ||
| callback: callbackId, | ||
| errorCallback: errorCallbackId, |
|
lint错误需要处理下 |
…eferences Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nused code Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rename 'const self = this' to 'const that = this' and parameter 'self' to 'ctx' to satisfy no-restricted-globals lint rule. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@dos1in 我让 cc 修复了 self 的问题,不过看上去不是这次 diff 的问题。而且这种 replace 没有必要。麻烦看一下 lint 这里 |
可能是新的检测规则,其他没问题,合并了。 |
No description provided.