<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Craftymind &#187; Html</title>
	<atom:link href="http://www.craftymind.com/category/html/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.craftymind.com</link>
	<description>Hacking away at UI development</description>
	<lastBuildDate>Mon, 13 Jun 2011 16:59:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>GUIMark 3 released.</title>
		<link>http://www.craftymind.com/2011/06/13/guimark-3-released/</link>
		<comments>http://www.craftymind.com/2011/06/13/guimark-3-released/#comments</comments>
		<pubDate>Mon, 13 Jun 2011 16:59:14 +0000</pubDate>
		<dc:creator>Sean Christmann</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Html]]></category>

		<guid isPermaLink="false">http://www.craftymind.com/?p=399</guid>
		<description><![CDATA[GUIMark 3 has just been released and it&#8217;s aimed squarely at benchmarking mobile devices. The debate this time around concerns the relative speed differences between Flash and HTML5 on your phone or tablet. With a month and a half in the making, 4 unique tests, and over 200 results this was a big one and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.craftymind.com/guimark3">GUIMark 3</a> has just been released and it&#8217;s aimed squarely at benchmarking mobile devices. The debate this time around concerns the relative speed differences between Flash and HTML5 on your phone or tablet. With a month and a half in the making, 4 unique tests, and over 200 results this was a big one and I hope you guys enjoy reading and dissecting the results. You can read the article <a href="http://www.craftymind.com/guimark3">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.craftymind.com/2011/06/13/guimark-3-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>GUIMark 2 has been released! Compare HTML5 and Flash performance</title>
		<link>http://www.craftymind.com/2010/05/05/guimark-2-has-been-released-compare-html5-and-flash-performance/</link>
		<comments>http://www.craftymind.com/2010/05/05/guimark-2-has-been-released-compare-html5-and-flash-performance/#comments</comments>
		<pubDate>Wed, 05 May 2010 15:43:27 +0000</pubDate>
		<dc:creator>Sean Christmann</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Html]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.craftymind.com/?p=154</guid>
		<description><![CDATA[I am very happy to finally announce the release of GUIMark 2. After a couple weeks of building and testing, I feel I&#8217;ve finally created the best visual benchmarks I could come up with for comparing both Flash and HTML5. The results reveal a lot of interesting technical differences between the two environments. You can [...]]]></description>
			<content:encoded><![CDATA[<p>I am very happy to finally announce the release of GUIMark 2. After a couple weeks of building and testing, I feel I&#8217;ve finally created the best visual benchmarks I could come up with for comparing both Flash and HTML5. The results reveal a lot of interesting technical differences between the two environments. You can read the full details and results on the <a href="http://www.craftymind.com/guimark2/">GUIMark 2</a> project page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.craftymind.com/2010/05/05/guimark-2-has-been-released-compare-html5-and-flash-performance/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Blowing up HTML5 video and mapping it into 3D space</title>
		<link>http://www.craftymind.com/2010/04/20/blowing-up-html5-video-and-mapping-it-into-3d-space/</link>
		<comments>http://www.craftymind.com/2010/04/20/blowing-up-html5-video-and-mapping-it-into-3d-space/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 15:53:34 +0000</pubDate>
		<dc:creator>Sean Christmann</dc:creator>
				<category><![CDATA[Html]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.craftymind.com/?p=64</guid>
		<description><![CDATA[I&#8217;ve been doing a bit of experimenting with the Canvas and Video tags in HTML5 lately, and found some cool features hiding in plain sight. One of those is the Canvas.drawImage() api call. Here is the description on the draft site.
3.10 Images
To draw images onto the canvas, the drawImage method can be used.
This method can [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing a bit of experimenting with the Canvas and Video tags in HTML5 lately, and found some cool features hiding in plain sight. One of those is the Canvas.drawImage() api call. Here is the description on the draft site.</p>
<p><a href="http://dev.w3.org/html5/canvas-api/canvas-2d-api.html#images">3.10 Images</a></p>
<pre>To draw images onto the canvas, the <dfn id="dom-context-2d-drawimage" title="dom-context-2d-drawImage"><code>drawImage</code></dfn> method can be used.
This method can be invoked with three different sets of arguments:
<ul>
<li> <code>drawImage(<var>image</var>, <var>dx</var>, <var>dy</var>)</code></li>
<li> <code>drawImage(<var>image</var>, <var>dx</var>, <var>dy</var>, <var>dw</var>, <var>dh</var>)</code></li>
<li> <code>drawImage(<var>image</var>, <var>sx</var>, <var>sy</var>, <var>sw</var>, <var>sh</var>, <var>dx</var>, <var>dy</var>, <var>dw</var>, <var>dh</var>)</code></li>
</ul>

Each of those three can take either an <code><a href="http://www.w3.org/TR/html5/text-level-semantics.html#htmlimageelement">HTMLImageElement</a></code>, an <code><a href="http://www.w3.org/TR/html5/the-canvas-element.html#htmlcanvaselement">HTMLCanvasElement</a></code>, or an <code><a href="http://dev.w3.org/html5/spec/video.html#htmlvideoelement">HTMLVideoElement</a></code> for the <var>image</var> argument.</pre>
<p>The api lets you take the contents of specific HTML elements and draw them into a canvas, and the 3rd element in that list is just begging to be abused. Copying video into a canvas element means opening up the ability to manipulate or process video frames at runtime. Two concepts instantly came to mind that seemed like fun to try and figure out, here they are below.</p>
<h2 style="text-align: center;">Blowing apart fragments of video</h2>
<p style="text-align: center;"><a title="Exploding Video" href="http://craftymind.com/factory/html5video/CanvasVideo.html"><img class="aligncenter size-full wp-image-66" title="html5boom" src="http://www.craftymind.com/wp-content/uploads/2010/04/html5boom.jpg" alt="" width="600" height="363" /></a></p>
<p style="text-align: left;">Click around the video frame to blow up that part of the video, the exploded pieces will continue to play the video inside them. After a while they retract back to their original place. One feature I didn&#8217;t have time to figure out was adding depth to the explosion, so pieces that are closest to ground zero fly up into the air as they sail outward. With full shadow effects this could look really cool.</p>
<p style="text-align: center;">
<h2 style="text-align: center;">3D Video</h2>
<p style="text-align: center;"><a href="http://www.craftymind.com/factory/html5video/CanvasVideo3D.html"><img class="aligncenter size-full wp-image-68" title="html53d" src="http://www.craftymind.com/wp-content/uploads/2010/04/html53d.jpg" alt="" width="600" height="384" /></a></p>
<p style="text-align: left;">
<p style="text-align: left;">This demo in particular runs really well inside webkit based browsers, but not so much in Firefox. Firefox doesn&#8217;t appear to have any hardware acceleration for Ogg decoding so I had to drop the video size in half in order to run at acceptable framerates. Even still, Firefox chokes pretty badly on my Macbook Pro.</p>
<p style="text-align: left;">*Update* &#8211; I&#8217;ve changed the ogg video to be 640 x 360, prepare to see firefox weep</p>
<h2 style="text-align: left;">Lessons learned</h2>
<p>There&#8217;s a couple hints I found out along the way that are good to know if you want to play around with drawing video. First, you need a bit of hackish code to get this to work effeciently and it flows like this.</p>
<p style="text-align: center;">[Video playing] -&gt; [Draw Video onto Canvas 1] -&gt; [Draw fragments of Canvas 1 onto Canvas 2]</p>
<p style="text-align: left;">Don&#8217;t ask me why, but copying pixel data out of a video tag is expensive, so expensive that drawing it into a temporary canvas, and then drawing pieces of that temp canvas onto a final canvas is faster then just referencing the video tag repeatedly within the same loop. That&#8217;s why you&#8217;ll see 2 Canvases in the source code for the demos. I&#8217;m sure there&#8217;s a technical reason for this duplication process, but it&#8217;s a lazy reason.</p>
<p style="text-align: left;">Secondly, don&#8217;t try copying individual pixels around. You can still see the remnants of my first code attempt inside the explosion demo with getPixel() and setPixel(). This turned out to be horribly slow and completely unnecessary. Canvas.drawImage() + matrix transforms on the canvas space is far more efficient then handcrafted pixel pushing. On the other hand, pixel manipulation allows you to do things like <a href="https://developer.mozilla.org/samples/video/chroma-key/index.xhtml">runtime chroma keying</a>, get ready for a new wave of &#8220;clippy&#8221; style videos with full transparency popping over websites to help you out.</p>
<p style="text-align: left;">Lastly, I&#8217;m learning very quickly that not all browsers are created equal when it comes to performance, it&#8217;s a crapshoot when it comes to heavy video+image manipulation. Safari and Chrome work well with h.264, Firefox slogs along with Ogg Theora, and Opera is somewhere in the middle.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.craftymind.com/2010/04/20/blowing-up-html5-video-and-mapping-it-into-3d-space/feed/</wfw:commentRss>
		<slash:comments>187</slash:comments>
		</item>
		<item>
		<title>Introducing GUIMark &#8211; An RIA benchmark for Flex, Silverlight, HTML and more</title>
		<link>http://www.craftymind.com/2008/05/22/introducing-guimark-an-ria-benchmark-for-flex-silverlight-html-and-more/</link>
		<comments>http://www.craftymind.com/2008/05/22/introducing-guimark-an-ria-benchmark-for-flex-silverlight-html-and-more/#comments</comments>
		<pubDate>Thu, 22 May 2008 16:04:14 +0000</pubDate>
		<dc:creator>Sean Christmann</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Html]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://www.craftymind.com/2008/05/22/introducing-guimark-an-ria-benchmark-for-flex-silverlight-html-and-more/</guid>
		<description><![CDATA[If you&#8217;re wondering why I&#8217;ve been quiet the past few weeks it&#8217;s because I&#8217;ve been devoting most of my free time to finishing off a new benchmark I&#8217;m releasing today called GUIMark. GUIMark is kinda like an Acid3 test on speed that&#8217;s geared towards RIA technologies. The goal was to figure out how to implement [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re wondering why I&#8217;ve been quiet the past few weeks it&#8217;s because I&#8217;ve been devoting most of my free time to finishing off a new benchmark I&#8217;m releasing today called <a href="http://www.craftymind.com/guimark">GUIMark</a>. GUIMark is kinda like an <a href="http://acid3.acidtests.org/">Acid3 test</a> on speed that&#8217;s geared towards RIA technologies. The goal was to figure out how to implement a reference design in different runtimes and then benchmark how smoothly that design could be animated. So far I have implementations in DHTML, Flex, Java, Silverlight 1 and Silverlight 2. All the results and and implementation details can be found under the <a href="http://www.craftymind.com/guimark">GUIMark page</a>.</p>
<p>GUIMark shares alot in common with another RIA benchmark <a href="http://www.bubblemark.com/">Bubblemark</a>. I&#8217;ve <a href="http://www.craftymind.com/2008/04/11/why-bubblemark-is-a-poor-ui-benchmark/">written a bit</a> about Bubblemark and why I think an alternative is necessary, but I do believe Bubblemark and GUIMark can coexist while serving 2 different purposes. Alexey Gavrilov <a href="http://metalinkltd.com/?p=170">stated it best</a> in that he sees Bubblemark as a sortof &#8216;Hello World&#8217; launchpad into comparing different environments and I agree with him. Bubblemark is a *very* accessible test suite and its easy for any kind of developer to jump in and play around with performance techniques. GUIMark takes a different approach by trying to benchmark the types of UI elements common in our Web 2.0 world. This includes things like vector redraws, alpha transparencies, text reflow, bitmap motion, and 9 scale slicing rules. From there I just fill up the render pipeline until it becomes so over-saturated that it becomes easy to visually distinguish which rendering engines are more efficient then others. As a result, the benchmark is more complicated on a visual level and requires a bit more time then Bubblemark to understand the implementation rules. Lastly with GUIMark I&#8217;ve tried to get into some of the lower level details behind <a href="http://craftymind.com/guimark-inside">how rendering engines work</a> and how that&#8217;s affected the creation of this project.</p>
<p>I&#8217;m hoping that developers and designers will be able to use this test suite to identify any pros or cons to choosing a particular environment when visual transitions are a key element of the experience. I&#8217;m also hoping these benchmarks provide a spotlight for the community that we can turn toward the runtime engineers inside Sun or Adobe or Mozilla to demand better performance.</p>
<p><a href="http://www.craftymind.com/guimark">Go to GUIMark home page</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.craftymind.com/2008/05/22/introducing-guimark-an-ria-benchmark-for-flex-silverlight-html-and-more/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Why Bubblemark is a poor ui benchmark</title>
		<link>http://www.craftymind.com/2008/04/11/why-bubblemark-is-a-poor-ui-benchmark/</link>
		<comments>http://www.craftymind.com/2008/04/11/why-bubblemark-is-a-poor-ui-benchmark/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 19:37:08 +0000</pubDate>
		<dc:creator>Sean Christmann</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Html]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://www.craftymind.com/2008/04/11/why-bubblemark-is-a-poor-ui-benchmark/</guid>
		<description><![CDATA[A few months ago someone on the Adobe boards asked why the Flex testcase in Bubblemark seemed to act so different in AIR versus in the browser. Yesterday, I saw the same question come up again and I figured I&#8217;d finally weigh in on the topic. The simple answer is that the test was created [...]]]></description>
			<content:encoded><![CDATA[<p>A few months ago someone on the Adobe boards asked why the Flex testcase in <a href="http://bubblemark.com/">Bubblemark</a> seemed to act so different in AIR versus in the browser. Yesterday, I saw the <a href="http://graphics-geek.blogspot.com/2008/04/off-bubblemark.html">same question come up again</a> and I figured I&#8217;d finally weigh in on the topic. The simple answer is that the test was created improperly, the complex answer has to do with the inherent limitations of the test itself.</p>
<p>First off, for those who don&#8217;t know what the Bubblemark test is, its a simple animation test case implemented in different GUI frameworks, its kinda like an Acid2 test for rendering speed. The charts should ideally give you a base number to understand how well one technology compares against another for rendering. As a GUI developer I&#8217;ve been a bit underwhelmed with the whole thing and heres why:</p>
<ol>
<li><strong>The author doesn&#8217;t understand Flash&#8217;s rendering engine.</strong> The easiest way to illustrate how incorrectly the Flash test was designed, is to download the source and change the compiled framerate to 1 fps. Re-compile and run the test and you&#8217;ll notice the benchmark framerate running at ~50 fps. You can clearly see the balls only moving once per second, yet the test thinks its flying along. This is because the testcase makes the incorrect assumptions that changing the properties of a DisplayObject causes it to render right away. The reality is, Flash holds on to all display updates till the next render pass and applies all the latest changes at once. Changing the position of an object every 5 milliseconds is meaningless when Flash is bound by a 33 millisecond render pass (or whatever you&#8217;re framerate divided by 1000 happens to be). A correct test case would rely on an ENTER_FRAME handler to change x and y values and get rid of any Timer calls.</li>
<li><strong>Framerate tests above 60 fps are meaningless. </strong>Seriously, any GUI benchmark designed to test above 60 fps is bogus. In fact, a pretty simple optimization technique for Adobe or Sun would be to cap the paint requests that get forwarded to OS X or Windows, simply because the majority of computer users these days are on LCD panels which natively run at 60 fps. Some operating systems even go a step further and limit the effective framerate of paint requests it sends to the videocard (see <a href="http://arstechnica.com/journals/apple.ars/2007/04/17/beam-synchronization-friend-or-foe">Beam Sync</a> on Mac). So when you see the Java test case fly up to 120 fps on Bubblemark, you can realistically only see 60 of those frames, and there might be a chance the other 60 are never even calculated by Javas layout engine.</li>
<li><strong>The test just moves balls around!</strong> This is my biggest beef with the benchmark because it only tests one simple aspect of the rendering engine in these technologies, which is bitmap translation. How do bitmaps moving around the screen tell you anything about the capabilities of the respective technologies? Do the <a href="http://blogs.sun.com/chrisoliver/entry/bubblemark">JavaFX</a> guys really think optimizing this usecase will make their technology relevant? The only thing Bubblemark will tell you is which runtimes might best handle bitmap particle emitters&#8230;.thats about it. Theres a lot more that goes into both the layout engine and the rendering pipeline of these different technologies and its a shame that only the most basic aspect is being tested. The funny thing is, if you open up your task manager while running the tests, you&#8217;ll notice that several of them don&#8217;t even try to run at full speed, my CPU is sitting as low as 20% in some cases. This means the runtimes don&#8217;t even consider the test difficult enough to give it full attention and have opted for using less power over faster motion.</li>
</ol>
<p>I don&#8217;t mean to cut down the developers responsible for Bubblemark because at least they came up with a simple way to help us all compare these different technologies, I just think its  a bit misguided to put any meaning behind these numbers. When evaluating your options for a GUI framework in our flashy web 2.0 world, you need to consider how well a technology can handle object scaling, alpha transparencies, rotations, text reflow, along with basic  x and y translation and dynamic redraws. Even more realistically, developers need to be aware of the limits in the 25-45 framerate region since this is where you can efficiently balance render complexity with smooth animation. I&#8217;ve uploaded a couple quick test cases in <a href="http://www.craftymind.com/test/guimark/FramerateTest.html">Flash</a>, <a href="http://www.craftymind.com/test/guimark/FramerateHtml.html">HTML</a>, and <a href="http://www.craftymind.com/test/guimark/FramerateSilverlight.html">Silverlight </a>that I think provide a good foundation for stressing a rendering engine and hopefully I&#8217;ll get a chance to expand them more into a full test suite.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.craftymind.com/2008/04/11/why-bubblemark-is-a-poor-ui-benchmark/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

