DCSIMG
Silverlight 3 Quick Tip #4: Hardware Acceleration - Alex Golesh's Blog About Silverlight Development

Silverlight 3 Quick Tip #4: Hardware Acceleration

Silverlight 3 Beta 1 bring us new and highly expected future – hardware acceleration. This short article will answer simple questions is how it could be enabled/used, where it is supported and when should be used.

Well, the first answer is relatively simple. To enable hardware acceleration one need to do following:

In plugin settings enable GPU Acceleration:

<param name="EnableGPUAcceleration" value="true" />
Next, set the “CacheMode” property of desired element to to “BitmapCache”:
<Canvas.CacheMode>
    <BitmapCache/>
</Canvas.CacheMode>

or

<StackPanel CacheMode="BitmapCache"/>

Now desired elements will be cached and will use hardware acceleration.

Now the support issue. The hardware acceleration is supported as following:

  • Windows: Browser & Fullscreen (on machines with DirectX 9.0c)
  • Mac: Fullscreen only

The last question left is when this feature should be used? The most impulsive answer I heard here is “everywhere”. But in real word the picture is slightly different.

Only 3 properties could be hardware accelerated (at least in current Beta stage): Transforms, Rectangular Clipping and Blending. This means, that if your application doesn’t use those properties you will not benefit from this feature. If so, why not set the CacheMode on topmost element? The answer is simple – this will introduce more overhead to the rendering system which will try to calculate what should be cached and what not. Also, rendering mechanism uses unmanaged intermediate surfaces while rendering hardware accelerated elements and they could be pretty expensive especially if not really used. The best practice from here is to set it only on the specific “leaf-most” element which will be hardware accelerated. Another point here – use it only if there is real user-detectable impact.

Source for simple application which uses this feature is here.

Enjoy,

Alex

Published Sunday, March 29, 2009 10:49 AM by Alex Golesh

Comments

# Silverlight 3 Quick Tip #4: Hardware Acceleration - DevCorner | All About Technology

Pingback from  Silverlight 3 Quick Tip #4: Hardware Acceleration - DevCorner | All About Technology

# brushpen.net &raquo; Blog Archive &raquo; Microsoft MIX09 Web Design and Development Conference

Pingback from  brushpen.net  &raquo; Blog Archive   &raquo; Microsoft MIX09 Web Design and Development Conference

# re: Silverlight 3 Quick Tip #4: Hardware Acceleration

I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.

Joannah

http://linuxmemory.net

Saturday, April 04, 2009 2:54 PM by Joannah

# Resources for geekSpeak: What’s New in Silverlight 3 with Shawn Wildermuth

Many thanks to Shawn Wildermuth for giving us all some insight into what’s coming for Silverlight 3.

Monday, April 27, 2009 4:58 PM by MSDN geekSpeak

# Resources for geekSpeak: What???s New in Silverlight 3 with Shawn Wildermuth | Coded Style

Pingback from  Resources for geekSpeak: What???s New in Silverlight 3 with Shawn Wildermuth | Coded Style

# Resources for geekSpeak: What???s New in Silverlight 3 with Shawn Wildermuth | Coded Style

Pingback from  Resources for geekSpeak: What???s New in Silverlight 3 with Shawn Wildermuth | Coded Style

# re: Silverlight 3 Quick Tip #4: Hardware Acceleration

Thanks for the info mate..look forward for your updates...

Wednesday, July 29, 2009 3:06 PM by Ink cartridges

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above: