r/programming • • Dec 20 '10

A Christmas Tree in 1k of Javascript

http://www.romancortes.com/blog/how-i-did-the-1kb-christmas-tree/
1.1k Upvotes

221 comments sorted by

View all comments

Show parent comments

4

u/ZorbaTHut Dec 21 '10

Read your own comment again.

Chrome does not have hardware-accelerated javascript. Hardware-accelerated javascript does not exist. You are mistaking it with WebGL which is present in Safari, Firefox (3 and 4) and Chrome. WebGL has nothing to do with javascript, it is a hardware accelerated <canvas> element (HTML5). Chrome has barely any more hardware acceleration than Microsoft Powerpoint.

You're right that there's no hardware-accelerated javascript. Everything else in that paragraph is wrong. Chrome's hardware acceleration isn't WebGL, this acceleration isn't based on <canvas>, and Chrome is working on having significantly more hardware acceleration than Microsoft Powerpoint.

Hardware acceleration doesn't imply polygons. You can do it with sprites also. That's what the Chrome team is working on.

And just to stave off the inevitable, while it might not be accelerating Javascript itself, it certainly can accelerate the sprites that are placed by Javascript.

-2

u/ascendant512 Dec 21 '10 edited Dec 21 '10

If you don't bother reading Google's own explanation of how Chrome's hardware acceleration works, then what is the point in reasoning with you? It clearly states:

  • Layer has 3D or perspective transform CSS properties

  • Layer is used by <video> element using accelerated video decoding

  • Layer is used by a <canvas> element with a 3D context

  • Layer uses a CSS animation for its opacity or uses an animated webkit transform

And

Even with hardware acceleration enabled, pages that don't contain a <video> or WebGL elements and don't make use of 3D CSS transformations/animation use the software path.

In the example of this article (regular html and javascript) the new hardware-accelerated features in Chrome would never even be invoked.

And finally, Microsoft PowerPoint (an example I used to illustrate a common and not hotly debated piece of software) features GPU acceleration for animations, transitions, and video decoding. I can't even think of something that Chrome does on top of that either in current builds or future plans.

In short, you are a rabid fanboy.

EDIT: formatting

5

u/ZorbaTHut Dec 21 '10

If you go and read the original link yet again:

Vangelis Kokkevis, one of the engineers behind the Chromium project, notes that Chrome currently only uses hardware acceleration for displaying some content. Now that the basic infrastructure is in place, however, the Chromium team expects to move "even more of the rendering from the CPU to the GPU to achieve impressive speedups."

It's a work in progress. They're not done yet. The page you're using as rock-solid evidence is already months out of date.

I have no idea why you're calling me a fanboy. I use both Chrome and Firefox frequently, and I haven't mentioned anything except a feature that the Chrome devs have been talking about publicly. All I can conclude is that you have some deep loathing of Google and can't bear to hear anything good about them.

-1

u/ascendant512 Dec 21 '10

Since this is actually still slightly relevant to the thread

I'm calling you a fanboy because you're victim to hype and misinformation about Chrome's rendering engine propagated by people like yourself. You are posting as fact that it can do things it can't.

even more of the rendering from the CPU to the GPU

is referring to the CSS3 transforms and other things I listed, not a nebulous generalization for all images and video.

the actual compositing of the sprites certainly would be. it certainly can accelerate the sprites that are placed by Javascript.

No, this is not a current or upcoming feature in Chrome. Chrome will only accelerate images placed with CSS, and only some of them at that.

As far as my deep loathing of Google and Google-related products: you're ridiculous.