• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Composition.DUCE类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Windows.Media.Composition.DUCE的典型用法代码示例。如果您正苦于以下问题:C# DUCE类的具体用法?C# DUCE怎么用?C# DUCE使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DUCE类属于System.Windows.Media.Composition命名空间,在下文中一共展示了DUCE类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: UpdateResourceCore

        protected override void UpdateResourceCore(DUCE.Channel channel) 
        {
            Debug.Assert(_duceResource.IsOnChannel(channel)); 
            DependencyObject dobj = ((DependencyObject) _dependencyObject.Target); 

            // The dependency object was GCed, nothing to do here 
            if (dobj == null)
            {
                return;
            } 

            Quaternion tempValue = (Quaternion)dobj.GetValue(_dependencyProperty); 
 
            DUCE.MILCMD_QUATERNIONRESOURCE data;
            data.Type = MILCMD.MilCmdQuaternionResource; 
            data.Handle = _duceResource.GetHandle(channel);
            data.Value = CompositionResourceManager.QuaternionToMilQuaternionF(tempValue);

            unsafe 
            {
                channel.SendCommand( 
                    (byte*)&data, 
                    sizeof(DUCE.MILCMD_QUATERNIONRESOURCE));
            } 
        }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:25,代码来源:QuaternionIndependentAnimationStorage.cs


示例2: CreateUCEResources

        internal override void CreateUCEResources(DUCE.Channel channel, DUCE.Channel outOfBandChannel)
        { 
            Debug.Assert(channel != null);
            Debug.Assert(outOfBandChannel != null);

            _outOfBandChannel = outOfBandChannel; 

            // create visual target resources 
            base.CreateUCEResources(channel, outOfBandChannel); 

            // Update state to propagate flags as necessary 
            StateChangedCallback(
                new object[]
                {
                    HostStateFlags.None 
                });
 
            // 
            // Addref content node on the channel. We need extra reference
            // on that node so that it does not get immediately released 
            // when Dispose is called. Actual release of the node needs
            // to be synchronized with node disconnect by the host.
            //
 
            bool resourceCreated = _contentRoot.CreateOrAddRefOnChannel(this, outOfBandChannel, s_contentRootType);
            Debug.Assert(!resourceCreated); 
            _contentRoot.CreateOrAddRefOnChannel(this, channel, s_contentRootType); 

            BeginHosting(); 
        }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:30,代码来源:VisualTarget.cs


