Upload
goodfriday
View
1.403
Download
0
Embed Size (px)
Citation preview
Draw Loop Event Handlers
Tick
Any property
changes?
Layout Queue up rendering changes
Rasterizein back buffer
Hey browser! Show my
Frame
Draw Loop Event Handlers
Tick
Any property
changes?
Layout Queue up rendering changes
Rasterizein back buffer
Hey browser! Show my
Frame
DoubleAnimation
Storyboard.TargetName myprojectionStoryboard.TargetProperty RotationYFrom 0 To 90
Duration 0:0:1
Frame Based
Model
time
Draw Loop Event Handlers
Tick
Any property
changes?
Layout Queue up rendering changes
Rasterizein back buffer
Hey browser! Show my
Frame
Draw Loop Event Handlers
Tick
Any property
changes?
Layout Queue up rendering changes
Rasterizein back buffer
Hey browser! Show my
Frame
ListBox
ScrollViewer
Grid
ScrollBars StackPanel
ListBoxItem
stuff
internalU
internal
offset
Clip
Draw Loop Event Handlers
Tick
Any property
changes?
Layout Queue up rendering changes
Rasterizein back buffer
Hey browser! Show my
Frame
Draw Loop Event Handlers
Tick
Any property
changes?
Layout Queue up rendering changes
Rasterizein back buffer
Hey browser! Show my
Frame
Draw Loop Event Handlers
Tick
Any property
changes?
Layout Queue up rendering changes
Rasterizein back buffer
Hey browser! Show my
Frame
Vs.
1. ParentNode
2. Layout Offset
3. RenderTransform
5. Clip
7. Opacity
8. OpacityMask
10.Children
Intermediate
surface
Apply Effect
Apply 2nd effect.
Top image is input
http://bit.ly/DXsdk
http://bit.ly/buildtask
http://blogs.msdn.com/greg_schechter
// Inputs (Brushes, including ImplicitInput)
sampler2D implicitInputSampler : register(S0);
// Inputs (Brushes, including ImplicitInput)
sampler2D implicitInputSampler : register(S0);
// Pixel Shader
float4 main(float2 uv : TEXCOORD) : COLOR
{
float4 color = tex2D(implicitInputSampler, uv);
Brushes
A brush maps a screen position to a color.
SolidColorBrush
<SolidColorBrush Color="Green"/>
Brushes
A brush maps a screen position to a color.
LinearGradientBrush
StartPoint
EndPoint
<LinearGradientBrush>
<LinearGradientBrush.GradientStops>
<GradientStop Color="#FF0000" />
<GradientStop Color="#00FF00" Offset=".5" />
<GradientStop Color="#0000FF" Offset="1" />
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
Brushes
A brush maps a screen position to a color.
RadialGradientBrush
<RadialGradientBrush GradientOrigin="0.25 0.25">
<RadialGradientBrush.GradientStops>
<GradientStop Color="White" Offset="0"/>
<GradientStop Color="Blue" Offset="1"/>
</RadialGradientBrush.GradientStops>
</RadialGradientBrush>
StartPoint
EndPoint
Brushes
Maps a screen position to a color.
Integrate the different graphics stacks
Image & Text
// Inputs (Brushes, including ImplicitInput)
sampler2D implicitInputSampler : register(S0);
// Pixel Shader
float4 main(float2 uv : TEXCOORD) : COLOR
{
float4 color = tex2D(implicitInputSampler, uv);
// Inputs (Brushes, including ImplicitInput)
sampler2D implicitInputSampler : register(S0);
// Pixel Shader
float4 main(float2 uv : TEXCOORD) : COLOR
{
float4 color = tex2D(implicitInputSampler, uv);
color.rgb = 1 - color.rgb;
return color;
}
Blur & DropShadow
Custom Effect
Effects can pull content from any brush
1. ParentNode
2. Layout Offset
3. RenderTransform
4. Projection
7. Opacity
8. OpacityMask
9. Hardware Cache
10.Children
Perf
Blur & DropShadow
Custom Effect
Effects can pull content from any brush
not
WriteableBitmap: A way to replicate content
WriteableBitmap: A cache of our rendering pipeline
WriteableBitmap Pixel Access:To save output of our rendering
WriteableBitmap Pixel Access:A way to draw whatever you like
http://blogs.msdn.com/mharsh/
What's New in Microsoft Silverlight 3 MIX09-T14F
1. ParentNode
2. Layout Offset
3. RenderTransform
4. Projection
5. Clip
6. Effect
7. Opacity
8. OpacityMask
9. Hardware Cache
10.Children
1. ParentNode
2. Layout Offset
3. RenderTransform
4. Projection
5. Clip
6. Effect
7. Opacity
8. OpacityMask
9. Hardware Cache
10.Children
3 Properties can be HW accelerated
Transforms
Rectangular Clipping
Blending
EnableGPUAcceleration=true
CacheMode=BitmapCache
EnableCacheVisualization
EnableCacheVisualization
360p Silverlight H264
Video, Stretched to FS
CPU w/
SW Stretch
CPU w/
HW Stretch
% Diff
XP laptop ’04
1.3ghz single core70% CPU 32% CPU -55%
Vista desktop ’04
2.4g single core
88% CPU 44% CPU -50%
Vista laptop ’07
2.3g core2duo
60% CPU 24% CPU -60%
540p Silverlight H264
Video, Stretched to FS
SW Stretch HW Stretch % Diff
XP laptop ’04
1.3ghz single core
69% CPU 59% CPU -15%
Vista laptop ’07
2.3g core2duo
71% CPU 37% CPU -47%
WriteableBitmap: A way to replicate contentCacheMode:A way to transform content
http://bit.ly/effectsLib
http://bit.ly/DXsdk
http://bit.ly/buildtask
http://blogs.msdn.com/greg_schechter
http://blogs.msdn.com/mharsh
http://blogs.msdn.com/jstegman/
http://blogs.msdn.com/seema
http://blogs.msdn.com/seema
Transparency Event Handlers
Tick
Browser: what is
behind me?
Any property changes
?
Layout Queue up rendering changes
Rasterizein back buffer
Hey browser! Show my
Frame
Browser: Blend
me
banding
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market
conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.
MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.