Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Why Avalon cost so much memory?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  23 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Lei Jiang  
View profile  
 More options Dec 6 2004, 7:21 am
Newsgroups: microsoft.public.windows.developer.winfx.avalon
From: "Lei Jiang" <c...@263.net>
Date: Mon, 6 Dec 2004 20:21:29 +0800
Local: Mon, Dec 6 2004 7:21 am
Subject: Why Avalon cost so much memory?
I did a simple test just now : add 10000 ellipses and 10000 line segments to
a canvas. This simple program cost about 90MB memory!( and costs 7s)

308MB when 50000 ellipse and 50000 line segments added. (costs 43s)

Another problem is of hardware accecelating. I checked my DirectX settings
(using dxdiag.exe) and found that the DirectDraw and Direct3D is disabled on
my computer(Win2003). After I turned the hardware accecelating on and enable
the DirectDraw/Direct3D. The same test cost more time! For the first test,
it cost 12s, the second cost 70s. Is the software rendering faster than
hardware accecelating??


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Frank Hileman  
View profile  
 More options Dec 6 2004, 11:27 am
Newsgroups: microsoft.public.windows.developer.winfx.avalon
From: "Frank Hileman" <frank...@no.spamming.prodigesoftware.com>
Date: Mon, 6 Dec 2004 08:27:10 -0800
Local: Mon, Dec 6 2004 11:27 am
Subject: Re: Why Avalon cost so much memory?
To add a little perspective, you might look at the performance of a similar
system. In VG.net (a vector graphics system based on GDI+) there is a sample
called Scalability. Using version 2.3 (beta), a 1.7 GHz P4, creation time
for rectangles:

10K:   0.01 seconds
100K: 0.10 seconds

Peak memory consumption during 100% animation of every rectangle, by
constantly changing their location:

10K:   16MB
100K: 23MB

Virtual memory usage is smaller, and memory usage is lower with no
animation. Considering that the application consumed 9MB before any objects
were created, simply displaying the test control panel, I think that is
fairly efficient.

Avalon is not even in beta yet. After all the performance testing and tuning
it will probably work a bit better. But there are some fundamental low level
data structures and techniques in Avalon that look unscalable to me, so I
don't think the integrated retained mode system will be useful for CAD, GIS,
and certain types of SCADA  vector graphics.

Regards,
Frank Hileman

check out VG.net: http://www.vgdotnet.com
Animated vector graphics system
Integrated Visual Studio .NET graphics editor

"Lei Jiang" <c...@263.net> wrote in message

news:O4%23g%23342EHA.936@TK2MSFTNGP12.phx.gbl...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rob Relyea [msft]  
View profile  
 More options Dec 7 2004, 11:28 am
Newsgroups: microsoft.public.windows.developer.winfx.avalon
From: "Rob Relyea [msft]" <rrel...@online.microsoft.com>
Date: Tue, 7 Dec 2004 08:28:42 -0800
Local: Tues, Dec 7 2004 11:28 am
Subject: Re: Why Avalon cost so much memory?
Lei - Thanks for bringing this question up.

All-
Our perf team is working with Lei to get his code and to work through this
issue.
There are several ways to draw in Avalon, we need to give good descriptions
of those different techniques and give guidance as to when to use which one.

We hope to have the beginnings of that in the next week or two.

Thanks,
Rob Relyea
Avalon Team
http://longhornblogs.com/rrelyea

"Frank Hileman" <frank...@no.spamming.prodigesoftware.com> wrote in message

news:eBgQwB72EHA.1292@TK2MSFTNGP10.phx.gbl...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lei Jiang  
View profile  
 More options Dec 7 2004, 9:43 pm
Newsgroups: microsoft.public.windows.developer.winfx.avalon
From: "Lei Jiang" <c...@263.net>
Date: Wed, 8 Dec 2004 10:43:21 +0800
Local: Tues, Dec 7 2004 9:43 pm
Subject: Re: Why Avalon cost so much memory?

