星期二, 4月 10, 2007

[WPF Concept] Immediate mode v.s. Retained Mode

看了WPF Graphics Rendering Overview這篇文章

才知道以往我在解釋WPF與SDK的Rendering異同之時 是可以用這二個詞的...

C P如下,或是直接參考原文





Retained Mode Graphics

One of the keys to understanding the role of the Visual object is to understand the difference between immediate mode and retained mode

graphics systems. A standard Win32 application based on GDI or GDI+

uses an immediate mode graphics system. This means that the application

is responsible for repainting the portion of the client area that is

invalidated, due to an action such as a window being resized, or an

object changing its visual appearance.

In contrast, WPF uses a retained mode system. This means application

objects that have a visual appearance define a set of serialized

drawing data. Once the drawing data is defined, the system is

responsible thereafter for responding to all repaint requests for

rendering the application objects. Even at run time, you can modify or

create application objects, and still rely on the system for responding

to paint requests. The power in a retained mode graphics system is that

drawing information is always persisted in a serialized state by the

application, but rendering responsibility left to the system.



Intelligent Redrawing

One
of the biggest benefits in using retained mode graphics is that WPF can
efficiently optimize what needs to be redrawn in the application. Even
if you have a complex scene with varying levels of opacity, you
generally do not need to write special-purpose code to optimize
redrawing. Compare this with Win32 programming in which you can spend a
great deal of effort in optimizing your application by minimizing the
amount of redrawing in the update region. See Redrawing in the Update Region for an example of the type of complexity involved in optimizing redrawing in Win32 applications.



沒有留言: