///<summary> /// Apply a compositor. Initially, the filter is enabled. ///</summary> ///<param name="filter">Filter to apply</param> ///<param name="addPosition">Position in filter chain to insert this filter at; defaults to the end (last applied filter)</param> ///<param name="technique">Technique to use; CompositorChain::BEST (default) chooses to the best one /// available (first technique supported) ///</param> ///<param name="scheme"></param> private CompositorInstance AddCompositor(Compositor filter, int addPosition, int technique, string scheme) { filter.Touch(); CompositionTechnique tech = filter.GetSupportedTechniqueByScheme(scheme); if (tech == null) { LogManager.Instance.DefaultLog.Write("CompositorChain: Compositor " + filter.Name + " has no supported techniques."); } var t = new CompositorInstance(tech, this); if (addPosition == lastCompositor) { addPosition = this.instances.Count; } else { Debug.Assert(addPosition <= this.instances.Count, "Index out of bounds."); } this.instances.Insert(addPosition, t); this.dirty = true; this.anyCompositorsEnabled = true; return(t); }
///<summary> /// Apply a compositor. Initially, the filter is enabled. ///</summary> ///<param name="filter">Filter to apply</param> ///<param name="addPosition">Position in filter chain to insert this filter at; defaults to the end (last applied filter)</param> ///<param name="technique">Technique to use; CompositorChain::BEST (default) chooses to the best one /// available (first technique supported) ///</param> ///<param name="scheme"></param> private CompositorInstance AddCompositor( Compositor filter, int addPosition, int technique, string scheme ) { filter.Touch(); CompositionTechnique tech = filter.GetSupportedTechniqueByScheme( scheme ); if ( tech == null ) { LogManager.Instance.DefaultLog.Write( "CompositorChain: Compositor " + filter.Name + " has no supported techniques." ); } var t = new CompositorInstance( tech, this ); if ( addPosition == lastCompositor ) { addPosition = this.instances.Count; } else { Debug.Assert( addPosition <= this.instances.Count, "Index out of bounds." ); } this.instances.Insert( addPosition, t ); this.dirty = true; this.anyCompositorsEnabled = true; return t; }