VG.net is great. But I beleive Avalon will do better, since it fully explore
the hardware capacity while GDI/GDi+ does not.

"Frank Hileman" <frank...@no.spamming.prodigesoftware.com> дÈëÏûÏ¢
news:eBgQwB72EHA.1292@TK2MSFTNGP10.phx.gbl...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lei Jiang  
View profile  
 More options Dec 7 2004, 9:43 pm
Newsgroups: microsoft.public.windows.developer.winfx.avalon
From: "Lei Jiang" <c...@263.net>
Date: Wed, 8 Dec 2004 10:43:52 +0800
Local: Tues, Dec 7 2004 9:43 pm
Subject: Re: Why Avalon cost so much memory?
Thanks!

"Rob Relyea [msft]" <rrel...@online.microsoft.com> дÈëÏûÏ¢
news:#7kwe4H3EHA.2788@TK2MSFTNGP15.phx.gbl...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Feng Yuan [MSFT]  
View profile  
 More options Dec 8 2004, 2:46 am
Newsgroups: microsoft.public.windows.developer.winfx.avalon
From: "Feng Yuan [MSFT]" <fy...@online.microsoft.com>
Date: Tue, 7 Dec 2004 23:46:11 -0800
Local: Wed, Dec 8 2004 2:46 am
Subject: Re: Why Avalon cost so much memory?
Canvas, which is based on UIElement, is not designed intensive graphics
application.

For intensive graphics application, you should consider operate at Visual
level, instead of UIElement level. Check for DrawingVisual, OnDemandVisual,
DrawingContext, etc.

--
Feng Yuan (www.fengyuan.com)

This posting is provided "AS IS" with no warranties, and confers no rights.

"Lei Jiang" <c...@263.net> wrote in message

news:O4%23g%23342EHA.936@TK2MSFTNGP12.phx.gbl...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lei Jiang  
View profile  
 More options Dec 8 2004, 4:39 am
Newsgroups: microsoft.public.windows.developer.winfx.avalon
From: "Lei Jiang" <c...@263.net>
Date: Wed, 8 Dec 2004 17:39:52 +0800
Local: Wed, Dec 8 2004 4:39 am
Subject: Re: Why Avalon cost so much memory?
Do Visual level objects support animation, hittest, etc?

"Feng Yuan [MSFT]" <fy...@online.microsoft.com> дÈëÏûÏ¢
news:#hrl9nP3EHA.2788@TK2MSFTNGP15.phx.gbl...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Frank Hileman  
View profile  
 More options Dec 8 2004, 9:52 am
Newsgroups: microsoft.public.windows.developer.winfx.avalon
From: "Frank Hileman" <frank...@no.spamming.prodigesoftware.com>
Date: Wed, 8 Dec 2004 06:52:21 -0800
Local: Wed, Dec 8 2004 9:52 am
Subject: Re: Why Avalon cost so much memory?
It can only do better if it does not consume massive amounts of memory per
element, and uses optimized algorithms. The rendering engine is only one
factor.

Regards,
Frank Hileman

check out VG.net: http://www.vgdotnet.com
Animated vector graphics system
Integrated Visual Studio .NET graphics editor

"Lei Jiang" <c...@263.net> wrote in message

news:ur$uM%23M3EHA.4064@tk2msftngp13.phx.gbl...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Drew Marsh  
View profile  
 More options Dec 8 2004, 12:31 pm
Newsgroups: microsoft.public.windows.developer.winfx.avalon
From: Drew Marsh <dru...@hotmail.no.spamming.com>
Date: Wed, 08 Dec 2004 09:31:22 -0800
Local: Wed, Dec 8 2004 12:31 pm
Subject: Re: Why Avalon cost so much memory?

Lei Jiang wrote:
> Do Visual level objects support animation, hittest, etc?

