That doesnt seem to help. As far as i can tell, this has more to do with the rendering pipeline than it does with layout. As i understand it, the render stage effectively composites the button ontop of the border, and (irrespective of its position in the visual tree) if the button is invalidated it *needs* to repaint the whole border.
but why oh why? On Fri, Nov 12, 2010 at 8:04 PM, Shane Morris (Automatic Studio) < [email protected]> wrote: > Did you try moving the button out of the border? Below the border and > button are *siblings* inside a grid. Seems to solve the problem in > Perforator anyway. > > > > <Grid > HorizontalAlignment="Right" Margin="0,65.947,21.843,86.053" Width="244.632"> > > > <Border BorderBrush="#FFCA2C2C" BorderThickness="2" CornerRadius="40"> > > > <Border.Effect> > > > <DropShadowEffect Direction="-42" BlurRadius="6" Opacity="0.635"/> > > > </Border.Effect> > > > </Border> > > > <Button Content="Button" HorizontalAlignment="Center" > VerticalAlignment="Center" Width="60" Height="60"/> > > </Grid> > > > > Shanemo > > > > > > *From:* [email protected] [mailto:[email protected]] > *On Behalf Of *Xerxes Battiwalla > *Sent:* Friday, 12 November 2010 4:01 PM > *To:* ozWPF > *Subject:* Stopping DropShadowEffect from forcing large dirty-region > changes > > > > Hi all, > > > > Our application is visually composed in (effectively) a 2-column design. > Our designer wants to place drop-shadows around each column, but when we do > we notice the dirty-region for repaint grows to encompass the entire border > when any of its sub-elements need repainting. Below is an example > demonstrating the problem. Hook it up to Perforator, turn on Show Dirty > Rectangles and move the mouse over the button. You'll notice the entire > border is repainted when it only needs to paint the button. Why, and how do > i stop this? OR is there another way to apply a drop-shadow effect without > the repaint penalty? (in our real system, we're seeing 10-20% CPU usage just > because of this). > > > > <Window > > xmlns=" > http://schemas.microsoft.com/winfx/2006/xaml/presentation" > > xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > > x:Class="WPFDropShadow.MainWindow" > > x:Name="Window" > > Title="MainWindow" > > Width="640" Height="480"> > > > > <Grid x:Name="LayoutRoot"> > > <Border BorderBrush="#FFCA2C2C" > BorderThickness="2" Margin="147,67,165,85" CornerRadius="40"> > > <Border.Effect> > > <DropShadowEffect > Direction="-42" BlurRadius="6" Opacity="0.635"/> > > </Border.Effect> > > <Button Content="Button" > Margin="126,114,109,113"/> > > </Border> > > </Grid> > > </Window> > > > > > > Thanks, > Xerx > > _______________________________________________ > ozwpf mailing list > [email protected] > http://prdlxvm0001.codify.net/mailman/listinfo/ozwpf > >
_______________________________________________ ozwpf mailing list [email protected] http://prdlxvm0001.codify.net/mailman/listinfo/ozwpf
