Sie sind auf Seite 1von 27

avalon under the hood

greg schechter
jeff bogdan
chris anderson
• Styles, bindings,
• Mouse, Keyboard, controls
Pen • Layout
• Commands Element System • Text layout (PTS)
• Glyphs
• Metrics
• Cache
Input System • Routing
• Class handlers
Font System
Event System • Video, Audio
• 2D, 3D,
Animation
• Text layout (line)
• Change • Remoting
notification
Visual System • Message based
• Storage
• Expressions • 2D, 3D
Transport
• Hardware,
Software
Property System
Composition System
Step 1: Write a
program
<ListBox>
<Button />
<Button />
</ListBox>
Step 2: Compile
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
011101001011101001011101001011101001
BAML

EXE
C#/VB/etc

Images, etc
Step 3: Run the
program
Step 4: Make pixels
blink
ListBox

Measure & Arrange


Render
ScrollViewer

StackPanel

Button Button
CompNode

CompNode CompNode CompNode


UI Thread Render Thread

ListBox

CompNode

ScrollViewer

StackPanel CompNodeCompNode CompNode

Button
Transport
Button
DX Surfaces
CompNode

Bitmaps
CompNodeCompNode CompNode
Step 5: Talk to the
user
ListBox

CompNode
ScrollViewer

StackPanel
CompNodeCompNode CompNode

Button Button

1. User32 gets the message


2. Avalon converts message to an input report
3. If input report is a mouse move…
• Structural hit testing on visuals
• Geometry hit testing through
geometry data Mouse Click!
4. Convert reports into one or more events
5. For each event…
• Build event route
Step 6:
Manipulate elements
Step 7:
Goto 4
(remember, make pixels
blink)
Step 8:
Audience asks
questions
EOL
backup…
email questions
• Consider also briefly explaining the
architecture of Web Browser Applications.
There are a number of interesting
elements to it: drawing within IE but being
out-of-proc (and why so); having a simple
shim and version-specific
“PresentaionHostDLLs”; using ClickOnce
activation; and running the WBA in a
partial-trust AppDomain.
blog questions
• http://blog.simplegeek.com/commentview.aspx
blog questions continued…
• I have several questions often about scope decisions:
1) Why is the font rasterizer not avaiable to DX apps but only Avalon apps?
2) How do we get large numbers of visuals to perform? If we have 100,000
eleemnts to display in a system how do we make it perform? With an
immediate draw API I can omit drawing that is out of view or too small to be
visible. Where is there some conditionality in the visual hierarchy?
3) The current XML serializer only supports hierarchies, for general use this
needs to support graphs (connections and other graphics reference peer
visuals). Is this going to be addressed?
4) In the current beta zooming the view to a high magnification causes
visuals to disappear. This is high priority to our application. How do we get
visibility into the requirements that WPF will support in this area?
blog questions continued…
• Question 1: What's going on with the threading model in WPF? At PDC
2003 I was under the impression that it wasn't going to be as limiting as
today's Win32 UI window thread model but lately I've been hearing that the
team has scaled back their plans. Question 2: Is there still a message pump
in WPF?

• I would like to understand more about the XPS and Avalon connection and I
am hoping some architectural details on shared functionality will be
discussed.
How does XAML fit in the future as an exchangable data source for visual
representation of a drawing ? Serialization support etc.

• I'd like to know what the relationship is between Avalon and GDI+? It seems
as though Avalon follows very closely the GDI+ functionality, adding scene-
graph support. I know it's been talked about before that Avalon goes directly
to D3D... so, does Avalon and GDI+ sit side-by-side, not sharing any code?
Or does Avalon make use of GDI+ at some level.
blog questions continued…
• I'm looking forward to getting some insights into the the
message(pump?) and threading model.
1. Could you contrast the Avalon threading model with the Win32
one? And how do things change when adding COM (apartments)
into the mix?
2. Does interop with ActiveX or Windows Forms components
change Avalon messaging/threading behavior or impose limitations.
3. Why the change to the Dispatcher based design?
4. Should lengthy processing still be done on separate threads? and
if so, why? and how do I sync. callbacks to the correct thread
(contrast with win32 PostMessage/Windows Forms
Control.BeginInvoke).
blog questions continued…
• What I'd like to know is, is Avalon completely dependant on the
Win32 API? Or is Avalon only dependant on WinFX (which may
have parts dependant on Win32)?
I've heard a lot of misinformation out there; everything from
Longhorn being completely managed, to Longhorn having zero
dependencies on managed code. Which is it? Does Longhorn rely
on Avalon at all?
Also, is Avalon & Indigo (forgive me for forgetting their official bland
names) exposed to unmanaged code? If so, is there a managed
wrapper involved in calling into Avalon or Indigo APIs?

• Will the WPF support playing a managed Stream? If the Stream is


non-seekable, seeking should be disabled and if it is seekable
seeking by user should work. Or is this too hard problem?
blog questions continued…
• In what extent the XP and the Longhorn versions of Avalong are
different? What are the plans for supporting and extending the XP
version? What are the "real" hardware requirements that will allow
for running Avalon applications comfortably? What part of the
system was the hardest to implement (what part will be the
buggiest? emails of the developers working on it? :))? Can I create a
video game on Avalon? Can I create a cool game? If Steve Jobs
comes up with new and better ideas on GUI in the next Mac OS
(Tiger), how long is it going to take for Microsoft to incorporate
those? Are you working on Avalon 2.0? 3.0? What is the roadmap
for Avalon? Is backward compatibility between versions of Avalon
your number one priority? If yes, do you feel like it may hurt you
down the road (remember Win32 and some pretty ugly places
there)? For how long is Avalon here to stay (sort of continuation of
the roadmap question)?

Das könnte Ihnen auch gefallen