gfx/2d/moz-d2d1-1.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/2d/moz-d2d1-1.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,367 @@
     1.4 +//---------------------------------------------------------------------------
     1.5 +// Copyright (c) Microsoft Corporation.  All rights reserved.
     1.6 +//
     1.7 +// This file is automatically generated.  Please do not edit it directly.
     1.8 +//
     1.9 +// File name: D2D1_1.h
    1.10 +//---------------------------------------------------------------------------
    1.11 +#pragma once
    1.12 +
    1.13 +#ifndef _D2D1_1_H_
    1.14 +#ifndef _D2D1_H_
    1.15 +#include <d2d1.h>
    1.16 +#endif // #ifndef _D2D1_H_
    1.17 +
    1.18 +//+-----------------------------------------------------------------------------
    1.19 +//
    1.20 +//  Flag:
    1.21 +//      D2D1_LAYER_OPTIONS1
    1.22 +//
    1.23 +//  Synopsis:
    1.24 +//      Specifies how the layer contents should be prepared.
    1.25 +//
    1.26 +//------------------------------------------------------------------------------
    1.27 +typedef enum D2D1_LAYER_OPTIONS1
    1.28 +{
    1.29 +        D2D1_LAYER_OPTIONS1_NONE = 0,
    1.30 +        D2D1_LAYER_OPTIONS1_INITIALIZE_FROM_BACKGROUND = 1,
    1.31 +        D2D1_LAYER_OPTIONS1_IGNORE_ALPHA = 2,
    1.32 +        D2D1_LAYER_OPTIONS1_FORCE_DWORD = 0xffffffff
    1.33 +
    1.34 +} D2D1_LAYER_OPTIONS1;
    1.35 +
    1.36 +//+-----------------------------------------------------------------------------
    1.37 +//
    1.38 +//  Struct:
    1.39 +//      D2D1_LAYER_PARAMETERS1
    1.40 +//
    1.41 +//  Synopsis:
    1.42 +//      All parameters related to pushing a layer.
    1.43 +//
    1.44 +//------------------------------------------------------------------------------
    1.45 +typedef struct D2D1_LAYER_PARAMETERS1
    1.46 +{
    1.47 +    D2D1_RECT_F contentBounds;
    1.48 +    ID2D1Geometry *geometricMask;
    1.49 +    D2D1_ANTIALIAS_MODE maskAntialiasMode;
    1.50 +    D2D1_MATRIX_3X2_F maskTransform;
    1.51 +    FLOAT opacity;
    1.52 +    ID2D1Brush *opacityBrush;
    1.53 +    D2D1_LAYER_OPTIONS1 layerOptions;
    1.54 +
    1.55 +} D2D1_LAYER_PARAMETERS1;
    1.56 +
    1.57 +DEFINE_ENUM_FLAG_OPERATORS(D2D1_LAYER_OPTIONS1);
    1.58 +
    1.59 +#ifndef DX_DECLARE_INTERFACE
    1.60 +#define DX_DECLARE_INTERFACE(x) DECLSPEC_UUID(x) DECLSPEC_NOVTABLE
    1.61 +#endif
    1.62 +
    1.63 +namespace D2D1
    1.64 +{
    1.65 +    D2D1FORCEINLINE
    1.66 +    D2D1_LAYER_PARAMETERS1
    1.67 +    LayerParameters1(
    1.68 +        CONST D2D1_RECT_F &contentBounds = D2D1::InfiniteRect(),
    1.69 +        ID2D1Geometry *geometricMask = NULL,
    1.70 +        D2D1_ANTIALIAS_MODE maskAntialiasMode = D2D1_ANTIALIAS_MODE_PER_PRIMITIVE,
    1.71 +        D2D1_MATRIX_3X2_F maskTransform = D2D1::IdentityMatrix(),
    1.72 +        FLOAT opacity = 1.0,
    1.73 +        ID2D1Brush *opacityBrush = NULL,
    1.74 +        D2D1_LAYER_OPTIONS1 layerOptions = D2D1_LAYER_OPTIONS1_NONE
    1.75 +        )
    1.76 +    {
    1.77 +        D2D1_LAYER_PARAMETERS1 layerParameters = { 0 };
    1.78 +
    1.79 +        layerParameters.contentBounds = contentBounds;
    1.80 +        layerParameters.geometricMask = geometricMask;
    1.81 +        layerParameters.maskAntialiasMode = maskAntialiasMode;
    1.82 +        layerParameters.maskTransform = maskTransform;
    1.83 +        layerParameters.opacity = opacity;
    1.84 +        layerParameters.opacityBrush = opacityBrush;
    1.85 +        layerParameters.layerOptions = layerOptions;
    1.86 +
    1.87 +        return layerParameters;
    1.88 +    }
    1.89 +}
    1.90 +
    1.91 +DEFINE_GUID(IID_ID2D1DeviceContext, 0xe8f7fe7a, 0x191c, 0x466d, 0xad, 0x95, 0x97, 0x56, 0x78, 0xbd, 0xa9, 0x98);
    1.92 +
    1.93 +//+-----------------------------------------------------------------------------
    1.94 +//
    1.95 +//  Interface:
    1.96 +//      ID2D1DeviceContext
    1.97 +//
    1.98 +//  Synopsis:
    1.99 +//      The device context represents a set of state and a command buffer that is used
   1.100 +//      to render to a target bitmap.
   1.101 +//
   1.102 +//------------------------------------------------------------------------------
   1.103 +interface DX_DECLARE_INTERFACE("e8f7fe7a-191c-466d-ad95-975678bda998") ID2D1DeviceContext  : public ID2D1RenderTarget
   1.104 +{
   1.105 +    
   1.106 +    
   1.107 +    //
   1.108 +    // Creates a bitmap with extended bitmap properties, potentially from a block of
   1.109 +    // memory.
   1.110 +    //
   1.111 +    STDMETHOD(CreateBitmap)() PURE;
   1.112 +    
   1.113 +    //
   1.114 +    // Create a D2D bitmap by copying a WIC bitmap.
   1.115 +    //
   1.116 +    STDMETHOD(CreateBitmapFromWicBitmap)() PURE;    
   1.117 +    
   1.118 +    //
   1.119 +    // Creates a color context from a color space.  If the space is Custom, the context
   1.120 +    // is initialized from the profile/profileSize arguments.  Otherwise the context is
   1.121 +    // initialized with the profile bytes associated with the space and
   1.122 +    // profile/profileSize are ignored.
   1.123 +    //
   1.124 +    STDMETHOD(CreateColorContext)() PURE;
   1.125 +    
   1.126 +    STDMETHOD(CreateColorContextFromFilename)() PURE;
   1.127 +    
   1.128 +    STDMETHOD(CreateColorContextFromWicColorContext)() PURE;
   1.129 +    
   1.130 +    
   1.131 +    //
   1.132 +    // Creates a bitmap from a DXGI surface with a set of extended properties.
   1.133 +    //
   1.134 +    STDMETHOD(CreateBitmapFromDxgiSurface)() PURE;
   1.135 +    
   1.136 +    
   1.137 +    //
   1.138 +    // Create a new effect, the effect must either be built in or previously registered
   1.139 +    // through ID2D1Factory1::RegisterEffectFromStream or
   1.140 +    // ID2D1Factory1::RegisterEffectFromString.
   1.141 +    //
   1.142 +    STDMETHOD(CreateEffect)() PURE;
   1.143 +    
   1.144 +    
   1.145 +    //
   1.146 +    // A gradient stop collection represents a set of stops in an ideal unit length.
   1.147 +    // This is the source resource for a linear gradient and radial gradient brush.
   1.148 +    //
   1.149 +    STDMETHOD(CreateGradientStopCollection)() PURE;
   1.150 +    
   1.151 +    //
   1.152 +    // Creates an image brush, the input image can be any type of image, including a
   1.153 +    // bitmap, effect and a command list.
   1.154 +    //
   1.155 +    STDMETHOD(CreateImageBrush)() PURE;
   1.156 +    
   1.157 +    STDMETHOD(CreateBitmapBrush)() PURE;
   1.158 +
   1.159 +    //
   1.160 +    // Creates a new command list.
   1.161 +    //
   1.162 +    STDMETHOD(CreateCommandList)() PURE;
   1.163 +    
   1.164 +    
   1.165 +    //
   1.166 +    // Indicates whether the format is supported by D2D.
   1.167 +    //
   1.168 +    STDMETHOD_(BOOL, IsDxgiFormatSupported)() CONST PURE;
   1.169 +    
   1.170 +    
   1.171 +    //
   1.172 +    // Indicates whether the buffer precision is supported by D2D.
   1.173 +    //
   1.174 +    STDMETHOD_(BOOL, IsBufferPrecisionSupported)() CONST PURE;
   1.175 +    
   1.176 +    
   1.177 +    //
   1.178 +    // This retrieves the local-space bounds in DIPs of the current image using the
   1.179 +    // device context DPI.
   1.180 +    //
   1.181 +    STDMETHOD(GetImageLocalBounds)() CONST PURE;
   1.182 +    
   1.183 +    
   1.184 +    //
   1.185 +    // This retrieves the world-space bounds in DIPs of the current image using the
   1.186 +    // device context DPI.
   1.187 +    //
   1.188 +    STDMETHOD(GetImageWorldBounds)() CONST PURE;
   1.189 +    
   1.190 +    
   1.191 +    //
   1.192 +    // Retrieves the world-space bounds in DIPs of the glyph run using the device
   1.193 +    // context DPI.
   1.194 +    //
   1.195 +    STDMETHOD(GetGlyphRunWorldBounds)() CONST PURE;
   1.196 +    
   1.197 +    
   1.198 +    //
   1.199 +    // Retrieves the device associated with this device context.
   1.200 +    //
   1.201 +    STDMETHOD_(void, GetDevice)() CONST PURE;
   1.202 +    
   1.203 +    
   1.204 +    //
   1.205 +    // Sets the target for this device context to point to the given image. The image
   1.206 +    // can be a command list or a bitmap created with the D2D1_BITMAP_OPTIONS_TARGET
   1.207 +    // flag.
   1.208 +    //
   1.209 +    STDMETHOD_(void, SetTarget)() PURE;
   1.210 +    
   1.211 +    
   1.212 +    //
   1.213 +    // Gets the target that this device context is currently pointing to.
   1.214 +    //
   1.215 +    STDMETHOD_(void, GetTarget)() CONST PURE;
   1.216 +    
   1.217 +    
   1.218 +    //
   1.219 +    // Sets tuning parameters for internal rendering inside the device context.
   1.220 +    //
   1.221 +    STDMETHOD_(void, SetRenderingControls)() PURE;
   1.222 +    
   1.223 +    
   1.224 +    //
   1.225 +    // This retrieves the rendering controls currently selected into the device
   1.226 +    // context.
   1.227 +    //
   1.228 +    STDMETHOD_(void, GetRenderingControls)() CONST PURE;
   1.229 +    
   1.230 +    
   1.231 +    //
   1.232 +    // Changes the primitive blending mode for all of the rendering operations.
   1.233 +    //
   1.234 +    STDMETHOD_(void, SetPrimitiveBlend)() PURE;
   1.235 +    
   1.236 +    
   1.237 +    //
   1.238 +    // Returns the primitive blend currently selected into the device context.
   1.239 +    //
   1.240 +    STDMETHOD_(void, GetPrimitiveBlend)(
   1.241 +        ) CONST PURE;
   1.242 +    
   1.243 +    
   1.244 +    //
   1.245 +    // Changes the units used for all of the rendering operations.
   1.246 +    //
   1.247 +    STDMETHOD_(void, SetUnitMode)() PURE;
   1.248 +    
   1.249 +    
   1.250 +    //
   1.251 +    // Returns the unit mode currently set on the device context.
   1.252 +    //
   1.253 +    STDMETHOD_(void, GetUnitMode)(
   1.254 +        ) CONST PURE;
   1.255 +    
   1.256 +    
   1.257 +    //
   1.258 +    // Draws the glyph run with an extended description to describe the glyphs.
   1.259 +    //
   1.260 +    STDMETHOD_(void, DrawGlyphRun)() PURE;
   1.261 +    
   1.262 +    //
   1.263 +    // Draw an image to the device context. The image represents either a concrete
   1.264 +    // bitmap or the output of an effect graph.
   1.265 +    //
   1.266 +    STDMETHOD_(void, DrawImage)() PURE;
   1.267 +    
   1.268 +    
   1.269 +    //
   1.270 +    // Draw a metafile to the device context.
   1.271 +    //
   1.272 +    STDMETHOD_(void, DrawGdiMetafile)() PURE;
   1.273 +    
   1.274 +    STDMETHOD_(void, DrawBitmap)() PURE;
   1.275 +    
   1.276 +    
   1.277 +    //
   1.278 +    // Push a layer on the device context.
   1.279 +    //
   1.280 +    STDMETHOD_(void, PushLayer)(
   1.281 +        _In_ CONST D2D1_LAYER_PARAMETERS1 *layerParameters,
   1.282 +        _In_opt_ ID2D1Layer *layer 
   1.283 +        ) PURE;
   1.284 +    
   1.285 +    using ID2D1RenderTarget::PushLayer;
   1.286 +    
   1.287 +    
   1.288 +    //
   1.289 +    // This indicates that a portion of an effect's input is invalid. This method can
   1.290 +    // be called many times.
   1.291 +    //
   1.292 +    STDMETHOD(InvalidateEffectInputRectangle)() PURE;
   1.293 +    
   1.294 +    
   1.295 +    //
   1.296 +    // Gets the number of invalid ouptut rectangles that have accumulated at the
   1.297 +    // effect.
   1.298 +    //
   1.299 +    STDMETHOD(GetEffectInvalidRectangleCount)() PURE;
   1.300 +    
   1.301 +    
   1.302 +    //
   1.303 +    // Gets the invalid rectangles that are at the output of the effect.
   1.304 +    //
   1.305 +    STDMETHOD(GetEffectInvalidRectangles)() PURE;
   1.306 +    
   1.307 +    
   1.308 +    //
   1.309 +    // Gets the maximum region of each specified input which would be used during a
   1.310 +    // subsequent rendering operation
   1.311 +    //
   1.312 +    STDMETHOD(GetEffectRequiredInputRectangles)() PURE;
   1.313 +    
   1.314 +    
   1.315 +    //
   1.316 +    // Fill using the alpha channel of the supplied opacity mask bitmap. The brush
   1.317 +    // opacity will be modulated by the mask. The render target antialiasing mode must
   1.318 +    // be set to aliased.
   1.319 +    //
   1.320 +    STDMETHOD_(void, FillOpacityMask)() PURE;
   1.321 +    
   1.322 + 
   1.323 +    HRESULT CreateBitmap1() { return S_OK; }
   1.324 +    HRESULT CreateBitmap2() { return S_OK; }
   1.325 +    HRESULT CreateBitmap3() { return S_OK; }
   1.326 +    HRESULT CreateBitmap4() { return S_OK; }
   1.327 +    
   1.328 +    HRESULT CreateImageBrush1() { return S_OK; }
   1.329 +    HRESULT CreateImageBrush2() { return S_OK; }
   1.330 +    
   1.331 +    HRESULT CreateBitmapBrush1() { return S_OK; }
   1.332 +    HRESULT CreateBitmapBrush2() { return S_OK; }
   1.333 +    HRESULT CreateBitmapBrush3() { return S_OK; }
   1.334 +
   1.335 +    //
   1.336 +    // Draws the output of the effect as an image.
   1.337 +    //
   1.338 +    void DrawImage1() {}
   1.339 +    void DrawImage2() {}
   1.340 +    void DrawImage3() {}
   1.341 +    void DrawImage4() {}
   1.342 +    void DrawImage5() {}
   1.343 +    void DrawImage6() {}
   1.344 +    void DrawImage7() {}
   1.345 +    
   1.346 +    void
   1.347 +    PushLayer(
   1.348 +        CONST D2D1_LAYER_PARAMETERS1 &layerParameters,
   1.349 +        _In_opt_ ID2D1Layer *layer 
   1.350 +        )  
   1.351 +    {
   1.352 +        PushLayer(&layerParameters, layer);
   1.353 +    }
   1.354 +    
   1.355 +    void DrawGdiMetafile1() {}
   1.356 +    
   1.357 +    void DrawBitmap1() {}
   1.358 +    void DrawBitmap2() {}
   1.359 +    void DrawBitmap3() {}
   1.360 +    
   1.361 +    void FillOpacityMask1() {}
   1.362 +    void FillOpacityMask2() {}   
   1.363 +    
   1.364 +    //
   1.365 +    // Sets tuning parameters for internal rendering inside the device context.
   1.366 +    //
   1.367 +    void SetRenderingControls1() {}
   1.368 +}; // interface ID2D1DeviceContext
   1.369 +
   1.370 +#endif // #ifndef _D2D1_1_H_

mercurial