Other Tools

1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
* License, v. 2.0. If a copy of the MPL was not distributed with this
3
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5
/* Generated with cbindgen:0.12.0 */
6
7
/* DO NOT MODIFY THIS MANUALLY! This file was generated using cbindgen.
8
* To generate this file:
9
* 1. Get the latest cbindgen using `cargo install --force cbindgen`
10
* a. Alternatively, you can clone `https://github.com/eqrion/cbindgen` and use a tagged release
11
* 2. Run `rustup run nightly cbindgen toolkit/library/rust/ --lockfile Cargo.lock --crate webrender_bindings -o gfx/webrender_bindings/webrender_ffi_generated.h`
12
*/
13
14
#include <cstdarg>
15
#include <cstdint>
16
#include <cstdlib>
17
#include <new>
18
19
namespace mozilla {
20
namespace wr {
21
22
static const uintptr_t GlyphCache_DEFAULT_MAX_BYTES_USED = ((6 * 1024) * 1024);
23
24
/// Whether a border should be antialiased.
25
enum class AntialiasBorder {
26
No = 0,
27
Yes,
28
29
Sentinel /* this must be last for serialization purposes. */
30
};
31
32
enum class BorderStyle : uint32_t {
33
None = 0,
34
Solid = 1,
35
Double = 2,
36
Dotted = 3,
37
Dashed = 4,
38
Hidden = 5,
39
Groove = 6,
40
Ridge = 7,
41
Inset = 8,
42
Outset = 9,
43
44
Sentinel /* this must be last for serialization purposes. */
45
};
46
47
enum class BoxShadowClipMode : uint8_t {
48
Outset = 0,
49
Inset = 1,
50
51
Sentinel /* this must be last for serialization purposes. */
52
};
53
54
/// A stage of the rendering pipeline.
55
enum class Checkpoint : uint32_t {
56
///
57
SceneBuilt,
58
///
59
FrameBuilt,
60
///
61
FrameTexturesUpdated,
62
///
63
FrameRendered,
64
/// NotificationRequests get notified with this if they get dropped without having been
65
/// notified. This provides the guarantee that if a request is created it will get notified.
66
TransactionDropped,
67
68
Sentinel /* this must be last for serialization purposes. */
69
};
70
71
enum class ClipMode {
72
Clip,
73
ClipOut,
74
75
Sentinel /* this must be last for serialization purposes. */
76
};
77
78
/// Specifies the color depth of an image. Currently only used for YUV images.
79
enum class ColorDepth : uint8_t {
80
/// 8 bits image (most common)
81
Color8,
82
/// 10 bits image
83
Color10,
84
/// 12 bits image
85
Color12,
86
/// 16 bits image
87
Color16,
88
89
Sentinel /* this must be last for serialization purposes. */
90
};
91
92
enum class ColorRange : uint8_t {
93
Limited = 0,
94
Full = 1,
95
96
Sentinel /* this must be last for serialization purposes. */
97
};
98
99
enum class ComponentTransferFuncType : uint8_t {
100
Identity = 0,
101
Table = 1,
102
Discrete = 2,
103
Linear = 3,
104
Gamma = 4,
105
106
Sentinel /* this must be last for serialization purposes. */
107
};
108
109
enum class ExtendMode : uint8_t {
110
Clamp,
111
Repeat,
112
113
Sentinel /* this must be last for serialization purposes. */
114
};
115
116
#if !(defined(XP_MACOSX) || defined(XP_WIN))
117
enum class FontHinting : uint8_t {
118
None,
119
Mono,
120
Light,
121
Normal,
122
LCD,
123
124
Sentinel /* this must be last for serialization purposes. */
125
};
126
#endif
127
128
#if !(defined(XP_MACOSX) || defined(XP_WIN))
129
enum class FontLCDFilter : uint8_t {
130
None,
131
Default,
132
Light,
133
Legacy,
134
135
Sentinel /* this must be last for serialization purposes. */
136
};
137
#endif
138
139
enum class FontRenderMode : uint8_t {
140
Mono = 0,
141
Alpha,
142
Subpixel,
143
144
Sentinel /* this must be last for serialization purposes. */
145
};
146
147
/// Specifies the format of a series of pixels, in driver terms.
148
enum class ImageFormat : uint8_t {
149
/// One-channel, byte storage. The "red" doesn't map to the color
150
/// red per se, and is just the way that OpenGL has historically referred
151
/// to single-channel buffers.
152
R8 = 1,
153
/// One-channel, short storage
154
R16 = 2,
155
/// Four channels, byte storage.
156
BGRA8 = 3,
157
/// Four channels, float storage.
158
RGBAF32 = 4,
159
/// Two-channels, byte storage. Similar to `R8`, this just means
160
/// "two channels" rather than "red and green".
161
RG8 = 5,
162
/// Two-channels, byte storage. Similar to `R16`, this just means
163
/// "two channels" rather than "red and green".
164
RG16 = 6,
165
/// Four channels, signed integer storage.
166
RGBAI32 = 7,
167
/// Four channels, byte storage.
168
RGBA8 = 8,
169
170
Sentinel /* this must be last for serialization purposes. */
171
};
172
173
enum class ImageRendering : uint8_t {
174
Auto = 0,
175
CrispEdges = 1,
176
Pixelated = 2,
177
178
Sentinel /* this must be last for serialization purposes. */
179
};
180
181
enum class LineOrientation : uint8_t {
182
Vertical,
183
Horizontal,
184
185
Sentinel /* this must be last for serialization purposes. */
186
};
187
188
enum class LineStyle : uint8_t {
189
Solid,
190
Dotted,
191
Dashed,
192
Wavy,
193
194
Sentinel /* this must be last for serialization purposes. */
195
};
196
197
enum class MixBlendMode : uint8_t {
198
Normal = 0,
199
Multiply = 1,
200
Screen = 2,
201
Overlay = 3,
202
Darken = 4,
203
Lighten = 5,
204
ColorDodge = 6,
205
ColorBurn = 7,
206
HardLight = 8,
207
SoftLight = 9,
208
Difference = 10,
209
Exclusion = 11,
210
Hue = 12,
211
Saturation = 13,
212
Color = 14,
213
Luminosity = 15,
214
215
Sentinel /* this must be last for serialization purposes. */
216
};
217
218
/// Used to indicate if an image is opaque, or has an alpha channel.
219
enum class OpacityType : uint8_t {
220
Opaque = 0,
221
HasAlphaChannel = 1,
222
223
Sentinel /* this must be last for serialization purposes. */
224
};
225
226
enum class RepeatMode : uint8_t {
227
Stretch,
228
Repeat,
229
Round,
230
Space,
231
232
Sentinel /* this must be last for serialization purposes. */
233
};
234
235
enum class TelemetryProbe {
236
SceneBuildTime = 0,
237
SceneSwapTime = 1,
238
FrameBuildTime = 2,
239
240
Sentinel /* this must be last for serialization purposes. */
241
};
242
243
/// Specifies the type of texture target in driver terms.
244
enum class TextureTarget : uint8_t {
245
/// Standard texture. This maps to GL_TEXTURE_2D in OpenGL.
246
Default = 0,
247
/// Array texture. This maps to GL_TEXTURE_2D_ARRAY in OpenGL. See
249
/// on Array textures.
250
Array = 1,
251
/// Rectangle texture. This maps to GL_TEXTURE_RECTANGLE in OpenGL. This
252
/// is similar to a standard texture, with a few subtle differences
253
/// (no mipmaps, non-power-of-two dimensions, different coordinate space)
254
/// that make it useful for representing the kinds of textures we use
256
/// for background on Rectangle textures.
257
Rect = 2,
258
/// External texture. This maps to GL_TEXTURE_EXTERNAL_OES in OpenGL, which
259
/// is an extension. This is used for image formats that OpenGL doesn't
260
/// understand, particularly YUV. See
262
External = 3,
263
264
Sentinel /* this must be last for serialization purposes. */
265
};
266
267
enum class TransformStyle : uint8_t {
268
Flat = 0,
269
Preserve3D = 1,
270
271
Sentinel /* this must be last for serialization purposes. */
272
};
273
274
enum class WrAnimationType : uint32_t {
275
Transform = 0,
276
Opacity = 1,
277
278
Sentinel /* this must be last for serialization purposes. */
279
};
280
281
enum class WrExternalImageType : uint32_t {
282
RawData,
283
NativeTexture,
284
Invalid,
285
286
Sentinel /* this must be last for serialization purposes. */
287
};
288
289
enum class WrReferenceFrameKind : uint8_t {
290
Transform,
291
Perspective,
292
293
Sentinel /* this must be last for serialization purposes. */
294
};
295
296
enum class YuvColorSpace : uint8_t {
297
Rec601 = 0,
298
Rec709 = 1,
299
Rec2020 = 2,
300
301
Sentinel /* this must be last for serialization purposes. */
302
};
303
304
template<typename T>
305
struct Arc;
306
307
/// Features of the batch that, if not requested, may allow a fast-path.
308
///
309
/// Rather than breaking batches when primitives request different features,
310
/// we always request the minimum amount of features to satisfy all items in
311
/// the batch.
312
/// The goal is to let the renderer be optionally select more specialized
313
/// versions of a shader if the batch doesn't require code certain code paths.
314
/// Not all shaders necessarily implement all of these features.
315
struct BatchFeatures;
316
317
/// A set of flags describing why a picture may need a backing surface.
318
struct BlitReason;
319
320
/// Flags that define how the common brush shader
321
/// code should process this instance.
322
struct BrushFlags;
323
324
/// Bit flags for WR stages to store in a capture.
325
struct CaptureBits;
326
327
/// Mask for clearing caches in debug commands.
328
struct ClearCache;
329
330
struct ClipNodeFlags;
331
332
/// A set of flags describing why a picture may need a backing surface.
333
struct ClusterFlags;
334
335
struct Device;
336
337
/// Geometry in the coordinate system of the render target (screen or intermediate
338
/// surface) in physical pixels.
339
struct DevicePixel;
340
341
struct DocumentHandle;
342
343
/// Each bit of the edge AA mask is:
344
/// 0, when the edge of the primitive needs to be considered for AA
345
/// 1, when the edge of the segment needs to be considered for AA
346
///
347
/// *Note*: the bit values have to match the shader logic in
348
/// `write_transform_vertex()` function.
349
struct EdgeAaSegmentMask;
350
351
///
352
struct HitTestFlags;
353
354
/// Various flags that are part of an image descriptor.
355
struct ImageDescriptorFlags;
356
357
struct ItemFlags;
358
359
/// Geometry in a stacking context's local coordinate space (logical pixels).
360
struct LayoutPixel;
361
362
/// The renderer is responsible for submitting to the GPU the work prepared by the
363
/// RenderBackend.
364
///
365
/// We have a separate `Renderer` instance for each instance of WebRender (generally
366
/// one per OS window), and all instances share the same thread.
367
struct Renderer;
368
369
/// Flags that control how shaders are pre-cached, if at all.
370
struct ShaderPrecacheFlags;
371
372
struct TextureFlags;
373
374
/// Unit for tile coordinates.
375
struct TileCoordinate;
376
377
/// Represents the work associated to a transaction before scene building.
378
struct Transaction;
379
380
template<typename T>
381
struct Vec;
382
383
/// Geometry in the document's coordinate space (logical pixels).
384
struct WorldPixel;
385
386
struct WrProgramCache;
387
388
struct WrShaders;
389
390
struct WrState;
391
392
struct WrThreadPool;
393
394
/// ID namespaces uniquely identify different users of WebRender's API.
395
///
396
/// For example in Gecko each content process uses a separate id namespace.
397
struct IdNamespace {
398
uint32_t mHandle;
399
400
bool operator==(const IdNamespace& aOther) const {
401
return mHandle == aOther.mHandle;
402
}
403
bool operator!=(const IdNamespace& aOther) const {
404
return mHandle != aOther.mHandle;
405
}
406
bool operator<(const IdNamespace& aOther) const {
407
return mHandle < aOther.mHandle;
408
}
409
bool operator<=(const IdNamespace& aOther) const {
410
return mHandle <= aOther.mHandle;
411
}
412
};
413
414
struct FontInstanceKey {
415
IdNamespace mNamespace;
416
uint32_t mHandle;
417
418
bool operator==(const FontInstanceKey& aOther) const {
419
return mNamespace == aOther.mNamespace &&
420
mHandle == aOther.mHandle;
421
}
422
};
423
424
using WrFontInstanceKey = FontInstanceKey;
425
426
struct FontKey {
427
IdNamespace mNamespace;
428
uint32_t mHandle;
429
430
bool operator==(const FontKey& aOther) const {
431
return mNamespace == aOther.mNamespace &&
432
mHandle == aOther.mHandle;
433
}
434
};
435
436
using WrFontKey = FontKey;
437
438
struct FontInstanceFlags {
439
uint32_t bits;
440
441
explicit operator bool() const {
442
return !!bits;
443
}
444
FontInstanceFlags operator~() const {
445
return {static_cast<decltype(bits)>(~bits)};
446
}
447
FontInstanceFlags operator|(const FontInstanceFlags& aOther) const {
448
return {static_cast<decltype(bits)>(this->bits | aOther.bits)};
449
}
450
FontInstanceFlags& operator|=(const FontInstanceFlags& aOther) {
451
*this = (*this | aOther);
452
return *this;
453
}
454
FontInstanceFlags operator&(const FontInstanceFlags& aOther) const {
455
return {static_cast<decltype(bits)>(this->bits & aOther.bits)};
456
}
457
FontInstanceFlags& operator&=(const FontInstanceFlags& aOther) {
458
*this = (*this & aOther);
459
return *this;
460
}
461
FontInstanceFlags operator^(const FontInstanceFlags& aOther) const {
462
return {static_cast<decltype(bits)>(this->bits ^ aOther.bits)};
463
}
464
FontInstanceFlags& operator^=(const FontInstanceFlags& aOther) {
465
*this = (*this ^ aOther);
466
return *this;
467
}
468
bool operator==(const FontInstanceFlags& aOther) const {
469
return bits == aOther.bits;
470
}
471
static const FontInstanceFlags SYNTHETIC_BOLD;
472
static const FontInstanceFlags EMBEDDED_BITMAPS;
473
static const FontInstanceFlags SUBPIXEL_BGR;
474
static const FontInstanceFlags TRANSPOSE;
475
static const FontInstanceFlags FLIP_X;
476
static const FontInstanceFlags FLIP_Y;
477
static const FontInstanceFlags SUBPIXEL_POSITION;
478
static const FontInstanceFlags FORCE_GDI;
479
static const FontInstanceFlags FORCE_SYMMETRIC;
480
static const FontInstanceFlags NO_SYMMETRIC;
481
static const FontInstanceFlags FONT_SMOOTHING;
482
static const FontInstanceFlags FORCE_AUTOHINT;
483
static const FontInstanceFlags NO_AUTOHINT;
484
static const FontInstanceFlags VERTICAL_LAYOUT;
485
static const FontInstanceFlags LCD_VERTICAL;
486
};
487
inline const FontInstanceFlags FontInstanceFlags::SYNTHETIC_BOLD = FontInstanceFlags{ /* .bits = */ (1 << 1) };
488
inline const FontInstanceFlags FontInstanceFlags::EMBEDDED_BITMAPS = FontInstanceFlags{ /* .bits = */ (1 << 2) };
489
inline const FontInstanceFlags FontInstanceFlags::SUBPIXEL_BGR = FontInstanceFlags{ /* .bits = */ (1 << 3) };
490
inline const FontInstanceFlags FontInstanceFlags::TRANSPOSE = FontInstanceFlags{ /* .bits = */ (1 << 4) };
491
inline const FontInstanceFlags FontInstanceFlags::FLIP_X = FontInstanceFlags{ /* .bits = */ (1 << 5) };
492
inline const FontInstanceFlags FontInstanceFlags::FLIP_Y = FontInstanceFlags{ /* .bits = */ (1 << 6) };
493
inline const FontInstanceFlags FontInstanceFlags::SUBPIXEL_POSITION = FontInstanceFlags{ /* .bits = */ (1 << 7) };
494
inline const FontInstanceFlags FontInstanceFlags::FORCE_GDI = FontInstanceFlags{ /* .bits = */ (1 << 16) };
495
inline const FontInstanceFlags FontInstanceFlags::FORCE_SYMMETRIC = FontInstanceFlags{ /* .bits = */ (1 << 17) };
496
inline const FontInstanceFlags FontInstanceFlags::NO_SYMMETRIC = FontInstanceFlags{ /* .bits = */ (1 << 18) };
497
inline const FontInstanceFlags FontInstanceFlags::FONT_SMOOTHING = FontInstanceFlags{ /* .bits = */ (1 << 16) };
498
inline const FontInstanceFlags FontInstanceFlags::FORCE_AUTOHINT = FontInstanceFlags{ /* .bits = */ (1 << 16) };
499
inline const FontInstanceFlags FontInstanceFlags::NO_AUTOHINT = FontInstanceFlags{ /* .bits = */ (1 << 17) };
500
inline const FontInstanceFlags FontInstanceFlags::VERTICAL_LAYOUT = FontInstanceFlags{ /* .bits = */ (1 << 18) };
501
inline const FontInstanceFlags FontInstanceFlags::LCD_VERTICAL = FontInstanceFlags{ /* .bits = */ (1 << 19) };
502
503
/// Represents RGBA screen colors with one byte per channel.
504
///
505
/// If the alpha value `a` is 255 the color is opaque.
506
struct ColorU {
507
uint8_t r;
508
uint8_t g;
509
uint8_t b;
510
uint8_t a;
511
512
bool operator==(const ColorU& aOther) const {
513
return r == aOther.r &&
514
g == aOther.g &&
515
b == aOther.b &&
516
a == aOther.a;
517
}
518
};
519
520
struct SyntheticItalics {
521
int16_t angle;
522
523
bool operator==(const SyntheticItalics& aOther) const {
524
return angle == aOther.angle;
525
}
526
static const float ANGLE_SCALE;
527
};
528
inline const float SyntheticItalics::ANGLE_SCALE = 256.0;
529
530
struct FontInstanceOptions {
531
FontRenderMode render_mode;
532
FontInstanceFlags flags;
533
/// When bg_color.a is != 0 and render_mode is FontRenderMode::Subpixel,
534
/// the text will be rendered with bg_color.r/g/b as an opaque estimated
535
/// background color.
536
ColorU bg_color;
537
SyntheticItalics synthetic_italics;
538
539
bool operator==(const FontInstanceOptions& aOther) const {
540
return render_mode == aOther.render_mode &&
541
flags == aOther.flags &&
542
bg_color == aOther.bg_color &&
543
synthetic_italics == aOther.synthetic_italics;
544
}
545
};
546
547
#if defined(XP_WIN)
548
struct FontInstancePlatformOptions {
549
uint16_t gamma;
550
uint8_t contrast;
551
uint8_t cleartype_level;
552
553
bool operator==(const FontInstancePlatformOptions& aOther) const {
554
return gamma == aOther.gamma &&
555
contrast == aOther.contrast &&
556
cleartype_level == aOther.cleartype_level;
557
}
558
};
559
#endif
560
561
#if defined(XP_MACOSX)
562
struct FontInstancePlatformOptions {
563
uint32_t unused;
564
565
bool operator==(const FontInstancePlatformOptions& aOther) const {
566
return unused == aOther.unused;
567
}
568
};
569
#endif
570
571
#if !(defined(XP_MACOSX) || defined(XP_WIN))
572
struct FontInstancePlatformOptions {
573
FontLCDFilter lcd_filter;
574
FontHinting hinting;
575
576
bool operator==(const FontInstancePlatformOptions& aOther) const {
577
return lcd_filter == aOther.lcd_filter &&
578
hinting == aOther.hinting;
579
}
580
};
581
#endif
582
583
struct FontVariation {
584
uint32_t tag;
585
float value;
586
587
bool operator==(const FontVariation& aOther) const {
588
return tag == aOther.tag &&
589
value == aOther.value;
590
}
591
};
592
593
using VecU8 = Vec<uint8_t>;
594
595
using ArcVecU8 = Arc<VecU8>;
596
597
using WrIdNamespace = IdNamespace;
598
599
struct WrWindowId {
600
uint64_t mHandle;
601
602
bool operator==(const WrWindowId& aOther) const {
603
return mHandle == aOther.mHandle;
604
}
605
bool operator<(const WrWindowId& aOther) const {
606
return mHandle < aOther.mHandle;
607
}
608
bool operator<=(const WrWindowId& aOther) const {
609
return mHandle <= aOther.mHandle;
610
}
611
};
612
613
/// This type carries no valuable semantics for WR. However, it reflects the fact that
614
/// clients (Servo) may generate pipelines by different semi-independent sources.
615
/// These pipelines still belong to the same `IdNamespace` and the same `DocumentId`.
616
/// Having this extra Id field enables them to generate `PipelineId` without collision.
617
using PipelineSourceId = uint32_t;
618
619
/// From the point of view of WR, `PipelineId` is completely opaque and generic as long as
620
/// it's clonable, serializable, comparable, and hashable.
621
struct PipelineId {
622
PipelineSourceId mNamespace;
623
uint32_t mHandle;
624
625
bool operator==(const PipelineId& aOther) const {
626
return mNamespace == aOther.mNamespace &&
627
mHandle == aOther.mHandle;
628
}
629
};
630
631
using WrPipelineId = PipelineId;
632
633
/// A key uniquely identifying a WebRender document.
634
///
635
/// Instances can manage one or several documents (using the same render backend thread).
636
/// Each document will internally correspond to a single scene, and scenes are made of
637
/// one or several pipelines.
638
struct DocumentId {
639
///
640
IdNamespace mNamespace;
641
///
642
uint32_t mHandle;
643
644
bool operator==(const DocumentId& aOther) const {
645
return mNamespace == aOther.mNamespace &&
646
mHandle == aOther.mHandle;
647
}
648
};
649
650
using WrDocumentId = DocumentId;
651
652
/// An epoch identifies the state of a pipeline in time.
653
///
654
/// This is mostly used as a synchronization mechanism to observe how/when particular pipeline
655
/// updates propagate through WebRender and are applied at various stages.
656
struct Epoch {
657
uint32_t mHandle;
658
659
bool operator==(const Epoch& aOther) const {
660
return mHandle == aOther.mHandle;
661
}
662
bool operator!=(const Epoch& aOther) const {
663
return mHandle != aOther.mHandle;
664
}
665
bool operator<(const Epoch& aOther) const {
666
return mHandle < aOther.mHandle;
667
}
668
bool operator<=(const Epoch& aOther) const {
669
return mHandle <= aOther.mHandle;
670
}
671
};
672
673
using WrEpoch = Epoch;
674
675
struct WrPipelineEpoch {
676
WrPipelineId pipeline_id;
677
WrDocumentId document_id;
678
WrEpoch epoch;
679
680
bool operator==(const WrPipelineEpoch& aOther) const {
681
return pipeline_id == aOther.pipeline_id &&
682
document_id == aOther.document_id &&
683
epoch == aOther.epoch;
684
}
685
};
686
687
template<typename T>
688
struct FfiVec {
689
const T *data;
690
uintptr_t length;
691
uintptr_t capacity;
692
693
bool operator==(const FfiVec& aOther) const {
694
return data == aOther.data &&
695
length == aOther.length &&
696
capacity == aOther.capacity;
697
}
698
};
699
700
struct WrRemovedPipeline {
701
WrPipelineId pipeline_id;
702
WrDocumentId document_id;
703
704
bool operator==(const WrRemovedPipeline& aOther) const {
705
return pipeline_id == aOther.pipeline_id &&
706
document_id == aOther.document_id;
707
}
708
};
709
710
struct WrPipelineInfo {
711
FfiVec<WrPipelineEpoch> epochs;
712
FfiVec<WrRemovedPipeline> removed_pipelines;
713
714
bool operator==(const WrPipelineInfo& aOther) const {
715
return epochs == aOther.epochs &&
716
removed_pipelines == aOther.removed_pipelines;
717
}
718
};
719
720
/// Memory report for interning-related data structures.
721
struct InterningMemoryReport {
722
///
723
InternerSubReport interners;
724
///
725
InternerSubReport data_stores;
726
};
727
728
/// Collection of heap sizes, in bytes.
729
struct MemoryReport {
730
uintptr_t clip_stores;
731
uintptr_t gpu_cache_metadata;
732
uintptr_t gpu_cache_cpu_mirror;
733
uintptr_t render_tasks;
734
uintptr_t hit_testers;
735
uintptr_t fonts;
736
uintptr_t images;
737
uintptr_t rasterized_blobs;
738
uintptr_t shader_cache;
739
InterningMemoryReport interning;
740
uintptr_t gpu_cache_textures;
741
uintptr_t vertex_data_textures;
742
uintptr_t render_target_textures;
743
uintptr_t texture_cache_textures;
744
uintptr_t depth_target_textures;
745
uintptr_t swap_chain;
746
};
747
748
/// A 2d size tagged with a unit.
749
template<typename T, typename U>
750
struct Size2D {
751
T width;
752
T height;
753
754
bool operator==(const Size2D& aOther) const {
755
return width == aOther.width &&
756
height == aOther.height;
757
}
758
};
759
760
using DeviceIntSize = Size2D<int32_t, DevicePixel>;
761
762
using LayoutSize = Size2D<float, LayoutPixel>;
763
764
/// Describes the memory layout of a display list.
765
///
766
/// A display list consists of some number of display list items, followed by a number of display
767
/// items.
768
struct BuiltDisplayListDescriptor {
769
/// The first IPC time stamp: before any work has been done
770
uint64_t builder_start_time;
771
/// The second IPC time stamp: after serialization
772
uint64_t builder_finish_time;
773
/// The third IPC time stamp: just before sending
774
uint64_t send_start_time;
775
/// The amount of clipping nodes created while building this display list.
776
uintptr_t total_clip_nodes;
777
/// The amount of spatial nodes created while building this display list.
778
uintptr_t total_spatial_nodes;
779
780
bool operator==(const BuiltDisplayListDescriptor& aOther) const {
781
return builder_start_time == aOther.builder_start_time &&
782
builder_finish_time == aOther.builder_finish_time &&
783
send_start_time == aOther.send_start_time &&
784
total_clip_nodes == aOther.total_clip_nodes &&
785
total_spatial_nodes == aOther.total_spatial_nodes;
786
}
787
};
788
789
struct WrVecU8 {
790
uint8_t *data;
791
uintptr_t length;
792
uintptr_t capacity;
793
794
bool operator==(const WrVecU8& aOther) const {
795
return data == aOther.data &&
796
length == aOther.length &&
797
capacity == aOther.capacity;
798
}
799
};
800
801
/// A 2d Point tagged with a unit.
802
template<typename T, typename U>
803
struct Point2D {
804
T x;
805
T y;
806
807
bool operator==(const Point2D& aOther) const {
808
return x == aOther.x &&
809
y == aOther.y;
810
}
811
};
812
813
using WorldPoint = Point2D<float, WorldPixel>;
814
815
/// Flags to enable/disable various builtin debugging tools.
816
struct DebugFlags {
817
uint32_t bits;
818
819
explicit operator bool() const {
820
return !!bits;
821
}
822
DebugFlags operator~() const {
823
return {static_cast<decltype(bits)>(~bits)};
824
}
825
DebugFlags operator|(const DebugFlags& aOther) const {
826
return {static_cast<decltype(bits)>(this->bits | aOther.bits)};
827
}
828
DebugFlags& operator|=(const DebugFlags& aOther) {
829
*this = (*this | aOther);
830
return *this;
831
}
832
DebugFlags operator&(const DebugFlags& aOther) const {
833
return {static_cast<decltype(bits)>(this->bits & aOther.bits)};
834
}
835
DebugFlags& operator&=(const DebugFlags& aOther) {
836
*this = (*this & aOther);
837
return *this;
838
}
839
DebugFlags operator^(const DebugFlags& aOther) const {
840
return {static_cast<decltype(bits)>(this->bits ^ aOther.bits)};
841
}
842
DebugFlags& operator^=(const DebugFlags& aOther) {
843
*this = (*this ^ aOther);
844
return *this;
845
}
846
bool operator==(const DebugFlags& aOther) const {
847
return bits == aOther.bits;
848
}
849
static const DebugFlags PROFILER_DBG;
850
static const DebugFlags RENDER_TARGET_DBG;
851
static const DebugFlags TEXTURE_CACHE_DBG;
852
static const DebugFlags GPU_TIME_QUERIES;
853
static const DebugFlags GPU_SAMPLE_QUERIES;
854
static const DebugFlags DISABLE_BATCHING;
855
static const DebugFlags EPOCHS;
856
static const DebugFlags COMPACT_PROFILER;
857
static const DebugFlags ECHO_DRIVER_MESSAGES;
858
static const DebugFlags NEW_FRAME_INDICATOR;
859
static const DebugFlags NEW_SCENE_INDICATOR;
860
static const DebugFlags SHOW_OVERDRAW;
861
static const DebugFlags GPU_CACHE_DBG;
862
static const DebugFlags SLOW_FRAME_INDICATOR;
863
static const DebugFlags TEXTURE_CACHE_DBG_CLEAR_EVICTED;
864
static const DebugFlags PICTURE_CACHING_DBG;
865
static const DebugFlags PRIMITIVE_DBG;
866
static const DebugFlags ZOOM_DBG;
867
static const DebugFlags SMALL_SCREEN;
868
static const DebugFlags DISABLE_OPAQUE_PASS;
869
static const DebugFlags DISABLE_ALPHA_PASS;
870
static const DebugFlags DISABLE_CLIP_MASKS;
871
static const DebugFlags DISABLE_TEXT_PRIMS;
872
static const DebugFlags DISABLE_GRADIENT_PRIMS;
873
static const DebugFlags OBSCURE_IMAGES;
874
static const DebugFlags GLYPH_FLASHING;
875
static const DebugFlags SMART_PROFILER;
876
static const DebugFlags DISABLE_PICTURE_CACHING;
877
static const DebugFlags INVALIDATION_DBG;
878
static const DebugFlags TILE_CACHE_LOGGING_DBG;
879
};
880
inline const DebugFlags DebugFlags::PROFILER_DBG = DebugFlags{ /* .bits = */ (1 << 0) };
881
inline const DebugFlags DebugFlags::RENDER_TARGET_DBG = DebugFlags{ /* .bits = */ (1 << 1) };
882
inline const DebugFlags DebugFlags::TEXTURE_CACHE_DBG = DebugFlags{ /* .bits = */ (1 << 2) };
883
inline const DebugFlags DebugFlags::GPU_TIME_QUERIES = DebugFlags{ /* .bits = */ (1 << 3) };
884
inline const DebugFlags DebugFlags::GPU_SAMPLE_QUERIES = DebugFlags{ /* .bits = */ (1 << 4) };
885
inline const DebugFlags DebugFlags::DISABLE_BATCHING = DebugFlags{ /* .bits = */ (1 << 5) };
886
inline const DebugFlags DebugFlags::EPOCHS = DebugFlags{ /* .bits = */ (1 << 6) };
887
inline const DebugFlags DebugFlags::COMPACT_PROFILER = DebugFlags{ /* .bits = */ (1 << 7) };
888
inline const DebugFlags DebugFlags::ECHO_DRIVER_MESSAGES = DebugFlags{ /* .bits = */ (1 << 8) };
889
inline const DebugFlags DebugFlags::NEW_FRAME_INDICATOR = DebugFlags{ /* .bits = */ (1 << 9) };
890
inline const DebugFlags DebugFlags::NEW_SCENE_INDICATOR = DebugFlags{ /* .bits = */ (1 << 10) };
891
inline const DebugFlags DebugFlags::SHOW_OVERDRAW = DebugFlags{ /* .bits = */ (1 << 11) };
892
inline const DebugFlags DebugFlags::GPU_CACHE_DBG = DebugFlags{ /* .bits = */ (1 << 12) };
893
inline const DebugFlags DebugFlags::SLOW_FRAME_INDICATOR = DebugFlags{ /* .bits = */ (1 << 13) };
894
inline const DebugFlags DebugFlags::TEXTURE_CACHE_DBG_CLEAR_EVICTED = DebugFlags{ /* .bits = */ (1 << 14) };
895
inline const DebugFlags DebugFlags::PICTURE_CACHING_DBG = DebugFlags{ /* .bits = */ (1 << 15) };
896
inline const DebugFlags DebugFlags::PRIMITIVE_DBG = DebugFlags{ /* .bits = */ (1 << 16) };
897
inline const DebugFlags DebugFlags::ZOOM_DBG = DebugFlags{ /* .bits = */ (1 << 17) };
898
inline const DebugFlags DebugFlags::SMALL_SCREEN = DebugFlags{ /* .bits = */ (1 << 18) };
899
inline const DebugFlags DebugFlags::DISABLE_OPAQUE_PASS = DebugFlags{ /* .bits = */ (1 << 19) };
900
inline const DebugFlags DebugFlags::DISABLE_ALPHA_PASS = DebugFlags{ /* .bits = */ (1 << 20) };
901
inline const DebugFlags DebugFlags::DISABLE_CLIP_MASKS = DebugFlags{ /* .bits = */ (1 << 21) };
902
inline const DebugFlags DebugFlags::DISABLE_TEXT_PRIMS = DebugFlags{ /* .bits = */ (1 << 22) };
903
inline const DebugFlags DebugFlags::DISABLE_GRADIENT_PRIMS = DebugFlags{ /* .bits = */ (1 << 23) };
904
inline const DebugFlags DebugFlags::OBSCURE_IMAGES = DebugFlags{ /* .bits = */ (1 << 24) };
905
inline const DebugFlags DebugFlags::GLYPH_FLASHING = DebugFlags{ /* .bits = */ (1 << 25) };
906
inline const DebugFlags DebugFlags::SMART_PROFILER = DebugFlags{ /* .bits = */ (1 << 26) };
907
inline const DebugFlags DebugFlags::DISABLE_PICTURE_CACHING = DebugFlags{ /* .bits = */ (1 << 27) };
908
inline const DebugFlags DebugFlags::INVALIDATION_DBG = DebugFlags{ /* .bits = */ (1 << 28) };
909
inline const DebugFlags DebugFlags::TILE_CACHE_LOGGING_DBG = DebugFlags{ /* .bits = */ (1 << 29) };
910
911
/// An arbitrary identifier for a native (OS compositor) surface
912
struct NativeSurfaceId {
913
uint64_t _0;
914
915
bool operator==(const NativeSurfaceId& aOther) const {
916
return _0 == aOther._0;
917
}
918
};
919
920
using DeviceIntPoint = Point2D<int32_t, DevicePixel>;
921
922
/// A 2d Rectangle optionally tagged with a unit.
923
template<typename T, typename U>
924
struct Rect {
925
Point2D<T, U> origin;
926
Size2D<T, U> size;
927
928
bool operator==(const Rect& aOther) const {
929
return origin == aOther.origin &&
930
size == aOther.size;
931
}
932
};
933
934
using DeviceIntRect = Rect<int32_t, DevicePixel>;
935
936
struct NativeTileId {
937
NativeSurfaceId surface_id;
938
int32_t x;
939
int32_t y;
940
941
bool operator==(const NativeTileId& aOther) const {
942
return surface_id == aOther.surface_id &&
943
x == aOther.x &&
944
y == aOther.y;
945
}
946
};
947
948
struct WrClipId {
949
uintptr_t id;
950
951
bool operator==(const WrClipId& aOther) const {
952
return id == aOther.id;
953
}
954
};
955
956
struct WrSpatialId {
957
uintptr_t id;
958
959
bool operator==(const WrSpatialId& aOther) const {
960
return id == aOther.id;
961
}
962
};
963
964
struct WrSpaceAndClip {
965
WrSpatialId space;
966
WrClipId clip;
967
968
bool operator==(const WrSpaceAndClip& aOther) const {
969
return space == aOther.space &&
970
clip == aOther.clip;
971
}
972
};
973
974
using LayoutRect = Rect<float, LayoutPixel>;
975
976
struct BorderRadius {
977
LayoutSize top_left;
978
LayoutSize top_right;
979
LayoutSize bottom_left;
980
LayoutSize bottom_right;
981
982
bool operator==(const BorderRadius& aOther) const {
983
return top_left == aOther.top_left &&
984
top_right == aOther.top_right &&
985
bottom_left == aOther.bottom_left &&
986
bottom_right == aOther.bottom_right;
987
}
988
};
989
990
struct ComplexClipRegion {
991
/// The boundaries of the rectangle.
992
LayoutRect rect;
993
/// Border radii of this rectangle.
994
BorderRadius radii;
995
/// Whether we are clipping inside or outside
996
/// the region.
997
ClipMode mode;
998
999
bool operator==(const ComplexClipRegion& aOther) const {
1000
return rect == aOther.rect &&
1001
radii == aOther.radii &&
1002
mode == aOther.mode;
1003
}
1004
};
1005
1006
/// An opaque identifier describing an image registered with WebRender.
1007
/// This is used as a handle to reference images, and is used as the
1008
/// hash map key for the actual image storage in the `ResourceCache`.
1009
struct ImageKey {
1010
IdNamespace mNamespace;
1011
uint32_t mHandle;
1012
1013
bool operator==(const ImageKey& aOther) const {
1014
return mNamespace == aOther.mNamespace &&
1015
mHandle == aOther.mHandle;
1016
}
1017
bool operator!=(const ImageKey& aOther) const {
1018
return mNamespace != aOther.mNamespace ||
1019
mHandle != aOther.mHandle;
1020
}
1021
};
1022
1023
struct ImageMask {
1024
ImageKey image;
1025
LayoutRect rect;
1026
bool repeat;
1027
1028
bool operator==(const ImageMask& aOther) const {
1029
return image == aOther.image &&
1030
rect == aOther.rect &&
1031
repeat == aOther.repeat;
1032
}
1033
};
1034
1035
struct WrSpaceAndClipChain {
1036
WrSpatialId space;
1037
uint64_t clip_chain;
1038
1039
bool operator==(const WrSpaceAndClipChain& aOther) const {
1040
return space == aOther.space &&
1041
clip_chain == aOther.clip_chain;
1042
}
1043
};
1044
1045
using LayoutPoint = Point2D<float, LayoutPixel>;
1046
1047
/// The minimum and maximum allowable offset for a sticky frame in a single dimension.
1048
struct StickyOffsetBounds {
1049
/// The minimum offset for this frame, typically a negative value, which specifies how
1050
/// far in the negative direction the sticky frame can offset its contents in this
1051
/// dimension.
1052
float min;
1053
/// The maximum offset for this frame, typically a positive value, which specifies how
1054
/// far in the positive direction the sticky frame can offset its contents in this
1055
/// dimension.
1056
float max;
1057
1058
bool operator==(const StickyOffsetBounds& aOther) const {
1059
return min == aOther.min &&
1060
max == aOther.max;
1061
}
1062
};
1063
1064
/// A 2d Vector tagged with a unit.
1065
template<typename T, typename U>
1066
struct Vector2D {
1067
T x;
1068
T y;
1069
1070
bool operator==(const Vector2D& aOther) const {
1071
return x == aOther.x &&
1072
y == aOther.y;
1073
}
1074
};
1075
1076
using LayoutVector2D = Vector2D<float, LayoutPixel>;
1077
1078
/// A key to identify an animated property binding.
1079
struct PropertyBindingId {
1080
IdNamespace namespace_;
1081
uint32_t uid;
1082
1083
bool operator==(const PropertyBindingId& aOther) const {
1084
return namespace_ == aOther.namespace_ &&
1085
uid == aOther.uid;
1086
}
1087
};
1088
1089
/// A unique key that is used for connecting animated property
1090
/// values to bindings in the display list.
1091
template<typename T>
1092
struct PropertyBindingKey {
1093
///
1094
PropertyBindingId id;
1095
1096
bool operator==(const PropertyBindingKey& aOther) const {
1097
return id == aOther.id;
1098
}
1099
};
1100
1101
/// A binding property can either be a specific value
1102
/// (the normal, non-animated case) or point to a binding location
1103
/// to fetch the current value from.
1104
/// Note that Binding has also a non-animated value, the value is
1105
/// used for the case where the animation is still in-delay phase
1106
/// (i.e. the animation doesn't produce any animation values).
1107
template<typename T>
1108
struct PropertyBinding {
1109
enum class Tag {
1110
/// Non-animated value.
1111
Value,
1112
/// Animated binding.
1113
Binding,
1114
1115
Sentinel /* this must be last for serialization purposes. */
1116
};
1117
1118
struct Value_Body {
1119
T _0;
1120
1121
bool operator==(const Value_Body& aOther) const {
1122
return _0 == aOther._0;
1123
}
1124
};
1125
1126
struct Binding_Body {
1127
PropertyBindingKey<T> _0;
1128
T _1;
1129
1130
bool operator==(const Binding_Body& aOther) const {
1131
return _0 == aOther._0 &&
1132
_1 == aOther._1;
1133
}
1134
};
1135
1136
Tag tag;
1137
union {
1138
Value_Body value;
1139
Binding_Body binding;
1140
};
1141
1142
static PropertyBinding Value(const T &a0) {
1143
PropertyBinding result;
1144
::new (&result.value._0) (T)(a0);
1145
result.tag = Tag::Value;
1146
return result;
1147
}
1148
1149
static PropertyBinding Binding(const PropertyBindingKey<T> &a0,
1150
const T &a1) {
1151
PropertyBinding result;
1152
::new (&result.binding._0) (PropertyBindingKey<T>)(a0);
1153
::new (&result.binding._1) (T)(a1);
1154
result.tag = Tag::Binding;
1155
return result;
1156
}
1157
1158
bool IsValue() const {
1159
return tag == Tag::Value;
1160
}
1161
1162
bool IsBinding() const {
1163
return tag == Tag::Binding;
1164
}
1165
1166
bool operator==(const PropertyBinding& aOther) const {
1167
if (tag != aOther.tag) {
1168
return false;
1169
}
1170
switch (tag) {
1171
case Tag::Value: return value == aOther.value;
1172
case Tag::Binding: return binding == aOther.binding;
1173
default: return true;
1174
}
1175
}
1176
};
1177
1178
/// Represents RGBA screen colors with floating point numbers.
1179
///
1180
/// All components must be between 0.0 and 1.0.
1181
/// An alpha value of 1.0 is opaque while 0.0 is fully transparent.
1182
struct ColorF {
1183
float r;
1184
float g;
1185
float b;
1186
float a;
1187
1188
bool operator==(const ColorF& aOther) const {
1189
return r == aOther.r &&
1190
g == aOther.g &&
1191
b == aOther.b &&
1192
a == aOther.a;
1193
}
1194
static const ColorF BLACK;
1195
static const ColorF TRANSPARENT;
1196
static const ColorF WHITE;
1197
};
1198
inline const ColorF ColorF::BLACK = ColorF{ /* .r = */ 0.0, /* .g = */ 0.0, /* .b = */ 0.0, /* .a = */ 1.0 };
1199
inline const ColorF ColorF::TRANSPARENT = ColorF{ /* .r = */ 0.0, /* .g = */ 0.0, /* .b = */ 0.0, /* .a = */ 0.0 };
1200
inline const ColorF ColorF::WHITE = ColorF{ /* .r = */ 1.0, /* .g = */ 1.0, /* .b = */ 1.0, /* .a = */ 1.0 };
1201
1202
struct Shadow {
1203
LayoutVector2D offset;
1204
ColorF color;
1205
float blur_radius;
1206
1207
bool operator==(const Shadow& aOther) const {
1208
return offset == aOther.offset &&
1209
color == aOther.color &&
1210
blur_radius == aOther.blur_radius;
1211
}
1212
};
1213
1214
/// CSS filter.
1215
struct FilterOp {
1216
enum class Tag {
1217
/// Filter that does no transformation of the colors, needed for
1218
/// debug purposes only.
1219
Identity,
1220
Blur,
1221
Brightness,
1222
Contrast,
1223
Grayscale,
1224
HueRotate,
1225
Invert,
1226
Opacity,
1227
Saturate,
1228
Sepia,
1229
DropShadow,
1230
ColorMatrix,
1231
SrgbToLinear,
1232
LinearToSrgb,
1233
ComponentTransfer,
1234
Flood,
1235
1236
Sentinel /* this must be last for serialization purposes. */
1237
};
1238
1239
struct Blur_Body {
1240
float _0;
1241
1242
bool operator==(const Blur_Body& aOther) const {
1243
return _0 == aOther._0;
1244
}
1245
};
1246
1247
struct Brightness_Body {
1248
float _0;
1249
1250
bool operator==(const Brightness_Body& aOther) const {
1251
return _0 == aOther._0;
1252
}
1253
};
1254
1255
struct Contrast_Body {
1256
float _0;
1257
1258
bool operator==(const Contrast_Body& aOther) const {
1259
return _0 == aOther._0;
1260
}
1261
};
1262
1263
struct Grayscale_Body {
1264
float _0;
1265
1266
bool operator==(const Grayscale_Body& aOther) const {
1267
return _0 == aOther._0;
1268
}
1269
};
1270
1271
struct HueRotate_Body {
1272
float _0;
1273
1274
bool operator==(const HueRotate_Body& aOther) const {
1275
return _0 == aOther._0;
1276
}
1277
};
1278
1279
struct Invert_Body {
1280
float _0;
1281
1282
bool operator==(const Invert_Body& aOther) const {
1283
return _0 == aOther._0;
1284
}
1285
};
1286
1287
struct Opacity_Body {
1288
PropertyBinding<float> _0;
1289
float _1;
1290
1291
bool operator==(const Opacity_Body& aOther) const {
1292
return _0 == aOther._0 &&
1293
_1 == aOther._1;
1294
}
1295
};
1296
1297
struct Saturate_Body {
1298
float _0;
1299
1300
bool operator==(const Saturate_Body& aOther) const {
1301
return _0 == aOther._0;
1302
}
1303
};
1304
1305
struct Sepia_Body {
1306
float _0;
1307
1308
bool operator==(const Sepia_Body& aOther) const {
1309
return _0 == aOther._0;
1310
}
1311
};
1312
1313
struct DropShadow_Body {
1314
Shadow _0;
1315
1316
bool operator==(const DropShadow_Body& aOther) const {
1317
return _0 == aOther._0;
1318
}
1319
};
1320
1321
struct ColorMatrix_Body {
1322
float _0[20];
1323
};
1324
1325
struct Flood_Body {
1326
ColorF _0;
1327
1328
bool operator==(const Flood_Body& aOther) const {
1329
return _0 == aOther._0;
1330
}
1331
};
1332
1333
Tag tag;
1334
union {
1335
Blur_Body blur;
1336
Brightness_Body brightness;
1337
Contrast_Body contrast;
1338
Grayscale_Body grayscale;
1339
HueRotate_Body hue_rotate;
1340
Invert_Body invert;
1341
Opacity_Body opacity;
1342
Saturate_Body saturate;
1343
Sepia_Body sepia;
1344
DropShadow_Body drop_shadow;
1345
ColorMatrix_Body color_matrix;
1346
Flood_Body flood;
1347
};
1348
1349
static FilterOp Identity() {
1350
FilterOp result;
1351
result.tag = Tag::Identity;
1352
return result;
1353
}
1354
1355
static FilterOp Blur(const float &a0) {
1356
FilterOp result;
1357
::new (&result.blur._0) (float)(a0);
1358
result.tag = Tag::Blur;
1359
return result;
1360
}
1361
1362
static FilterOp Brightness(const float &a0) {
1363
FilterOp result;
1364
::new (&result.brightness._0) (float)(a0);
1365
result.tag = Tag::Brightness;
1366
return result;
1367
}
1368
1369
static FilterOp Contrast(const float &a0) {
1370
FilterOp result;
1371
::new (&result.contrast._0) (float)(a0);
1372
result.tag = Tag::Contrast;
1373
return result;
1374
}
1375
1376
static FilterOp Grayscale(const float &a0) {
1377
FilterOp result;
1378
::new (&result.grayscale._0) (float)(a0);
1379
result.tag = Tag::Grayscale;
1380
return result;
1381
}
1382
1383
static FilterOp HueRotate(const float &a0) {
1384
FilterOp result;
1385
::new (&result.hue_rotate._0) (float)(a0);
1386
result.tag = Tag::HueRotate;
1387
return result;
1388
}
1389
1390
static FilterOp Invert(const float &a0) {
1391
FilterOp result;
1392
::new (&result.invert._0) (float)(a0);
1393
result.tag = Tag::Invert;
1394
return result;
1395
}
1396
1397
static FilterOp Opacity(const PropertyBinding<float> &a0,
1398
const float &a1) {
1399
FilterOp result;
1400
::new (&result.opacity._0) (PropertyBinding<float>)(a0);
1401
::new (&result.opacity._1) (float)(a1);
1402
result.tag = Tag::Opacity;
1403
return result;
1404
}
1405
1406
static FilterOp Saturate(const float &a0) {
1407
FilterOp result;
1408
::new (&result.saturate._0) (float)(a0);
1409
result.tag = Tag::Saturate;
1410
return result;
1411
}
1412
1413
static FilterOp Sepia(const float &a0) {
1414
FilterOp result;
1415
::new (&result.sepia._0) (float)(a0);
1416
result.tag = Tag::Sepia;
1417
return result;
1418
}
1419
1420
static FilterOp DropShadow(const Shadow &a0) {
1421
FilterOp result;
1422
::new (&result.drop_shadow._0) (Shadow)(a0);
1423
result.tag = Tag::DropShadow;
1424
return result;
1425
}
1426
1427
static FilterOp ColorMatrix(const float (&a0)[20]) {
1428
FilterOp result;
1429
for (int i = 0; i < 20; i++) {
1430
::new (&result.color_matrix._0[i]) (float)(a0[i]);
1431
}
1432
result.tag = Tag::ColorMatrix;
1433
return result;
1434
}
1435
1436
static FilterOp SrgbToLinear() {
1437
FilterOp result;
1438
result.tag = Tag::SrgbToLinear;
1439
return result;
1440
}
1441
1442
static FilterOp LinearToSrgb() {
1443
FilterOp result;
1444
result.tag = Tag::LinearToSrgb;
1445
return result;
1446
}
1447
1448
static FilterOp ComponentTransfer() {
1449
FilterOp result;
1450
result.tag = Tag::ComponentTransfer;
1451
return result;
1452
}
1453
1454
static FilterOp Flood(const ColorF &a0) {
1455
FilterOp result;
1456
::new (&result.flood._0) (ColorF)(a0);
1457
result.tag = Tag::Flood;
1458
return result;
1459
}
1460
1461
bool IsIdentity() const {
1462
return tag == Tag::Identity;
1463
}
1464
1465
bool IsBlur() const {
1466
return tag == Tag::Blur;
1467
}
1468
1469
bool IsBrightness() const {
1470
return tag == Tag::Brightness;
1471
}
1472
1473
bool IsContrast() const {
1474
return tag == Tag::Contrast;
1475
}
1476
1477
bool IsGrayscale() const {
1478
return tag == Tag::Grayscale;
1479
}
1480
1481
bool IsHueRotate() const {
1482
return tag == Tag::HueRotate;
1483
}
1484
1485
bool IsInvert() const {
1486
return tag == Tag::Invert;
1487
}
1488
1489
bool IsOpacity() const {
1490
return tag == Tag::Opacity;
1491
}
1492
1493
bool IsSaturate() const {
1494
return tag == Tag::Saturate;
1495
}
1496
1497
bool IsSepia() const {
1498
return tag == Tag::Sepia;
1499
}
1500
1501
bool IsDropShadow() const {
1502
return tag == Tag::DropShadow;
1503
}
1504
1505
bool IsColorMatrix() const {
1506
return tag == Tag::ColorMatrix;
1507
}
1508
1509
bool IsSrgbToLinear() const {
1510
return tag == Tag::SrgbToLinear;
1511
}
1512
1513
bool IsLinearToSrgb() const {
1514
return tag == Tag::LinearToSrgb;
1515
}
1516
1517
bool IsComponentTransfer() const {
1518
return tag == Tag::ComponentTransfer;
1519
}
1520
1521
bool IsFlood() const {
1522
return tag == Tag::Flood;
1523
}
1524
};
1525
1526
struct WrFilterData {
1527
ComponentTransferFuncType funcR_type;
1528
float *R_values;
1529
uintptr_t R_values_count;
1530
ComponentTransferFuncType funcG_type;
1531
float *G_values;
1532
uintptr_t G_values_count;
1533
ComponentTransferFuncType funcB_type;
1534
float *B_values;
1535
uintptr_t B_values_count;
1536
ComponentTransferFuncType funcA_type;
1537
float *A_values;
1538
uintptr_t A_values_count;
1539
1540
bool operator==(const WrFilterData& aOther) const {
1541
return funcR_type == aOther.funcR_type &&
1542
R_values == aOther.R_values &&
1543
R_values_count == aOther.R_values_count &&
1544
funcG_type == aOther.funcG_type &&
1545
G_values == aOther.G_values &&
1546
G_values_count == aOther.G_values_count &&
1547
funcB_type == aOther.funcB_type &&
1548
B_values == aOther.B_values &&
1549
B_values_count == aOther.B_values_count &&
1550
funcA_type == aOther.funcA_type &&
1551
A_values == aOther.A_values &&
1552
A_values_count == aOther.A_values_count;
1553
}
1554
};
1555
1556
/// A group of 2D side offsets, which correspond to top/left/bottom/right for borders, padding,
1557
/// and margins in CSS, optionally tagged with a unit.
1558
template<typename T, typename U>
1559
struct SideOffsets2D {
1560
T top;
1561
T right;
1562
T bottom;
1563
T left;
1564
1565
bool operator==(const SideOffsets2D& aOther) const {
1566
return top == aOther.top &&
1567
right == aOther.right &&
1568
bottom == aOther.bottom &&
1569
left == aOther.left;
1570
}
1571
};
1572
1573
using LayoutSideOffsets = SideOffsets2D<float, LayoutPixel>;
1574
1575
struct BorderSide {
1576
ColorF color;
1577
BorderStyle style;
1578
1579
bool operator==(const BorderSide& aOther) const {
1580
return color == aOther.color &&
1581
style == aOther.style;
1582
}
1583
};
1584
1585
using DeviceIntSideOffsets = SideOffsets2D<int32_t, DevicePixel>;
1586
1587
struct GradientStop {
1588
float offset;
1589
ColorF color;
1590
1591
bool operator==(const GradientStop& aOther) const {
1592
return offset == aOther.offset &&
1593
color == aOther.color;
1594
}
1595
};
1596
1597
using WrImageKey = ImageKey;
1598
1599
struct WrBorderImage {
1600
LayoutSideOffsets widths;
1601
WrImageKey image;
1602
int32_t width;
1603
int32_t height;
1604
bool fill;
1605
DeviceIntSideOffsets slice;
1606
LayoutSideOffsets outset;
1607
RepeatMode repeat_horizontal;
1608
RepeatMode repeat_vertical;
1609
1610
bool operator==(const WrBorderImage& aOther) const {
1611
return widths == aOther.widths &&
1612
image == aOther.image &&
1613
width == aOther.width &&
1614
height == aOther.height &&
1615
fill == aOther.fill &&
1616
slice == aOther.slice &&
1617
outset == aOther.outset &&
1618
repeat_horizontal == aOther.repeat_horizontal &&
1619
repeat_vertical == aOther.repeat_vertical;
1620
}
1621
};
1622
1623
struct WrStackingContextClip {
1624
enum class Tag {
1625
None,
1626
ClipId,
1627
ClipChain,
1628
1629
Sentinel /* this must be last for serialization purposes. */
1630
};
1631
1632
struct ClipId_Body {
1633
WrClipId _0;
1634
1635
bool operator==(const ClipId_Body& aOther) const {
1636
return _0 == aOther._0;
1637
}
1638
};
1639
1640
struct ClipChain_Body {
1641
uint64_t _0;
1642
1643
bool operator==(const ClipChain_Body& aOther) const {
1644
return _0 == aOther._0;
1645
}
1646
};
1647
1648
Tag tag;
1649
union {
1650
ClipId_Body clip_id;
1651
ClipChain_Body clip_chain;
1652
};
1653
1654
static WrStackingContextClip None() {
1655
WrStackingContextClip result;
1656
result.tag = Tag::None;
1657
return result;
1658
}
1659
1660
static WrStackingContextClip ClipId(const WrClipId &a0) {
1661
WrStackingContextClip result;
1662
::new (&result.clip_id._0) (WrClipId)(a0);
1663
result.tag = Tag::ClipId;
1664
return result;
1665
}
1666
1667
static WrStackingContextClip ClipChain(const uint64_t &a0) {
1668
WrStackingContextClip result;
1669
::new (&result.clip_chain._0) (uint64_t)(a0);
1670
result.tag = Tag::ClipChain;
1671
return result;
1672
}
1673
1674
bool IsNone() const {
1675
return tag == Tag::None;
1676
}
1677
1678
bool IsClipId() const {
1679
return tag == Tag::ClipId;
1680
}
1681
1682
bool IsClipChain() const {
1683
return tag == Tag::ClipChain;
1684
}
1685
1686
bool operator==(const WrStackingContextClip& aOther) const {
1687
if (tag != aOther.tag) {
1688
return false;
1689
}
1690
switch (tag) {
1691
case Tag::ClipId: return clip_id == aOther.clip_id;
1692
case Tag::ClipChain: return clip_chain == aOther.clip_chain;
1693
default: return true;
1694
}
1695
}
1696
};
1697
1698
struct WrAnimationProperty {
1699
WrAnimationType effect_type;
1700
uint64_t id;
1701
1702
bool operator==(const WrAnimationProperty& aOther) const {
1703
return effect_type == aOther.effect_type &&
1704
id == aOther.id;
1705
}
1706
};
1707
1708
struct PrimitiveFlags {
1709
uint8_t bits;
1710
1711
explicit operator bool() const {
1712
return !!bits;
1713
}
1714
PrimitiveFlags operator~() const {
1715
return {static_cast<decltype(bits)>(~bits)};
1716
}
1717
PrimitiveFlags operator|(const PrimitiveFlags& aOther) const {
1718
return {static_cast<decltype(bits)>(this->bits | aOther.bits)};
1719
}
1720
PrimitiveFlags& operator|=(const PrimitiveFlags& aOther) {
1721
*this = (*this | aOther);
1722
return *this;
1723
}
1724
PrimitiveFlags operator&(const PrimitiveFlags& aOther) const {
1725
return {static_cast<decltype(bits)>(this->bits & aOther.bits)};
1726
}
1727
PrimitiveFlags& operator&=(const PrimitiveFlags& aOther) {
1728
*this = (*this & aOther);
1729
return *this;
1730
}
1731
PrimitiveFlags operator^(const PrimitiveFlags& aOther) const {
1732
return {static_cast<decltype(bits)>(this->bits ^ aOther.bits)};
1733
}
1734
PrimitiveFlags& operator^=(const PrimitiveFlags& aOther) {
1735
*this = (*this ^ aOther);
1736
return *this;
1737
}
1738
bool operator==(const PrimitiveFlags& aOther) const {
1739
return bits == aOther.bits;
1740
}
1741
static const PrimitiveFlags IS_BACKFACE_VISIBLE;
1742
static const PrimitiveFlags IS_SCROLLBAR_CONTAINER;
1743
static const PrimitiveFlags IS_SCROLLBAR_THUMB;
1744
};
1745
inline const PrimitiveFlags PrimitiveFlags::IS_BACKFACE_VISIBLE = PrimitiveFlags{ /* .bits = */ (1 << 0) };
1746
inline const PrimitiveFlags PrimitiveFlags::IS_SCROLLBAR_CONTAINER = PrimitiveFlags{ /* .bits = */ (1 << 1) };
1747
inline const PrimitiveFlags PrimitiveFlags::IS_SCROLLBAR_THUMB = PrimitiveFlags{ /* .bits = */ (1 << 2) };
1748
1749
/// IMPORTANT: If you add fields to this struct, you need to also add initializers
1750
/// for those fields in WebRenderAPI.h.
1751
struct WrStackingContextParams {
1752
WrStackingContextClip clip;
1753
const WrAnimationProperty *animation;
1754
const float *opacity;
1755
TransformStyle transform_style;
1756
WrReferenceFrameKind reference_frame_kind;
1757
const uint64_t *scrolling_relative_to;
1758
PrimitiveFlags prim_flags;
1759
/// True if picture caching should be enabled for this stacking context.
1760
bool cache_tiles;
1761
MixBlendMode mix_blend_mode;
1762
/// True if this stacking context is a backdrop root.
1764
bool is_backdrop_root;
1765
1766
bool operator==(const WrStackingContextParams& aOther) const {
1767
return clip == aOther.clip &&
1768
animation == aOther.animation &&
1769
opacity == aOther.opacity &&
1770
transform_style == aOther.transform_style &&
1771
reference_frame_kind == aOther.reference_frame_kind &&
1772
scrolling_relative_to == aOther.scrolling_relative_to &&
1773
prim_flags == aOther.prim_flags &&
1774
cache_tiles == aOther.cache_tiles &&
1775
mix_blend_mode == aOther.mix_blend_mode &&
1776
is_backdrop_root == aOther.is_backdrop_root;
1777
}
1778
};
1779
1780
/// A 3d transform stored as a 4 by 4 matrix in row-major order in memory.
1781
///
1782
/// Transforms can be parametrized over the source and destination units, to describe a
1783
/// transformation from a space to another.
1784
/// For example, `Transform3D<f32, WorldSpace, ScreenSpace>::transform_point3d`
1785
/// takes a `Point3D<f32, WorldSpace>` and returns a `Point3D<f32, ScreenSpace>`.
1786
///
1787
/// Transforms expose a set of convenience methods for pre- and post-transformations.
1788
/// A pre-transformation corresponds to adding an operation that is applied before
1789
/// the rest of the transformation, while a post-transformation adds an operation
1790
/// that is applied after.
1791
///
1792
/// These transforms are for working with _row vectors_, so the matrix math for transforming
1793
/// a vector is `v * T`. If your library is using column vectors, use `row_major` functions when you
1794
/// are asked for `column_major` representations and vice versa.
1795
template<typename T, typename Src, typename Dst>
1796
struct Transform3D {
1797
T m11;
1798
T m12;
1799
T m13;
1800
T m14;
1801
T m21;
1802
T m22;
1803
T m23;
1804
T m24;
1805
T m31;
1806
T m32;
1807
T m33;
1808
T m34;
1809
T m41;
1810
T m42;
1811
T m43;
1812
T m44;
1813
1814
bool operator==(const Transform3D& aOther) const {
1815
return m11 == aOther.m11 &&
1816
m12 == aOther.m12 &&
1817
m13 == aOther.m13 &&
1818
m14 == aOther.m14 &&
1819
m21 == aOther.m21 &&
1820
m22 == aOther.m22 &&
1821
m23 == aOther.m23 &&
1822
m24 == aOther.m24 &&
1823
m31 == aOther.m31 &&
1824
m32 == aOther.m32 &&
1825
m33 == aOther.m33 &&
1826
m34 == aOther.m34 &&
1827
m41 == aOther.m41 &&
1828
m42 == aOther.m42 &&
1829
m43 == aOther.m43 &&
1830
m44 == aOther.m44;
1831
}
1832
};
1833
1834
using LayoutTransform = Transform3D<float, LayoutPixel, LayoutPixel>;
1835
1836
/// Configure whether the contents of a stacking context
1837
/// should be rasterized in local space or screen space.
1838
/// Local space rasterized pictures are typically used
1839
/// when we want to cache the output, and performance is
1840
/// important. Note that this is a performance hint only,
1841
/// which WR may choose to ignore.
1842
union RasterSpace {
1843
enum class Tag : uint8_t {
1844
Local,
1845
Screen,
1846
1847
Sentinel /* this must be last for serialization purposes. */
1848
};
1849
1850
struct Local_Body {
1851
Tag tag;
1852
float _0;
1853
1854
bool operator==(const Local_Body& aOther) const {
1855
return _0 == aOther._0;
1856
}
1857
};
1858
1859
struct {
1860
Tag tag;
1861
};
1862
Local_Body local;
1863
1864
static RasterSpace Local(const float &a0) {
1865
RasterSpace result;
1866
::new (&result.local._0) (float)(a0);
1867
result.tag = Tag::Local;
1868
return result;
1869
}
1870
1871
static RasterSpace Screen() {
1872
RasterSpace result;
1873
result.tag = Tag::Screen;
1874
return result;
1875
}
1876
1877
bool IsLocal() const {
1878
return tag == Tag::Local;
1879
}
1880
1881
bool IsScreen() const {
1882
return tag == Tag::Screen;
1883
}
1884
1885
bool operator==(const RasterSpace& aOther) const {
1886
if (tag != aOther.tag) {
1887
return false;
1888
}
1889
switch (tag) {
1890
case Tag::Local: return local == aOther.local;
1891
default: return true;
1892
}
1893
}
1894
};
1895
1896
using GlyphIndex = uint32_t;
1897
1898
struct GlyphInstance {
1899
GlyphIndex index;
1900
LayoutPoint point;
1901
1902
bool operator==(const GlyphInstance& aOther) const {
1903
return index == aOther.index &&
1904
point == aOther.point;
1905
}
1906
};
1907
1908
struct GlyphOptions {
1909
FontRenderMode render_mode;
1910
FontInstanceFlags flags;
1911
1912
bool operator==(const GlyphOptions& aOther) const {
1913
return render_mode == aOther.render_mode &&
1914
flags == aOther.flags;
1915
}
1916
};
1917
1918
using WrColorDepth = ColorDepth;
1919
1920
using WrYuvColorSpace = YuvColorSpace;
1921
1922
using WrColorRange = ColorRange;
1923
1924
struct ByteSlice {
1925
const uint8_t *buffer;
1926
uintptr_t len;
1927
1928
bool operator==(const ByteSlice& aOther) const {
1929
return buffer == aOther.buffer &&
1930
len == aOther.len;
1931
}
1932
};
1933
1934
using LayoutIntRect = Rect<int32_t, LayoutPixel>;
1935
1936
using TileOffset = Point2D<int32_t, TileCoordinate>;
1937
1938
struct MutByteSlice {
1939
uint8_t *buffer;
1940
uintptr_t len;
1941
1942
bool operator==(const MutByteSlice& aOther) const {
1943
return buffer == aOther.buffer &&
1944
len == aOther.len;
1945
}
1946
};
1947
1948
/// A C function that takes a pointer to a heap allocation and returns its size.
1949
///
1950
/// This is borrowed from the malloc_size_of crate, upon which we want to avoid
1951
/// a dependency from WebRender.
1952
using VoidPtrToSizeFn = uintptr_t(*)(const void *ptr);
1953
1954
struct WrRenderResult {
1955
bool result;
1956
FfiVec<DeviceIntRect> dirty_rects;
1957
1958
bool operator==(const WrRenderResult& aOther) const {
1959
return result == aOther.result &&
1960
dirty_rects == aOther.dirty_rects;
1961
}
1962
};
1963
1964
/// A handle to a screenshot that is being asynchronously captured and scaled.
1965
struct AsyncScreenshotHandle {
1966
uintptr_t _0;
1967
1968
bool operator==(const AsyncScreenshotHandle& aOther) const {
1969
return _0 == aOther._0;
1970
}
1971
};
1972
1973
struct WrExternalImage {
1974
WrExternalImageType image_type;
1975
uint32_t handle;
1976
float u0;
1977
float v0;
1978
float u1;
1979
float v1;
1980
const uint8_t *buff;
1981
uintptr_t size;
1982
1983
bool operator==(const WrExternalImage& aOther) const {
1984
return image_type == aOther.image_type &&
1985
handle == aOther.handle &&
1986
u0 == aOther.u0 &&
1987
v0 == aOther.v0 &&
1988
u1 == aOther.u1 &&
1989
v1 == aOther.v1 &&
1990
buff == aOther.buff &&
1991
size == aOther.size;
1992
}
1993
};
1994
1995
/// An arbitrary identifier for an external image provided by the
1996
/// application. It must be a unique identifier for each external
1997
/// image.
1998
struct ExternalImageId {
1999
uint64_t _0;
2000
2001
bool operator==(const ExternalImageId& aOther) const {
2002
return _0 == aOther._0;
2003
}
2004
};
2005
2006
/// A handle to a recorded frame that was captured.
2007
struct RecordedFrameHandle {
2008
uintptr_t _0;
2009
2010
bool operator==(const RecordedFrameHandle& aOther) const {
2011
return _0 == aOther._0;
2012
}
2013
};
2014
2015
/// Some basic statistics about the rendered scene, used in Gecko, as
2016
/// well as in wrench reftests to ensure that tests are batching and/or
2017
/// allocating on render targets as we expect them to.
2018
struct RendererStats {
2019
uintptr_t total_draw_calls;
2020
uintptr_t alpha_target_count;
2021
uintptr_t color_target_count;
2022
uintptr_t texture_upload_kb;
2023
uint64_t resource_upload_time;
2024
uint64_t gpu_cache_upload_time;
2025
2026
bool operator==(const RendererStats& aOther) const {
2027
return total_draw_calls == aOther.total_draw_calls &&
2028
alpha_target_count == aOther.alpha_target_count &&
2029
color_target_count == aOther.color_target_count &&
2030
texture_upload_kb == aOther.texture_upload_kb &&
2031
resource_upload_time == aOther.resource_upload_time &&
2032
gpu_cache_upload_time == aOther.gpu_cache_upload_time;
2033
}
2034
};
2035
2036
struct WrExternalImageHandler {
2037
void *external_image_obj;
2038
2039
bool operator==(const WrExternalImageHandler& aOther) const {
2040
return external_image_obj == aOther.external_image_obj;
2041
}
2042
};
2043
2044
/// An opaque identifier describing a blob image registered with WebRender.
2045
/// This is used as a handle to reference blob images, and can be used as an
2046
/// image in display items.
2047
struct BlobImageKey {
2048
ImageKey _0;
2049
2050
bool operator==(const BlobImageKey& aOther) const {
2051
return _0 == aOther._0;
2052
}
2053
};
2054
2055
struct WrImageDescriptor {
2056
ImageFormat format;
2057
int32_t width;
2058
int32_t height;
2059
int32_t stride;
2060
OpacityType opacity;
2061
bool prefer_compositor_surface;
2062
2063
bool operator==(const WrImageDescriptor& aOther) const {
2064
return format == aOther.format &&
2065
width == aOther.width &&
2066
height == aOther.height &&
2067
stride == aOther.stride &&
2068
opacity == aOther.opacity &&
2069
prefer_compositor_surface == aOther.prefer_compositor_surface;
2070
}
2071
};
2072
2073
/// Storage format identifier for externally-managed images.
2074
union ExternalImageType {
2075
enum class Tag : uint8_t {
2076
/// The image is texture-backed.
2077
TextureHandle,
2078
/// The image is heap-allocated by the embedding.
2079
Buffer,
2080
2081
Sentinel /* this must be last for serialization purposes. */
2082
};
2083
2084
struct TextureHandle_Body {
2085
Tag tag;
2086
TextureTarget _0;
2087
2088
bool operator==(const TextureHandle_Body& aOther) const {
2089
return _0 == aOther._0;
2090
}
2091
};
2092
2093
struct {
2094
Tag tag;
2095
};
2096
TextureHandle_Body texture_handle;
2097
2098
static ExternalImageType TextureHandle(const TextureTarget &a0) {
2099
ExternalImageType result;
2100
::new (&result.texture_handle._0) (TextureTarget)(a0);
2101
result.tag = Tag::TextureHandle;
2102
return result;
2103
}
2104
2105
static ExternalImageType Buffer() {
2106
ExternalImageType result;
2107
result.tag = Tag::Buffer;
2108
return result;
2109
}
2110
2111
bool IsTextureHandle() const {
2112
return tag == Tag::TextureHandle;
2113
}
2114
2115
bool IsBuffer() const {
2116
return tag == Tag::Buffer;
2117
}
2118
2119
bool operator==(const ExternalImageType& aOther) const {
2120
if (tag != aOther.tag) {
2121
return false;
2122
}
2123
switch (tag) {
2124
case Tag::TextureHandle: return texture_handle == aOther.texture_handle;
2125
default: return true;
2126
}
2127
}
2128
};
2129
2130
struct WrTransformProperty {
2131
uint64_t id;
2132
LayoutTransform transform;
2133
};
2134
2135
struct WrOpacityProperty {
2136
uint64_t id;
2137
float opacity;
2138
2139
bool operator==(const WrOpacityProperty& aOther) const {
2140
return id == aOther.id &&
2141
opacity == aOther.opacity;
2142
}
2143
};
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
extern "C" {
2242
2243
extern void AddBlobFont(WrFontInstanceKey aInstanceKey,
2244
WrFontKey aFontKey,
2245
float aSize,
2246
const FontInstanceOptions *aOptions,
2247
const FontInstancePlatformOptions *aPlatformOptions,
2248
const FontVariation *aVariations,
2249
uintptr_t aNumVariations);
2250
2251
extern void AddFontData(WrFontKey aKey,
2252
const uint8_t *aData,
2253
uintptr_t aSize,
2254
uint32_t aIndex,
2255
const ArcVecU8 *aVec);
2256
2257
extern void AddNativeFontHandle(WrFontKey aKey,
2258
void *aHandle,
2259
uint32_t aIndex);
2260
2261
extern void ClearBlobImageResources(WrIdNamespace aNamespace);
2262
2263
extern void DeleteBlobFont(WrFontInstanceKey aKey);
2264
2265
extern void DeleteFontData(WrFontKey aKey);
2266
2267
#if defined(ANDROID)
2268
extern int __android_log_write(int aPrio,
2269
const char *aTag,
2270
const char *aText);
2271
#endif
2272
2273
extern void apz_deregister_sampler(WrWindowId aWindowId);
2274
2275
extern void apz_deregister_updater(WrWindowId aWindowId);
2276
2277
extern void apz_post_scene_swap(WrWindowId aWindowId,
2278
WrPipelineInfo aPipelineInfo);
2279
2280
extern void apz_pre_scene_swap(WrWindowId aWindowId);
2281
2282
extern void apz_register_sampler(WrWindowId aWindowId);
2283
2284
extern void apz_register_updater(WrWindowId aWindowId);
2285
2286
extern void apz_run_updater(WrWindowId aWindowId);
2287
2288
extern void apz_sample_transforms(WrWindowId aWindowId,
2289
Transaction *aTransaction,
2290
WrDocumentId aDocumentId);
2291
2292
extern void gecko_profiler_add_text_marker(const char *aName,
2293
const char *aTextBytes,
2294
uintptr_t aTextLen,
2295
uint64_t aMicroseconds);
2296
2297
extern void gecko_profiler_end_marker(const char *aName);
2298
2299
extern void gecko_profiler_register_thread(const char *aName);
2300