All LIFE[1] support is added at UIElement. That's why visuals are so much
cheaper. You should be able to animate a Visual's properties, since Visual
derives from DependencyObject, but you'll have to render the Visual yourself.
Also, Visual supports hit testing via HitTestCore and HitTestBounds, but
you don't have any nice events provided for you like you do on UIElement
(one of the major reasons it's "lighter").

HTH,
Drew

[1] See the bottom of this page: http://winfx.msdn.microsoft.com/?//winfx.msdn.microsoft.com/winfx/ref...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lei Jiang  
View profile  
 More options Dec 8 2004, 7:31 pm
Newsgroups: microsoft.public.windows.developer.winfx.avalon
From: "Lei Jiang" <c...@263.net>
Date: Thu, 9 Dec 2004 08:31:25 +0800
Local: Wed, Dec 8 2004 7:31 pm
Subject: Re: Why Avalon cost so much memory?
Thanks! I understand that Visual is much "lighter" than UIElement. Since I
have a lot of objects to be rendered to window, it seems I have to render
the Visual by myself... :-(

Could the UIElement be more lighter in Avalon? Or is there a mechanism that
support large amount of UIElement effeciently?

"Drew Marsh" <dru...@hotmail.no.spamming.com> ????
news:107437632381058868906250@msnews.microsoft.com...

http://winfx.msdn.microsoft.com/?//winfx.msdn.microsoft.com/winfx/ref...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lei Jiang  
View profile  
 More options Dec 8 2004, 7:36 pm
Newsgroups: microsoft.public.windows.developer.winfx.avalon
From: "Lei Jiang" <c...@263.net>
Date: Thu, 9 Dec 2004 08:36:08 +0800
Local: Wed, Dec 8 2004 7:36 pm
Subject: Re: Why Avalon cost so much memory?
Thanks. I will compare all the alternatives carefully.

"Frank Hileman" <frank...@no.spamming.prodigesoftware.com> дÈëÏûÏ¢
news:OjjaHWT3EHA.2592@TK2MSFTNGP09.phx.gbl...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Drew Marsh  
View profile  
 More options Dec 8 2004, 8:33 pm
Newsgroups: microsoft.public.windows.developer.winfx.avalon
From: Drew Marsh <dru...@hotmail.no.spamming.com>
Date: Wed, 08 Dec 2004 17:33:44 -0800
Local: Wed, Dec 8 2004 8:33 pm
Subject: Re: Why Avalon cost so much memory?

> Thanks! I understand that Visual is much "lighter" than UIElement.
> Since I have a lot of objects to be rendered to window, it seems I
> have to render the Visual by myself... :-(

Also, make sure you check out DrawingVisual[1]. You can simply open yourself
a DrawingContext[2] with RenderOpen[3] and go to town painting as much as
you want onto the same surface area. DrawingContext is basically the Avalon
equivalent of System.Drawing.Graphics.

> Could the UIElement be more lighter in Avalon? Or is there a mechanism
> that support large amount of UIElement effeciently?

I can't answer that one obviously, but I believe from a design standpoint
Microsoft has made the right choices in terms of the way they designed the
class Avalon class heirarchy in terms of making a distinction between a simple
graphics element (Visual) and an rich interactive element (UIElement).

Just my 2¢,
Drew

[1] http://winfx.msdn.microsoft.com/?//winfx.msdn.microsoft.com/winfx/ref...
[2] http://winfx.msdn.microsoft.com/?//winfx.msdn.microsoft.com/winfx/ref...
[3] http://winfx.msdn.microsoft.com/?//winfx.msdn.microsoft.com/winfx/ref...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Edward Wohlman  
View profile  
 More options Dec 8 2004, 9:20 pm
Newsgroups: microsoft.public.windows.developer.winfx.avalon
From: Edward Wohlman <ed...@hotpop.com>
Date: Thu, 9 Dec 2004 02:20:03 +0000
Local: Wed, Dec 8 2004 9:20 pm
Subject: Re: Why Avalon cost so much memory?
I like that. A nice way to remember it by.
Layout, Input, Focus, and Eventing
LIFE begins at UIElement

;-)

I've been thinking about and playing with this stuff for days and I
still can't get enough of it.
Great work Avalon Team.

On 2004-12-08 17:31:22 +0000, Drew Marsh <dru...@hotmail.no.spamming.com> said:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lei Jiang  
View profile  
 More options Dec 8 2004, 9:50 pm
Newsgroups: microsoft.public.windows.developer.winfx.avalon
From: "Lei Jiang" <c...@263.net>
Date: Thu, 9 Dec 2004 10:50:50 +0800
Local: Wed, Dec 8 2004 9:50 pm
Subject: Re: Why Avalon cost so much memory?
Yes, this design decision is right. The simpel graphics element should be
separated from interactive UIElement. I wish the UIElement implementation be
lighter, so I can save a lot of work :-) The Avalon team is doing a great
work!

"Drew Marsh" <dru...@hotmail.no.spamming.com> ????
news:108705632381348288750000@msnews.microsoft.com...

http://winfx.msdn.microsoft.com/?//winfx.msdn.microsoft.com/winfx/ref...
> [2]

http://winfx.msdn.microsoft.com/?//winfx.msdn.microsoft.com/winfx/ref...
> [3]

http://winfx.msdn.microsoft.com/?//winfx.msdn.microsoft.com/winfx/ref...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lei Jiang  
View profile  
 More options Dec 8 2004, 11:46 pm
Newsgroups: microsoft.public.windows.developer.winfx.avalon
From: "Lei Jiang" <c...@263.net>
Date: Thu, 9 Dec 2004 12:46:45 +0800
Local: Wed, Dec 8 2004 11:46 pm
Subject: Re: Why Avalon cost so much memory?
Yes! I'd like to know the difference between these several ways of drawing,
and the relations between them.

"Rob Relyea [msft]" <rrel...@online.microsoft.com> дÈëÏûÏ¢
news:#7kwe4H3EHA.2788@TK2MSFTNGP15.phx.gbl...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yin XIE - Microsoft Avalon Team  
View profile  
 More options Jan 10 2005, 12:45 pm
Newsgroups: microsoft.public.windows.developer.winfx.avalon
From: "Yin XIE - Microsoft Avalon Team" <yin...@gmail.com>
Date: 10 Jan 2005 09:45:49 -0800
Local: Mon, Jan 10 2005 12:45 pm
Subject: Re: Why Avalon cost so much memory?
Hi Lei,

Thank you for evaluating Avalon and looking into performance issues. We
have done an investigation on the working set and execution speed
issues. We could reproduce both issues with the code you provided to
us.

In your code, you use Line Shapes instead of drawing the lines directly
using a DrawingContext as shown in the following code.
public class MyCanvas : Canvas
{
protected override void OnRender(DrawingContext ctx)
{
Pen pen = new Pen(Brushes.Red, DrawLines.W);
for (int i = 0; i < DrawLines.N; i++)
{
ctx.DrawLine(
pen,
new Point (DrawLines.X1, DrawLines.Y1),
new Point (DrawLines.X2, DrawLines.Y2)
);

} // end of for loop
} // end of OnRender
} // end of class MyCanvas

Line shapes can not scale as well as calling DrawLines which is what
you would do using GDI+. Line shapes provide much richer
functionalities than you would ever need in your scenarios, such as
Styling, element composition, etc. I rewrote your sample using OnRender
override shown as above, the working set is about 20 Mbytes for 10000
lines and 10000 ellipses.

Regarding the speed issue, we discovered and fixed a bug which makes
the 1px line slower than wider lines. With hardware acceleration,
Avalon drawing routines scales much better than GDI+ even though there
is some initial higher fixed cost. Here is some data on the scalability
of drawing lines:

Cost per line for 1 pixel wide lines from (0,0) to (800, 600) in
microseconds
#of lines       Avalon       GDI+ AA       GDI+ default
1               N/A          7272          3575
10              4398.7       3821.6        574.3
100             505.53       3099.84       197.73
1000            55.623       3067.83       177.248
10000           29.3183      3083.0717     176.9431
100000          88.89802     3071.06664    178.76963

I would like also to point out that Avalon is doing 8X8 anti-aliasing
by default. Thus the visual quality with Avalon is much higher than any
GDI+ mode.

Happy New Year!

Yin


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Frank Hileman  
View profile  
 More options Jan 10 2005, 8:24 pm
Newsgroups: microsoft.public.windows.developer.winfx.avalon
From: "Frank Hileman" <frank...@no.spamming.prodigesoftware.com>
Date: Mon, 10 Jan 2005 17:24:54 -0800
Local: Mon, Jan 10 2005 8:24 pm
Subject: Re: Why Avalon cost so much memory?
If you have to use the DrawingContext and write your own retained mode
system, why use Avalon at all then? Does it have much more functionality
over DirectX when used this way? It seems the DrawingContext does not
support many of the drawing operations in GDI+, such as path gradients. Are
there plans to support all the GDI+ drawing operations and features?

Regards,
Frank Hileman

check out VG.net: http://www.vgdotnet.com
Animated vector graphics system
Integrated Visual Studio .NET graphics editor

"Yin XIE - Microsoft Avalon Team" <yin...@gmail.com> wrote in message
news:1105379149.352527.248650@f14g2000cwb.googlegroups.com...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lei Jiang  
View profile  
 More options Jan 16 2005, 11:33 pm
Newsgroups: microsoft.public.windows.developer.winfx.avalon
From: "Lei Jiang" <c...@263.net>
Date: Mon, 17 Jan 2005 12:33:08 +0800
Local: Sun, Jan 16 2005 11:33 pm
Subject: Re: Why Avalon cost so much memory?

Hi Yin,

Thank you for your help. However, I have to use Shapes instead of
DrawingContext. Yes, using DrawingContext would be much faster than using
Shapes, but I have to use such features as Styling, animation, etc in my
system. The code I provided to you is just a test in which I want to know
the speed of shape system.

Could the performance of Shape system be improved?

Lei

"Yin XIE - Microsoft Avalon Team" <yin...@gmail.com> ????
news:1105379149.352527.248650@f14g2000cwb.googlegroups.com...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lei Jiang  
View profile  
 More options Jan 25 2005, 10:06 pm
Newsgroups: microsoft.public.windows.developer.winfx.avalon
From: "Lei Jiang" <c...@263.net>
Date: Wed, 26 Jan 2005 11:06:04 +0800
Local: Tues, Jan 25 2005 10:06 pm
Subject: Re: Why Avalon cost so much memory?
Since you mentioned that Avalon is doing 8X8 anti-aliasing "by default",
could I configure the anti-aliasing settings to achieve a better quality? Or
lower that to achieve a better speed? What's the current settings for
GDI/GDI+?

Thanks!

"Yin XIE - Microsoft Avalon Team" <yin...@gmail.com> wrote in message
news:1105379149.352527.248650@f14g2000cwb.googlegroups.com...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Frank Hileman  
View profile  
 More options Jan 26 2005, 11:11 am
Newsgroups: microsoft.public.windows.developer.winfx.avalon
From: "Frank Hileman" <frank...@no.spamming.prodigesoftware.com>
Date: Wed, 26 Jan 2005 08:11:30 -0800
Local: Wed, Jan 26 2005 11:11 am
Subject: Re: Why Avalon cost so much memory?
The problem is, if you have 10K objects drawn with Avalon (DrawingContext),
and 10 of them change, in an optimized retained mode system (like VG.net)
only those 10, plus overlapping areas, need to be redrawn. In the
non-editable DrawingContext code, all 10K need to be redrawn. So any
performance gain over GDI+ is squandered in most cases, especially in your
type of SCADA application.

We really need an immediate-mode replacement for GDI+, not a non-editable
retained mode system, that does not support efficient style information
references. With an immediate-mode replacement truly scalable systems may be
built on top.

I imagine you will need a separate Canvas per object and then you will run
into the same kind of scalability problems Avalon has with Shapes.

Regards,
Frank Hileman

check out VG.net: http://www.vgdotnet.com
Animated vector graphics system
Integrated Visual Studio .NET graphics editor

"Lei Jiang" <c...@263.net> wrote in message

news:uFyoNV1AFHA.1404@TK2MSFTNGP11.phx.gbl...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Drew Marsh  
View profile  
 More options Jan 26 2005, 11:28 am
Newsgroups: microsoft.public.windows.developer.winfx.avalon
From: Drew Marsh <dru...@hotmail.no.spamming.com>
Date: Wed, 26 Jan 2005 08:28:55 -0800
Local: Wed, Jan 26 2005 11:28 am
Subject: Re: Why Avalon cost so much memory?

> The problem is, if you have 10K objects drawn with Avalon
> (DrawingContext), and 10 of them change, in an optimized retained mode
> system (like VG.net) only those 10, plus overlapping areas, need to be
> redrawn. In the non-editable DrawingContext code, all 10K need to be
> redrawn. So any performance gain over GDI+ is squandered in most
> cases, especially in your type of SCADA application.

> We really need an immediate-mode replacement for GDI+, not a
> non-editable retained mode system, that does not support efficient
> style information references. With an immediate-mode replacement truly
> scalable systems may be built on top.

> I imagine you will need a separate Canvas per object and then you will
> run into the same kind of scalability problems Avalon has with Shapes.

Frank,

I'm guessing you didn't see my follow up comment here[1]. I'll paste it below
for newsgroup discussion as well.

Cheers,
Drew

[1] http://blogs.officezealot.com/rod/archive/2005/01/18/3885.aspx

________________

Frank,

Well, I'm no authority on this subject so forgive me if I'm totally off base
here, but I still believe what you want is possible.

If you look at the Longhorn SDK you'll see an interface called IRetainedRender[1]
and you'll find a class called RetainedVisual[2] with a property called RenderBounds[3].
When IRetainedRender is implemented by a class, the RetainedVisual's RenderBounds
will be set to indicate what area to redraw.

Now, in the CTP drop, RetainedVisual seems to have been renamed OnDemandVisual[3].
OnDemandVisual has a RenderBounds property. What's missing though is the
marker interface IRetainedRender. So, I'm just not sure how to indicate that
you want to only be notified for partial redraws.

So, is this what you're looking for? You would maintain your 100k object
graph in whatever efficient internal form you like and only redraw the region
that has been invalidated based on whatever data in the graph represents
that area.

Anyway, like I said, if I'm totally off base here I apologize. Maybe a small
example of how you would achieve this in .NET with System.Drawing.Graphics
today would help get the point across. At this point if I'm not getting it
I'd actually love to learn more about it. :)

[1] http://longhorn.msdn.microsoft.com/?//longhorn.msdn.microsoft.com/lhs...

[2] http://longhorn.msdn.microsoft.com/?//longhorn.msdn.microsoft.com/lhs...

[3] http://longhorn.msdn.microsoft.com/?//longhorn.msdn.microsoft.com/lhs...

[4] http://winfx.msdn.microsoft.com/?//winfx.msdn.microsoft.com/winfx/ref...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Frank Hileman  
View profile  
 More options Jan 26 2005, 6:11 pm
Newsgroups: microsoft.public.windows.developer.winfx.avalon
From: "Frank Hileman" <frank...@no.spamming.prodigesoftware.com>
Date: Wed, 26 Jan 2005 15:11:08 -0800
Local: Wed, Jan 26 2005 6:11 pm
Subject: Re: Why Avalon cost so much memory?
Hello Drew,

According to the "About Avalon Memory Cost" thread in this group, the
"retained" part of a Visual is not a bitmap but a stream of low-level
rendering commands, which is not editable (see Tim Cahill reply). So this is
not an immediate-mode replacement for GDI+. If it is to be a retained mode
replacement for GDI+, it would have to be efficiently editable, and it would
need to have an efficient storage for traditional styling information
(stroke width, fill, etc), so that common styling information could be used
by reference without duplication within the command stream. This is what I
call a context-dependent rendering system.

If Visual were a bitmap buffer, a single bounds is not enough to optimize
screen updates. If two small objects, one on the upper left, and one on the
lower right, are animated, the union is the entire screen. Part of the
optimization in such a case is managing multiple invalid areas
simultaneously and batching the display. It is important both for pruning
(culling) and clipping.

Because we are talking about a non-bitmap based buffer, I believe that
bounds is irrelevant. I think it defines the area to render in its totality
and not a portion, but it is not documented.

Regards,
Frank Hileman

check out VG.net: http://www.vgdotnet.com
Animated vector graphics system
Integrated Visual Studio .NET graphics editor

"Drew Marsh" <dru...@hotmail.no.spamming.com> wrote in message

news:198407632423357398906250@msnews.microsoft.com...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Drew Marsh  
View profile  
 More options Jan 27 2005, 11:04 am
Newsgroups: microsoft.public.windows.developer.winfx.avalon
From: Drew Marsh <dru...@hotmail.no.spamming.com>
Date: Thu, 27 Jan 2005 08:04:11 -0800
Local: Thurs, Jan 27 2005 11:04 am
Subject: Re: Why Avalon cost so much memory?
Frank Hilleman

> According to the "About Avalon Memory Cost" thread in this group, the
> "retained" part of a Visual is not a bitmap but a stream of low-level
> rendering commands, which is not editable (see Tim Cahill reply).

Thanks, now I understand what you mean by rendering commands. I didn't realize
that this was the way the rendering architecture worked, but seeing as how
everything has to undergo various matrix transforms and still provide a sharp
image, it makes perfect sense it can't be bitmap based.

> So
> this is not an immediate-mode replacement for GDI+. If it is to be a
> retained mode replacement for GDI+, it would have to be efficiently
> editable, and it would need to have an efficient storage for
> traditional styling information (stroke width, fill, etc), so that
> common styling information could be used by reference without
> duplication within the command stream. This is what I call a
> context-dependent rendering system.

I think I understand now.

> If Visual were a bitmap buffer, a single bounds is not enough to
> optimize screen updates. If two small objects, one on the upper left,
> and one on the lower right, are animated, the union is the entire
> screen. Part of the optimization in such a case is managing multiple
> invalid areas simultaneously and batching the display. It is important
> both for pruning (culling) and clipping.

Sure, that makes sense, but I thought RenderBounds was intended to be used
when
you're being *told* what area to repaint (i.e. someone moved something over
you and then back off). If you need to repaint yourself because two of
your objects updated, I would imagine that you could render into any portion
of the area you wanted using whatever logic you wanted. For example, how
would you do this today as a System.Windows.Forms.Control? Wouldn't you just
Invalidate yourself and then use whatever internal logic you needed inside
of OnPaint to make sure that you only paint the areas that have changed?
Just curious... I honestly am no expert in this area and am just trying to
learn some more about it. Any detail you can provide on how you solve this
problem using pure GDI+ today would be appreciated. ;)

> Because we are talking about a non-bitmap based buffer, I believe that
> bounds is irrelevant. I think it defines the area to render in its
> totality and not a portion, but it is not documented.

Gotcha. Yeah we could definitely use some more official details on this subject.
An article like "DrawingContext De-Mystified" would be awesome.
It's fascinating to me and seems like a limitation for programs of the type
you mention if, in fact, every command stream is recreated for every Visual.

Thanks,
Drew


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google