黑莓网站上的画布运动太慢 [英] canvas motion too slow on blackberry webworks

查看:94
本文介绍了黑莓网站上的画布运动太慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我使用htlm5和JavaScript编写了画布动画.在Windows浏览器上运行时,动作几乎是正常的.但是,当我构建它并在blackberry mobile上运行它时,运动减少的速度可能会快十倍.我该如何做才能表现呢?
而且,我使用表单输入来让用户修改图形的大小.但是,一旦在文本框中修改了值,便会重新调整图形的大小.

Hi I wrote a canvas animation using htlm5 and JavaScript. The motion is almost normal when running on my windows browser. But when I build it and run it on blackberry mobile, the motion decrease may ten times less faster. How can I do for that performance?
The more, I am using the form input to let users modify sizes of the graphics. But as soon as the values are modified in the text box, the graph is resized. How can I do to resize it only when the button is clicked?

推荐答案

A部分-黑莓性能下降
当您说在桌面上运行时动作几乎是正常的"时,这是否意味着动作仍然有些呆滞?

在此处查看基准测试: http://www.roylongbottom.org.uk/android%20benchmarks.htm [ ^ ](是的-我知道一个黑莓手机不是Android设备-寻找QU-S4人物-高通SnapDragon4-新型黑莓手机中的CPU)
我们可以看到,Snapdragon的强大功能能够将速度提高到大约300 MLPOS,而这款笔记本电脑中的Core I3的速度大约是MAXFlops测得的2710 MFLOPS.

立刻,您会发现这款笔记本电脑的处理能力是新版Blackberry的10倍左右.


B部分-更新以响应按钮按下
不看您的代码就很难说.从它的声音来看,您可能正在绘制循环期间检查文本框的值.如果是这样,一对用于保存尺寸的全局变量可能会有所帮助.您可以初始化变量并将其设置为文本框.从那里,无需提交表单,只要按一下按钮就可以更新全局变量. (当然,在对它们进行完整性检查之后)

如果显示代码,则可能会得到更好的答案.

该死!现在我看起来像是一个死灵患者...忘记了检查约会..
Part A - Slow Blackberry performance
When you say that the motion is ''almost normal'' when running on a desktop, does this mean that the motions is still somewhat sluggish?

Checking out the benchmarks found here: http://www.roylongbottom.org.uk/android%20benchmarks.htm[^] (Yes - I know a blackberry isn''t an android - look for QU-S4 figures - Qualcomm SnapDragon4 - the cpu found in newer blackberries)
We can see that the power of the snapdragon is capable of speeds upto about 300 MLPOS, while a Core I3 as found in this laptop has speeds of about 2710 MFLOPS as measured by MAXFlops.

Straight away, one can see that there IS about 10x the processing power in this laptop over a newish Blackberry.


Part B - Update in response to button press
It''s a bit hard to say without seeing your code. From the sounds of it, you may be checking the value of the text-boxes during your drawing loop. If so, a pair of global variables to hold the dimensions may be helpful. You can initialize the vars and set the values to the text-boxes. From there, instead of submitting the form, you can update the global variables whenever the button is pressed. (After they''ve been sanity-checked, of course)

If you show your code, you''ll likely get a better answer.

Dammit! Now I look like a necrophiliac... forgot to check post-date..


这篇关于黑莓网站上的画布运动太慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