HTML5硬件中的canvas元素加速了吗? [英] Is canvas element in html5 hardware accelerated?

查看:182
本文介绍了HTML5硬件中的canvas元素加速了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对web开发很陌生,实际上我正在考虑潜入html和js来开发游戏。

所以,在做任何事之前,我需要知道html5中的canvas元素是否是硬件加速的。如果不是,那么我需要使用像webgl的东西?我不知道是否重要,但我使用的浏览器是firefox(也许它在不同的浏览器之间)



这可能看起来很愚蠢,但这是一个重要的问题,特别是在游戏中,你有一大堆2d的精灵在四处画。
提前致谢!HTML5 Canvas是硬件加速的,但它需要一个硬件加速浏览器。如果你使用chrome,你可以通过转到 chrome:// gpu /



来查看。如何看起来:





相同:


  1. chromium.org

  2. msdn.microsoft.com


I'm pretty new to web development, in fact I'm thinking of diving into html and js for game developing.

So, before doing anything, I need to know whether or not the "canvas" element in html5 is hardware accelerated. If it's not, then I would need to use something like webgl? I don't know if it matters, but the browser I'm using is firefox(maybe it varies between browsers)

It might seem stupid, but it's an important question, specially since in games you have a bunch of 2d sprites being drawed all around. Thanks in advance!

解决方案

Yes HTML5 Canvas is hardware accelerated but it require a Hardware Accelerated Browser. If you use chrome you can check this out by going to chrome://gpu/

Here is an example on how it looks:

A few articles on the same:

  1. chromium.org
  2. msdn.microsoft.com

这篇关于HTML5硬件中的canvas元素加速了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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