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

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 //---------------------------------------------------------------------------
     2 // Copyright (c) Microsoft Corporation.  All rights reserved.
     3 //
     4 // This file is automatically generated.  Please do not edit it directly.
     5 //
     6 // File name: D2D1_1.h
     7 //---------------------------------------------------------------------------
     8 #pragma once
    10 #ifndef _D2D1_1_H_
    11 #ifndef _D2D1_H_
    12 #include <d2d1.h>
    13 #endif // #ifndef _D2D1_H_
    15 //+-----------------------------------------------------------------------------
    16 //
    17 //  Flag:
    18 //      D2D1_LAYER_OPTIONS1
    19 //
    20 //  Synopsis:
    21 //      Specifies how the layer contents should be prepared.
    22 //
    23 //------------------------------------------------------------------------------
    24 typedef enum D2D1_LAYER_OPTIONS1
    25 {
    26         D2D1_LAYER_OPTIONS1_NONE = 0,
    27         D2D1_LAYER_OPTIONS1_INITIALIZE_FROM_BACKGROUND = 1,
    28         D2D1_LAYER_OPTIONS1_IGNORE_ALPHA = 2,
    29         D2D1_LAYER_OPTIONS1_FORCE_DWORD = 0xffffffff
    31 } D2D1_LAYER_OPTIONS1;
    33 //+-----------------------------------------------------------------------------
    34 //
    35 //  Struct:
    36 //      D2D1_LAYER_PARAMETERS1
    37 //
    38 //  Synopsis:
    39 //      All parameters related to pushing a layer.
    40 //
    41 //------------------------------------------------------------------------------
    42 typedef struct D2D1_LAYER_PARAMETERS1
    43 {
    44     D2D1_RECT_F contentBounds;
    45     ID2D1Geometry *geometricMask;
    46     D2D1_ANTIALIAS_MODE maskAntialiasMode;
    47     D2D1_MATRIX_3X2_F maskTransform;
    48     FLOAT opacity;
    49     ID2D1Brush *opacityBrush;
    50     D2D1_LAYER_OPTIONS1 layerOptions;
    52 } D2D1_LAYER_PARAMETERS1;
    54 DEFINE_ENUM_FLAG_OPERATORS(D2D1_LAYER_OPTIONS1);
    56 #ifndef DX_DECLARE_INTERFACE
    57 #define DX_DECLARE_INTERFACE(x) DECLSPEC_UUID(x) DECLSPEC_NOVTABLE
    58 #endif
    60 namespace D2D1
    61 {
    62     D2D1FORCEINLINE
    63     D2D1_LAYER_PARAMETERS1
    64     LayerParameters1(
    65         CONST D2D1_RECT_F &contentBounds = D2D1::InfiniteRect(),
    66         ID2D1Geometry *geometricMask = NULL,
    67         D2D1_ANTIALIAS_MODE maskAntialiasMode = D2D1_ANTIALIAS_MODE_PER_PRIMITIVE,
    68         D2D1_MATRIX_3X2_F maskTransform = D2D1::IdentityMatrix(),
    69         FLOAT opacity = 1.0,
    70         ID2D1Brush *opacityBrush = NULL,
    71         D2D1_LAYER_OPTIONS1 layerOptions = D2D1_LAYER_OPTIONS1_NONE
    72         )
    73     {
    74         D2D1_LAYER_PARAMETERS1 layerParameters = { 0 };
    76         layerParameters.contentBounds = contentBounds;
    77         layerParameters.geometricMask = geometricMask;
    78         layerParameters.maskAntialiasMode = maskAntialiasMode;
    79         layerParameters.maskTransform = maskTransform;
    80         layerParameters.opacity = opacity;
    81         layerParameters.opacityBrush = opacityBrush;
    82         layerParameters.layerOptions = layerOptions;
    84         return layerParameters;
    85     }
    86 }
    88 DEFINE_GUID(IID_ID2D1DeviceContext, 0xe8f7fe7a, 0x191c, 0x466d, 0xad, 0x95, 0x97, 0x56, 0x78, 0xbd, 0xa9, 0x98);
    90 //+-----------------------------------------------------------------------------
    91 //
    92 //  Interface:
    93 //      ID2D1DeviceContext
    94 //
    95 //  Synopsis:
    96 //      The device context represents a set of state and a command buffer that is used
    97 //      to render to a target bitmap.
    98 //
    99 //------------------------------------------------------------------------------
   100 interface DX_DECLARE_INTERFACE("e8f7fe7a-191c-466d-ad95-975678bda998") ID2D1DeviceContext  : public ID2D1RenderTarget
   101 {
   104     //
   105     // Creates a bitmap with extended bitmap properties, potentially from a block of
   106     // memory.
   107     //
   108     STDMETHOD(CreateBitmap)() PURE;
   110     //
   111     // Create a D2D bitmap by copying a WIC bitmap.
   112     //
   113     STDMETHOD(CreateBitmapFromWicBitmap)() PURE;    
   115     //
   116     // Creates a color context from a color space.  If the space is Custom, the context
   117     // is initialized from the profile/profileSize arguments.  Otherwise the context is
   118     // initialized with the profile bytes associated with the space and
   119     // profile/profileSize are ignored.
   120     //
   121     STDMETHOD(CreateColorContext)() PURE;
   123     STDMETHOD(CreateColorContextFromFilename)() PURE;
   125     STDMETHOD(CreateColorContextFromWicColorContext)() PURE;
   128     //
   129     // Creates a bitmap from a DXGI surface with a set of extended properties.
   130     //
   131     STDMETHOD(CreateBitmapFromDxgiSurface)() PURE;
   134     //
   135     // Create a new effect, the effect must either be built in or previously registered
   136     // through ID2D1Factory1::RegisterEffectFromStream or
   137     // ID2D1Factory1::RegisterEffectFromString.
   138     //
   139     STDMETHOD(CreateEffect)() PURE;
   142     //
   143     // A gradient stop collection represents a set of stops in an ideal unit length.
   144     // This is the source resource for a linear gradient and radial gradient brush.
   145     //
   146     STDMETHOD(CreateGradientStopCollection)() PURE;
   148     //
   149     // Creates an image brush, the input image can be any type of image, including a
   150     // bitmap, effect and a command list.
   151     //
   152     STDMETHOD(CreateImageBrush)() PURE;
   154     STDMETHOD(CreateBitmapBrush)() PURE;
   156     //
   157     // Creates a new command list.
   158     //
   159     STDMETHOD(CreateCommandList)() PURE;
   162     //
   163     // Indicates whether the format is supported by D2D.
   164     //
   165     STDMETHOD_(BOOL, IsDxgiFormatSupported)() CONST PURE;
   168     //
   169     // Indicates whether the buffer precision is supported by D2D.
   170     //
   171     STDMETHOD_(BOOL, IsBufferPrecisionSupported)() CONST PURE;
   174     //
   175     // This retrieves the local-space bounds in DIPs of the current image using the
   176     // device context DPI.
   177     //
   178     STDMETHOD(GetImageLocalBounds)() CONST PURE;
   181     //
   182     // This retrieves the world-space bounds in DIPs of the current image using the
   183     // device context DPI.
   184     //
   185     STDMETHOD(GetImageWorldBounds)() CONST PURE;
   188     //
   189     // Retrieves the world-space bounds in DIPs of the glyph run using the device
   190     // context DPI.
   191     //
   192     STDMETHOD(GetGlyphRunWorldBounds)() CONST PURE;
   195     //
   196     // Retrieves the device associated with this device context.
   197     //
   198     STDMETHOD_(void, GetDevice)() CONST PURE;
   201     //
   202     // Sets the target for this device context to point to the given image. The image
   203     // can be a command list or a bitmap created with the D2D1_BITMAP_OPTIONS_TARGET
   204     // flag.
   205     //
   206     STDMETHOD_(void, SetTarget)() PURE;
   209     //
   210     // Gets the target that this device context is currently pointing to.
   211     //
   212     STDMETHOD_(void, GetTarget)() CONST PURE;
   215     //
   216     // Sets tuning parameters for internal rendering inside the device context.
   217     //
   218     STDMETHOD_(void, SetRenderingControls)() PURE;
   221     //
   222     // This retrieves the rendering controls currently selected into the device
   223     // context.
   224     //
   225     STDMETHOD_(void, GetRenderingControls)() CONST PURE;
   228     //
   229     // Changes the primitive blending mode for all of the rendering operations.
   230     //
   231     STDMETHOD_(void, SetPrimitiveBlend)() PURE;
   234     //
   235     // Returns the primitive blend currently selected into the device context.
   236     //
   237     STDMETHOD_(void, GetPrimitiveBlend)(
   238         ) CONST PURE;
   241     //
   242     // Changes the units used for all of the rendering operations.
   243     //
   244     STDMETHOD_(void, SetUnitMode)() PURE;
   247     //
   248     // Returns the unit mode currently set on the device context.
   249     //
   250     STDMETHOD_(void, GetUnitMode)(
   251         ) CONST PURE;
   254     //
   255     // Draws the glyph run with an extended description to describe the glyphs.
   256     //
   257     STDMETHOD_(void, DrawGlyphRun)() PURE;
   259     //
   260     // Draw an image to the device context. The image represents either a concrete
   261     // bitmap or the output of an effect graph.
   262     //
   263     STDMETHOD_(void, DrawImage)() PURE;
   266     //
   267     // Draw a metafile to the device context.
   268     //
   269     STDMETHOD_(void, DrawGdiMetafile)() PURE;
   271     STDMETHOD_(void, DrawBitmap)() PURE;
   274     //
   275     // Push a layer on the device context.
   276     //
   277     STDMETHOD_(void, PushLayer)(
   278         _In_ CONST D2D1_LAYER_PARAMETERS1 *layerParameters,
   279         _In_opt_ ID2D1Layer *layer 
   280         ) PURE;
   282     using ID2D1RenderTarget::PushLayer;
   285     //
   286     // This indicates that a portion of an effect's input is invalid. This method can
   287     // be called many times.
   288     //
   289     STDMETHOD(InvalidateEffectInputRectangle)() PURE;
   292     //
   293     // Gets the number of invalid ouptut rectangles that have accumulated at the
   294     // effect.
   295     //
   296     STDMETHOD(GetEffectInvalidRectangleCount)() PURE;
   299     //
   300     // Gets the invalid rectangles that are at the output of the effect.
   301     //
   302     STDMETHOD(GetEffectInvalidRectangles)() PURE;
   305     //
   306     // Gets the maximum region of each specified input which would be used during a
   307     // subsequent rendering operation
   308     //
   309     STDMETHOD(GetEffectRequiredInputRectangles)() PURE;
   312     //
   313     // Fill using the alpha channel of the supplied opacity mask bitmap. The brush
   314     // opacity will be modulated by the mask. The render target antialiasing mode must
   315     // be set to aliased.
   316     //
   317     STDMETHOD_(void, FillOpacityMask)() PURE;
   320     HRESULT CreateBitmap1() { return S_OK; }
   321     HRESULT CreateBitmap2() { return S_OK; }
   322     HRESULT CreateBitmap3() { return S_OK; }
   323     HRESULT CreateBitmap4() { return S_OK; }
   325     HRESULT CreateImageBrush1() { return S_OK; }
   326     HRESULT CreateImageBrush2() { return S_OK; }
   328     HRESULT CreateBitmapBrush1() { return S_OK; }
   329     HRESULT CreateBitmapBrush2() { return S_OK; }
   330     HRESULT CreateBitmapBrush3() { return S_OK; }
   332     //
   333     // Draws the output of the effect as an image.
   334     //
   335     void DrawImage1() {}
   336     void DrawImage2() {}
   337     void DrawImage3() {}
   338     void DrawImage4() {}
   339     void DrawImage5() {}
   340     void DrawImage6() {}
   341     void DrawImage7() {}
   343     void
   344     PushLayer(
   345         CONST D2D1_LAYER_PARAMETERS1 &layerParameters,
   346         _In_opt_ ID2D1Layer *layer 
   347         )  
   348     {
   349         PushLayer(&layerParameters, layer);
   350     }
   352     void DrawGdiMetafile1() {}
   354     void DrawBitmap1() {}
   355     void DrawBitmap2() {}
   356     void DrawBitmap3() {}
   358     void FillOpacityMask1() {}
   359     void FillOpacityMask2() {}   
   361     //
   362     // Sets tuning parameters for internal rendering inside the device context.
   363     //
   364     void SetRenderingControls1() {}
   365 }; // interface ID2D1DeviceContext
   367 #endif // #ifndef _D2D1_1_H_

mercurial