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.

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

mercurial