Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - I must be bored...CompositionTarget.Render question

 
 
Old 05-24-2006   #1 (permalink)
Brandon Furtwangler


 
 

I must be bored...CompositionTarget.Render question

While browsing though the PresentationCore code in .NET Reflector and found
this:

Note: this is a method on CompositionTarget...

void ICompositionTarget.Render(bool inResize)
{
MediaContext.From(base.Dispatcher); <<<<<<<<< ?????
if (this._rootVisual.Value != null)
{
bool flag1 = false;
if (EventTrace.IsEnabled(EventTrace.Flags.performance,
EventTrace.Level.normal))
{
flag1 = true;

EventTrace.EventProvider.TraceEvent(EventTrace.PRECOMPUTESCENEGUID, 1,
this.GetHashCode());
}
this._rootVisual.Value.PreCompute();
if (flag1)
{

EventTrace.EventProvider.TraceEvent(EventTrace.PRECOMPUTESCENEGUID, 2);
}
if (flag1)
{

EventTrace.EventProvider.TraceEvent(EventTrace.COMPILESCENEGUID, 1,
this.GetHashCode());
}
this.Compile();
if (flag1)
{

EventTrace.EventProvider.TraceEvent(EventTrace.COMPILESCENEGUID, 2);
}
}
}


Obviously I dont have comments in Reflector so there probably is a legit
reason for this method call, but from what I can tell MediaContext.From
doesn't do anything within this method. The point of MediaContext.From is to
get the MediaContext associated with the dispatcher for the current thread
but it's not assigned to a local variable, so I'm very confused.

I then thought it might be to ensure that the media context is created
(which From will do if its not already), but I ran Reflectors analyzer on it
and found that CompositionTarget.Render is only called from
MediaContext.Render. Thus MediaContext must already be created.

Looks to me like pointless code, but if it's not then I'm curious what it's
for.

Thanks

My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
So, what should I do with my Vista x64 install. I'm just bored :( General Discussion
badass port if gates gets bored. Vista General
I'm Bored Again (I Need Access To The MSDN X64 Download!), Just FYI. Vista General
I'm Bored, Could Microsoft Please Hurry Up And Release RTM on MSDN? Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46