<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>SilverLite : remix07boston</title><link>http://blogs.msdn.com/seema/archive/tags/remix07boston/default.aspx</link><description>Tags: remix07boston</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Perf Debugging Tips: EnableRedrawRegions &amp;amp;amp; a performance bug in VideoBrush</title><link>http://blogs.msdn.com/seema/archive/2007/10/07/perf-debugging-tips-enableredrawregions-a-performance-bug-in-videobrush.aspx</link><pubDate>Mon, 08 Oct 2007 04:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5352558</guid><dc:creator>seemar</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/seema/comments/5352558.aspx</comments><wfw:commentRss>http://blogs.msdn.com/seema/commentrss.aspx?PostID=5352558</wfw:commentRss><description>&lt;P&gt;Was chatting with &lt;A class="" href="http://www.andybeaulieu.com/" mce_href="http://www.andybeaulieu.com/"&gt;Andy Beaulieu &lt;/A&gt;at Remix Boston, and he was commenting that it seems&amp;nbsp;that Silverlight only draws when needed -- it is true, we try to not waste your CPU cycles. For Perf debugging, a way to tell when you are causing a redraw is to turn on the control's &lt;EM&gt;EnableRedrawRegions&lt;/EM&gt; property. &lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-add-space: auto"&gt;&lt;SPAN style="FONT-FAMILY: Courier"&gt;&lt;FONT size=3&gt;agControl.settings.EnableRedrawRegions = true;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;With this feature on, when a section of the plugin causes a draw, that section will draw in a different color. This setting is not for those susceptible to seizures =P&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Bug found&lt;/STRONG&gt;&lt;/U&gt;: With this setting, I investigated a performance issue with &lt;STRONG&gt;&lt;A class="" href="http://msdn2.microsoft.com/en-us/library/bb404773.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb404773.aspx"&gt;VideoBrush&lt;/A&gt;&lt;/STRONG&gt;.&amp;nbsp;In our 1.0 Silverlight bits,&amp;nbsp;VideoBrush always&amp;nbsp;requests a redraw in the next frame.&amp;nbsp;This is a bug. Unfortunately, if the control framerate is set to the default (60 fps), then any VideoBrush will be redrawn 60 times in a second. In actuality, VideoBrush should draw at the framerate that its media is getting refreshed (eg. 30fps, 15fps, or 0fps if paused), and should not take up so many CPU cycles. We have a fix for this bug in 1.1. If you are blocked by this bug, please let me know and I can pass the info along to our servicing team.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;[update] By the way, this bug was fixed in a servicing pack in dec 2007. &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;A &lt;STRONG&gt;workaround &lt;/STRONG&gt;is to set the framerate on your Silverlight control to be the same as the framerate of your video. There are visual artifacts to this workaround, but it is slight&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt; mso-add-space: auto"&gt;&lt;SPAN style="FONT-FAMILY: Courier"&gt;&lt;FONT size=3&gt;Sys.Silverlight.createObjectEx({&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-add-space: auto"&gt;&lt;SPAN style="FONT-FAMILY: Courier"&gt;&lt;FONT size=3&gt;source: "xaml/Scene.xaml",&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-add-space: auto"&gt;&lt;SPAN style="FONT-FAMILY: Courier"&gt;&lt;FONT size=3&gt;parentElement: document.getElementById("SilverlightControlHost"),&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-add-space: auto"&gt;&lt;SPAN style="FONT-FAMILY: Courier"&gt;&lt;FONT size=3&gt;id: "SilverlightControl",&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-add-space: auto"&gt;&lt;SPAN style="FONT-FAMILY: Courier"&gt;&lt;FONT size=3&gt;properties: {&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in"&gt;&lt;SPAN style="FONT-FAMILY: Courier"&gt;&lt;FONT size=3&gt;width: "500",&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in"&gt;&lt;SPAN style="FONT-FAMILY: Courier"&gt;&lt;FONT size=3&gt;height: "500",&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in"&gt;&lt;SPAN style="FONT-FAMILY: Courier"&gt;&lt;FONT size=3&gt;background: "black",&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in"&gt;&lt;FONT size=3&gt;&lt;SPAN style="FONT-FAMILY: Courier"&gt;&lt;STRONG&gt;framerate: &lt;/STRONG&gt;"&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;&lt;STRONG&gt;30&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face=Courier&gt;"&lt;SPAN style="FONT-FAMILY: Courier"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //only as much as needed&lt;o:p&gt;&lt;/o:p&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-add-space: auto"&gt;&lt;SPAN style="FONT-FAMILY: Courier"&gt;&lt;FONT size=3&gt;}&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5352558" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/seema/archive/tags/remix07boston/default.aspx">remix07boston</category><category domain="http://blogs.msdn.com/seema/archive/tags/slperf/default.aspx">slperf</category><category domain="http://blogs.msdn.com/seema/archive/tags/media/default.aspx">media</category><category domain="http://blogs.msdn.com/seema/archive/tags/silverlight/default.aspx">silverlight</category></item></channel></rss>