locked
Windows.UI.Composition is fully public in Build 10586 and there have been significant changes RRS feed

  • Question

  • We are pleased to announce that as of build 10586 and SDK Version 1511 the API is now fully public and can be used with apps submitted to the store. Thanks to developer feedback, the API was changed during it's preview phase and apps created while the API in preview will need to be updated to work.
    Monday, November 30, 2015 9:33 PM
    Moderator

All replies

  • There were significant updates made to the Windows.UI.Composition API during it's preview phase thanks to feedback from developers. The table below is a summary of those changes:

    Old Preview API

    New Public API (or Noted if Removed)

    Impact

    Added to Application Manifest to allow API to run:

     

    <Capabilities>   <Capability Name="internetClient" />   <rescap:Capability Name="previewUiComposition" /> </Capabilities>

     

     

    No longer required.

    None. If you do not remove the Capability the API will still run, but this is no longer required to be manually added to your manifest

    SolidColorVisual

    Removed (use SpriteVisual with CompositionColorBrush instead).

    SpriteVisual visual= compositor.CreateSpriteVisual();

    visual.Brush = compositor.CreateColorBrush  (Colors.White);

     

    ImageVisual

    Removed (use SpriteVisual with CompositionSurfaceBrush instead)

    SpriteVisual visual= compositor.CreateSpriteVisual();

    var surface = graphicsDevice.CreateDrawingSurface(new Size(300, 50),

                           Windows.Graphics.DirectX.DirectXPixelFormat.B8G8R8A8UIntNormalized,

                                                                                                       CompositionAlphaMode.Ignore);

     

    visual.Brush = compsositor.CreateSurfaceBrush (surface);

     

     

     

    ImageVisual.HorizontalAlignmentRatio,

    ImageVisual.VerticalAlignmentRatio,

    ImageVisual.Stretch

     

    Moved to CompositionSurfaceBrush

    SpriteVisual visual= compositor.CreateSpriteVisual();

     

    var surface = graphicsDevice.CreateDrawingSurface(new Size(300, 50),

                           Windows.Graphics.DirectX.DirectXPixelFormat.B8G8R8A8UIntNormalized,

                                                                                                       CompositionAlphaMode.Ignore);

     

    var surfaceBrush = _compositor.CreateSurfaceBrush(surface);

    surfaceBrush.HorizontalAlignmentRatio = 0.0;

    surfaceBrush.VerticalAlignmentRatio= 0.0;

    surfaceBrush.Stretch = CompositionStretch.None;

     

    visual.Brush = surfaceBrush;

     

    CompositionEffect

    CompositionEffectBrush

    See EffectVisual section below

    CompsitionEffectFactory.CreateEffect()

    CompsoitionEffectFactory.CreateBrush()

    See EffectVisual section below

    CompsoitionEffect.SetSourceParameter (ICompositionSurface);

    CompositionEffectBrush.SetSourceParameter(CompositionBrush)

    See EffectVisual section below

    EffectVisual

    Removed (use SpriteVisual with CompositionEffectBrush instead)

    SpriteVisual visual= compositor.CreateSpriteVisual();

     

    var surface = graphicsDevice.CreateDrawingSurface(new Size(300, 50),

                           Windows.Graphics.DirectX.DirectXPixelFormat.B8G8R8A8UIntNormalized,

                                                                                                       CompositionAlphaMode.Ignore);

    var surfaceBrush = _compositor.CreateSurfaceBrush(surface);

     

    IGraphicsEffect graphicsEffect = new Microsoft.Graphics.Canvas.Effects.SaturationEffect

                                                   {

                                                                  Saturation = 0.0f,

                                                                  Source = new CompositionEffectSourceParameter("mySource")

                                                              };

     

    var effectFactory = _compositor.CreateEffectFactory(graphicsEffect);

    var saturationEffectBrush = effectFactory.CreateBrush();

    saturationEffectBrush.SetSourceParameter("mySource", surfaceBrush);

     

    visual.Brush = saturationEffectBrush;

     

    CompositionImage

    Removed

    Functionality associated with CompositionImage, including loading an image from a URI is being removed. This functionality will be restored via a Composition Toolkit that will ship out of band in a model similar to Win2D. It is also possible to use Wind2D to load images as well as we have added C++ only support for BeginDraw/EndDraw.

    DefaultGraphicsDevice

    Removed

    This was no longer required as it supported only CompositionImage

    RotationAngle

    Modified

    RotationAngle will be in Radians (In Preview, this was based ondegrees).

    Added Degress support: Us RotationAngleInDegrees to replace any preview property for RotationAngle and degrees will be used

    CompositionPropertyAnimator

    Removed

    ConnectAnimation([…]).Start changed to StartAnimation("Property", animation)

    DisconnectAnimation changed to StopAnimation("Property") - this will perform a stop and a disconnect.

     

    The other control: Pause has been removed completely. Will be considered again for future.

     

    Registering the EndedEvents will be done through the Batch object which will provide event notification when an animation ends. The more descriptive end event information will be removed completely. Will be considered again for furture

    IsCommitted

    IsEnded

    Just renaming

    IsOpened

    IsActive

    Just renaming

    BeginBatch()

    Removed

    Being replaced with Suspend() & Resume()

    New API

    Suspend()

    Will pause aggregating for a specific batch

    New API

    Resume()

    Will resume aggregating for a specific batch

    EndBatch()

    End()

    Once End() is called the batch can never be Suspended() or Resumed()

    CompositionBatch

    CompositionCommitBatch

    CompositionScopedBatch

    CompositionCommitBatch has the event and property getters only

    CompositionScopedBatch has the full set of APIs

    OnCompleted(CompostionBatch sender, CompositionBatchCompletedEventArgs)

    OnCompleted(object sender, CompositionBatchCompletedEventArgs)

    The first parameter to the ‘Completed’ event is now IInspectable rather than CompositionBatch

    HRESULT DCompositionRedirectMouseWheelToHwndForVisual(

        _In_ IDCompositionVisual* visual,

        _In_ HWND hwnd,

        _In_ BOOL enable)

     

    HRESULT DCompositionAttachMouseWheelToHwndForVisual(

        _In_ IDCompositionVisual* visual,

        _In_ HWND hwnd,

        _In_ BOOL enable)

     

    Renaming

     

    Monday, November 30, 2015 9:35 PM
    Moderator