1. Set <param name= "Enablegpuacceleration" value= "true" on the Silverlight plug-in/> 或使用代码
Application.Current.Host.Settings.
enablegpuacceleration = True;
2. CacheMode
=
set "BitmapCache" - 所谓GPU加速是基于GPU缓存了一些UI元素,节省了CPU的耗用
on a control of type UIElement
How do I know which controls are cached? Set on the Silverlight <
param
name
plug-in =
"enableCacheVisualization"
value
=
"true"
/> 后程序界面中会有颜色变化:
1. Red means not being cached
2. Normal color indication is cached
3. Green indicates no setting CacheMode
=
"BitmapCache",但被自动缓存
Because the principle of GPU acceleration is caching, the frequent change of the UIElement is not appropriate, because the frequent update of the cache will result in performance loss. But mideaelement such as video uses GPU acceleration to achieve performance improvements:
Figure: Caching-enabled video
However, the Perspetive 3d effect video is not available:
Figure: The video on the right uses the Pespective 3d effect, which is shown in red with no cache
Limitations of GPU Acceleration:
1. GPU acceleration supports only the following animations: Scale , Rotate, changing Opacity, Clipping (only if clip is rectangular), others not supported, such as Perspect Ive animated 3d effects.
2. With insufficient GPU memory, Silverlight will use the CPU to implement the cache by default, which will increase the burden on the CPU-currently Silverlight does not support the method of querying the GPU cache size, only the Analytics.gpucollection property is provided.
3. Need to support DirectX (Windows) or OpenGL (MAC) graphics, and only full-screen mode is supported on MAC
Transferred from: http://blog.csdn.net/jameszhou/article/category/543888