示例3: UpdateResourceCore

        protected override void UpdateResourceCore(DUCE.Channel channel)
        {
            Debug.Assert(_duceResource.IsOnChannel(channel));
            DependencyObject dobj = ((DependencyObject) _dependencyObject.Target);

            // The dependency object was GCed, nothing to do here
            if (dobj == null)
            {
                return;
            }

            Double tempValue = (Double)dobj.GetValue(_dependencyProperty);

            DUCE.MILCMD_DOUBLERESOURCE data;
            data.Type = MILCMD.MilCmdDoubleResource;
            data.Handle = _duceResource.GetHandle(channel);
            data.Value = tempValue;

            unsafe
            {
                channel.SendCommand(
                    (byte*)&data,
                    sizeof(DUCE.MILCMD_DOUBLERESOURCE));
            }
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:25,代码来源:DoubleIndependentAnimationStorage.cs


示例4: Render

 static public void Render(
     IntPtr pRenderTarget,
     DUCE.Channel channel,
     Visual visual,
     int width,
     int height,
     double dpiX,
     double dpiY)
 {
     Render(pRenderTarget, channel, visual, width, height, dpiX, dpiY, Matrix.Identity, Rect.Empty);
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:11,代码来源:Renderer.cs


示例5: CreateUCEResources

        /// <summary>
        /// This method is used to create all uce resources either on Startup or session connect
        /// </summary>
        internal virtual void CreateUCEResources(DUCE.Channel channel, DUCE.Channel outOfBandChannel)
        {
            Debug.Assert(channel != null);
            Debug.Assert(!_contentRoot.IsOnChannel(channel));

            Debug.Assert(outOfBandChannel != null);
            Debug.Assert(!_contentRoot.IsOnChannel(outOfBandChannel));

            //
            // Create root visual on the current channel and send
            // this command out of band to ensure that composition node is
            // created by the time this visual target is available for hosting
            // and to avoid life-time issues when we are working with this node
            // from the different channels.
            //

            bool resourceCreated = _contentRoot.CreateOrAddRefOnChannel(this, outOfBandChannel, s_contentRootType);
            Debug.Assert(resourceCreated);
            _contentRoot.DuplicateHandle(outOfBandChannel, channel);
            outOfBandChannel.CloseBatch();
            outOfBandChannel.Commit();

        }
开发者ID:JianwenSun,项目名称:cc,代码行数:26,代码来源:CompositionTarget.cs


示例6: using

        /// <summary>
        /// AddRefOnChannel
        /// </summary>
        DUCE.ResourceHandle DUCE.IResource.AddRefOnChannel(DUCE.Channel channel)
        {
            // 
            using (CompositionEngineLock.Acquire())
            {
#if DEBUG
                // We assume that a multi-channel resource can only be multi-channel
                // if it is Frozen and does not have animated properties. In this case we know
                // the target resource has at least one animated property so we expect that this
                // independently animated property resource will only be added to the channel
                // associated with the MediaContext associated with the target object's Dispatcher.

                DependencyObject d = (DependencyObject)_dependencyObject.Target;

                // I'm not sure how our target animated DependencyObject would get garbage
                // collected before we call AddRefOnChannel on one of its animated property
                // resources, but if it happens it will be a bad thing.
                Debug.Assert(d != null);

                // Any animated DependencyObject must be associated with a Dispatcher because the
                // AnimationClocks doing the animating must be associated with a Dispatcher.
                Debug.Assert(d.Dispatcher != null);

                // Make sure the target belongs to this thread
                Debug.Assert(d.CheckAccess());
#endif

                if (_duceResource.CreateOrAddRefOnChannel(this, channel, ResourceType))
                {
                    _updateResourceHandler = new MediaContext.ResourcesUpdatedHandler(UpdateResource);

                    UpdateResourceCore(channel);
                }

                return _duceResource.GetHandle(channel);
            }
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:40,代码来源:IndependentAnimationStorage.cs


示例7: AddRefOnChannelAnimations

        internal virtual void AddRefOnChannelAnimations(DUCE.Channel channel)
        {
            if (IAnimatable_HasAnimatedProperties)
            {
                FrugalMap animatedPropertiesMap = AnimationStorage.GetAnimatedPropertiesMap(this);

                Debug.Assert(animatedPropertiesMap.Count > 0);

                for (int i = 0; i < animatedPropertiesMap.Count; i++)
                {
                    Int32   dpGlobalIndex;
                    Object  storageObject;

                    animatedPropertiesMap.GetKeyValuePair(i, out dpGlobalIndex, out storageObject);

                    DUCE.IResource storage = storageObject as DUCE.IResource;

                    if (storage != null)
                    {
                        storage.AddRefOnChannel(channel);
                    }
                }
            }
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:24,代码来源:Animatable.cs


示例8: AddRefOnChannelCore

        internal override DUCE.ResourceHandle AddRefOnChannelCore(DUCE.Channel channel)
        {
            if (_duceResource.CreateOrAddRefOnChannel(this, channel, DUCE.ResourceType.TYPE_BITMAPSOURCE))
            {
                UpdateResource(channel, true /* skip "on channel" check - we already know that we're on channel */ );
            }

            return _duceResource.GetHandle(channel);
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:9,代码来源:BitmapSource.cs


示例9: ReleaseOnChannelCore

        internal override void ReleaseOnChannelCore(DUCE.Channel channel)
        {
            Debug.Assert(_duceResource.IsOnChannel(channel));

            if (_duceResource.ReleaseOnChannel(channel))
            {
                ReleaseOnChannelAnimations(channel);
                
                // If we are being pulled off the asynchronous compositor channel
                // while we still have a handler hooked to the commit batch event,
                // remove the handler to avoid situations where would leak the D3DImage
                if (!channel.IsSynchronous)
                {
                    UnsubscribeFromCommittingBatch();
                }
            }
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:17,代码来源:D3DImage.cs


示例10: ReleaseOnChannelCore

        internal override void ReleaseOnChannelCore(DUCE.Channel channel)
        {

                Debug.Assert(_duceResource.IsOnChannel(channel));

                if (_duceResource.ReleaseOnChannel(channel))
                {


                    MaterialCollection vChildren = Children;

                    if (vChildren != null)
                    {
                        int count = vChildren.Count;
                        for (int i = 0; i < count; i++)
                        {
                            ((DUCE.IResource) vChildren.Internal_GetItem(i)).ReleaseOnChannel(channel);
                        }
                    }
                    ReleaseOnChannelAnimations(channel);

                }

        }
开发者ID:JianwenSun,项目名称:cc,代码行数:24,代码来源:MaterialGroup.cs


示例11: GetHandleCore

 DUCE.ResourceHandle DUCE.IResource.GetHandle(DUCE.Channel channel)
 {
     using (CompositionEngineLock.Acquire())
     {
         return GetHandleCore(channel);
     }
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:7,代码来源:BitmapSource.cs


示例12: UpdateResource

        protected override void UpdateResource(
            DUCE.ResourceHandle handle,
            DUCE.Channel channel)
        {
            DUCE.MILCMD_RECTRESOURCE cmd = new DUCE.MILCMD_RECTRESOURCE();

            cmd.Type = MILCMD.MilCmdRectResource;
            cmd.Handle = handle;
            cmd.Value = CurrentValue;

            unsafe
            {
                channel.SendCommand(
                    (byte*)&cmd,
                    sizeof(DUCE.MILCMD_RECTRESOURCE));
            }

            // Validate this resource
            IsResourceInvalid = false;
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:20,代码来源:RectAnimationClockResource.cs


示例13: AddRefOnChannelCore

        //------------------------------------------------------
        //
        //  Protected Methods
        //
        //------------------------------------------------------

        #region Protected Methods





        #endregion ProtectedMethods

        //------------------------------------------------------
        //
        //  Internal Methods
        //
        //------------------------------------------------------

        #region Internal Methods


        internal abstract DUCE.ResourceHandle AddRefOnChannelCore(DUCE.Channel channel);
开发者ID:JianwenSun,项目名称:cc,代码行数:24,代码来源:Geometry.cs


示例14: using

 void DUCE.IResource.ReleaseOnChannel(DUCE.Channel channel)
 {
     // 
     using (CompositionEngineLock.Acquire())
     {
         ReleaseOnChannelCore(channel);
     }
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:8,代码来源:BitmapSource.cs


示例15: using

        void DUCE.IResource.ReleaseOnChannel(DUCE.Channel channel)
        {
            using (CompositionEngineLock.Acquire()) 
            {
                Debug.Assert(_duceResource.IsOnChannel(channel));

                if (_duceResource.ReleaseOnChannel(channel))
                {


                    ReleaseOnChannelAnimations(channel);

                }
            }
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:15,代码来源:PixelShader.cs


示例16: UpdateResource

 internal override void UpdateResource(DUCE.Channel channel, bool skipOnChannelCheck)
 {
     ManualUpdateResource(channel, skipOnChannelCheck);
     base.UpdateResource(channel, skipOnChannelCheck);
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:5,代码来源:PixelShader.cs


示例17: GetHandleCore

 internal override DUCE.ResourceHandle GetHandleCore(DUCE.Channel channel)
 {
     // Note that we are in a lock here already.
     return _duceResource.GetHandle(channel);
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:5,代码来源:D3DImage.cs


示例18: UpdateBitmapSourceResource

        internal virtual void UpdateBitmapSourceResource(DUCE.Channel channel, bool skipOnChannelCheck)
        {
            if (_needsUpdate)
            {
                _convertedDUCEPtr = null;
                _needsUpdate = false;
            }

            // If we're told we can skip the channel check, then we must be on channel
            Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel));

            if (skipOnChannelCheck || _duceResource.IsOnChannel(channel))
            {
                // We may end up loading in the bitmap bits so it's necessary to take the [....] lock here.
                lock (_syncObject)
                {
                    channel.SendCommandBitmapSource(
                        _duceResource.GetHandle(channel),
                        DUCECompatiblePtr
                        );
                }
            }
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:23,代码来源:BitmapSource.cs


示例19: UpdateResource

        internal override void UpdateResource(DUCE.Channel channel, bool skipOnChannelCheck)
        {
            // If we're told we can skip the channel check, then we must be on channel
            Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel));

            if (skipOnChannelCheck || _duceResource.IsOnChannel(channel))
            {
                base.UpdateResource(channel, skipOnChannelCheck);

                bool isSynchronous = channel.IsSynchronous;

                DUCE.MILCMD_D3DIMAGE data;
                unsafe
                {
                    data.Type = MILCMD.MilCmdD3DImage;
                    data.Handle = _duceResource.GetHandle(channel);
                    if (_pInteropDeviceBitmap != null)
                    {
                        UnsafeNativeMethods.MILUnknown.AddRef(_pInteropDeviceBitmap);
                        
                        data.pInteropDeviceBitmap = (ulong)_pInteropDeviceBitmap.DangerousGetHandle().ToPointer();
                    }
                    else
                    {
                        data.pInteropDeviceBitmap = 0;
                    }
                    
                    data.pSoftwareBitmap = 0;

                    if (isSynchronous)
                    {
                        _softwareCopy = CopyBackBuffer();
                        
                        if (_softwareCopy != null)
                        {
                            UnsafeNativeMethods.MILUnknown.AddRef(_softwareCopy.WicSourceHandle);
                            
                            data.pSoftwareBitmap = (ulong)_softwareCopy.WicSourceHandle.DangerousGetHandle().ToPointer();
                        }
                    }

                    // Send packed command structure
                    channel.SendCommand(
                        (byte*)&data,
                        sizeof(DUCE.MILCMD_D3DIMAGE),
                        false /* sendInSeparateBatch */
                        );
                }

                // Presents only happen on the async channel so don't let RTB flip this bit
                if (!isSynchronous)
                {
                    _waitingForUpdateResourceBecauseBitmapChanged = false;
                }
            }
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:56,代码来源:D3DImage.cs


示例20: ReleaseOnChannelCore

        internal override void ReleaseOnChannelCore(DUCE.Channel channel)
        {
            Debug.Assert(_duceResource.IsOnChannel(channel));

            _duceResource.ReleaseOnChannel(channel);
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:6,代码来源:BitmapSource.cs



注:本文中的System.Windows.Media.Composition.DUCE类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Effects.DropShadowEffect类代码示例发布时间:2022-05-26
下一篇:
C# Animation.ThicknessAnimation类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap