File: render.h

package info (click to toggle)
chromium 138.0.7204.183-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,071,908 kB
  • sloc: cpp: 34,937,088; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,953; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,806; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (1122 lines) | stat: -rw-r--r-- 34,084 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This file was automatically generated with:
// ../../ui/gfx/x/gen_xproto.py \
//    ../../third_party/xcbproto/src \
//    gen/ui/gfx/x \
//    bigreq \
//    dri3 \
//    glx \
//    randr \
//    render \
//    screensaver \
//    shape \
//    shm \
//    sync \
//    xfixes \
//    xinput \
//    xkb \
//    xproto \
//    xtest

#ifndef UI_GFX_X_GENERATED_PROTOS_RENDER_H_
#define UI_GFX_X_GENERATED_PROTOS_RENDER_H_

#include <array>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <optional>
#include <vector>

#include "base/component_export.h"
#include "base/files/scoped_file.h"
#include "base/memory/scoped_refptr.h"
#include "ui/gfx/x/error.h"
#include "ui/gfx/x/ref_counted_fd.h"
#include "ui/gfx/x/xproto_types.h"
#include "xproto.h"

namespace x11 {

class Connection;

template <typename Reply>
struct Response;

template <typename Reply>
class Future;

class COMPONENT_EXPORT(X11) Render {
 public:
  static constexpr unsigned major_version = 0;
  static constexpr unsigned minor_version = 11;

  Render(Connection* connection, const x11::QueryExtensionReply& info);

  uint8_t present() const { return info_.present; }
  uint8_t major_opcode() const { return info_.major_opcode; }
  uint8_t first_event() const { return info_.first_event; }
  uint8_t first_error() const { return info_.first_error; }

  Connection* connection() const { return connection_; }

  enum class PictType : int {
    Indexed = 0,
    Direct = 1,
  };

  enum class Picture : uint32_t {
    None = 0,
  };

  enum class PictOp : int {
    Clear = 0,
    Src = 1,
    Dst = 2,
    Over = 3,
    OverReverse = 4,
    In = 5,
    InReverse = 6,
    Out = 7,
    OutReverse = 8,
    Atop = 9,
    AtopReverse = 10,
    Xor = 11,
    Add = 12,
    Saturate = 13,
    DisjointClear = 16,
    DisjointSrc = 17,
    DisjointDst = 18,
    DisjointOver = 19,
    DisjointOverReverse = 20,
    DisjointIn = 21,
    DisjointInReverse = 22,
    DisjointOut = 23,
    DisjointOutReverse = 24,
    DisjointAtop = 25,
    DisjointAtopReverse = 26,
    DisjointXor = 27,
    ConjointClear = 32,
    ConjointSrc = 33,
    ConjointDst = 34,
    ConjointOver = 35,
    ConjointOverReverse = 36,
    ConjointIn = 37,
    ConjointInReverse = 38,
    ConjointOut = 39,
    ConjointOutReverse = 40,
    ConjointAtop = 41,
    ConjointAtopReverse = 42,
    ConjointXor = 43,
    Multiply = 48,
    Screen = 49,
    Overlay = 50,
    Darken = 51,
    Lighten = 52,
    ColorDodge = 53,
    ColorBurn = 54,
    HardLight = 55,
    SoftLight = 56,
    Difference = 57,
    Exclusion = 58,
    HSLHue = 59,
    HSLSaturation = 60,
    HSLColor = 61,
    HSLLuminosity = 62,
  };

  enum class PolyEdge : int {
    Sharp = 0,
    Smooth = 1,
  };

  enum class PolyMode : int {
    Precise = 0,
    Imprecise = 1,
  };

  enum class CreatePictureAttribute : int {
    Repeat = 1 << 0,
    AlphaMap = 1 << 1,
    AlphaXOrigin = 1 << 2,
    AlphaYOrigin = 1 << 3,
    ClipXOrigin = 1 << 4,
    ClipYOrigin = 1 << 5,
    ClipMask = 1 << 6,
    GraphicsExposure = 1 << 7,
    SubwindowMode = 1 << 8,
    PolyEdge = 1 << 9,
    PolyMode = 1 << 10,
    Dither = 1 << 11,
    ComponentAlpha = 1 << 12,
  };

  enum class SubPixel : int {
    Unknown = 0,
    HorizontalRGB = 1,
    HorizontalBGR = 2,
    VerticalRGB = 3,
    VerticalBGR = 4,
    None = 5,
  };

  enum class Repeat : int {
    None = 0,
    Normal = 1,
    Pad = 2,
    Reflect = 3,
  };

  enum class Glyph : uint32_t {};

  enum class GlyphSet : uint32_t {};

  enum class PictFormat : uint32_t {};

  enum class Fixed : int32_t {};

  struct PictFormatError : public x11::Error {
    uint16_t sequence{};
    uint32_t bad_value{};
    uint16_t minor_opcode{};
    uint8_t major_opcode{};

    std::string ToString() const override;
  };

  struct PictureError : public x11::Error {
    uint16_t sequence{};
    uint32_t bad_value{};
    uint16_t minor_opcode{};
    uint8_t major_opcode{};

    std::string ToString() const override;
  };

  struct PictOpError : public x11::Error {
    uint16_t sequence{};
    uint32_t bad_value{};
    uint16_t minor_opcode{};
    uint8_t major_opcode{};

    std::string ToString() const override;
  };

  struct GlyphSetError : public x11::Error {
    uint16_t sequence{};
    uint32_t bad_value{};
    uint16_t minor_opcode{};
    uint8_t major_opcode{};

    std::string ToString() const override;
  };

  struct GlyphError : public x11::Error {
    uint16_t sequence{};
    uint32_t bad_value{};
    uint16_t minor_opcode{};
    uint8_t major_opcode{};

    std::string ToString() const override;
  };

  struct DirectFormat {
    bool operator==(const DirectFormat& other) const {
      return red_shift == other.red_shift && red_mask == other.red_mask &&
             green_shift == other.green_shift &&
             green_mask == other.green_mask && blue_shift == other.blue_shift &&
             blue_mask == other.blue_mask && alpha_shift == other.alpha_shift &&
             alpha_mask == other.alpha_mask;
    }

    uint16_t red_shift{};
    uint16_t red_mask{};
    uint16_t green_shift{};
    uint16_t green_mask{};
    uint16_t blue_shift{};
    uint16_t blue_mask{};
    uint16_t alpha_shift{};
    uint16_t alpha_mask{};
  };

  struct PictFormInfo {
    bool operator==(const PictFormInfo& other) const {
      return id == other.id && type == other.type && depth == other.depth &&
             direct == other.direct && colormap == other.colormap;
    }

    PictFormat id{};
    PictType type{};
    uint8_t depth{};
    DirectFormat direct{};
    ColorMap colormap{};
  };

  struct PictVisual {
    bool operator==(const PictVisual& other) const {
      return visual == other.visual && format == other.format;
    }

    VisualId visual{};
    PictFormat format{};
  };

  struct PictDepth {
    bool operator==(const PictDepth& other) const {
      return depth == other.depth && visuals == other.visuals;
    }

    uint8_t depth{};
    std::vector<PictVisual> visuals{};
  };

  struct PictScreen {
    bool operator==(const PictScreen& other) const {
      return fallback == other.fallback && depths == other.depths;
    }

    PictFormat fallback{};
    std::vector<PictDepth> depths{};
  };

  struct IndexValue {
    bool operator==(const IndexValue& other) const {
      return pixel == other.pixel && red == other.red && green == other.green &&
             blue == other.blue && alpha == other.alpha;
    }

    uint32_t pixel{};
    uint16_t red{};
    uint16_t green{};
    uint16_t blue{};
    uint16_t alpha{};
  };

  struct Color {
    bool operator==(const Color& other) const {
      return red == other.red && green == other.green && blue == other.blue &&
             alpha == other.alpha;
    }

    uint16_t red{};
    uint16_t green{};
    uint16_t blue{};
    uint16_t alpha{};
  };

  struct PointFix {
    bool operator==(const PointFix& other) const {
      return x == other.x && y == other.y;
    }

    Fixed x{};
    Fixed y{};
  };

  struct LineFix {
    bool operator==(const LineFix& other) const {
      return p1 == other.p1 && p2 == other.p2;
    }

    PointFix p1{};
    PointFix p2{};
  };

  struct Triangle {
    bool operator==(const Triangle& other) const {
      return p1 == other.p1 && p2 == other.p2 && p3 == other.p3;
    }

    PointFix p1{};
    PointFix p2{};
    PointFix p3{};
  };

  struct Trapezoid {
    bool operator==(const Trapezoid& other) const {
      return top == other.top && bottom == other.bottom && left == other.left &&
             right == other.right;
    }

    Fixed top{};
    Fixed bottom{};
    LineFix left{};
    LineFix right{};
  };

  struct GlyphInfo {
    bool operator==(const GlyphInfo& other) const {
      return width == other.width && height == other.height && x == other.x &&
             y == other.y && x_off == other.x_off && y_off == other.y_off;
    }

    uint16_t width{};
    uint16_t height{};
    int16_t x{};
    int16_t y{};
    int16_t x_off{};
    int16_t y_off{};
  };

  struct Transform {
    bool operator==(const Transform& other) const {
      return matrix11 == other.matrix11 && matrix12 == other.matrix12 &&
             matrix13 == other.matrix13 && matrix21 == other.matrix21 &&
             matrix22 == other.matrix22 && matrix23 == other.matrix23 &&
             matrix31 == other.matrix31 && matrix32 == other.matrix32 &&
             matrix33 == other.matrix33;
    }

    Fixed matrix11{};
    Fixed matrix12{};
    Fixed matrix13{};
    Fixed matrix21{};
    Fixed matrix22{};
    Fixed matrix23{};
    Fixed matrix31{};
    Fixed matrix32{};
    Fixed matrix33{};
  };

  struct AnimationCursorElement {
    bool operator==(const AnimationCursorElement& other) const {
      return cursor == other.cursor && delay == other.delay;
    }

    Cursor cursor{};
    uint32_t delay{};
  };

  struct SpanFix {
    bool operator==(const SpanFix& other) const {
      return l == other.l && r == other.r && y == other.y;
    }

    Fixed l{};
    Fixed r{};
    Fixed y{};
  };

  struct Trap {
    bool operator==(const Trap& other) const {
      return top == other.top && bot == other.bot;
    }

    SpanFix top{};
    SpanFix bot{};
  };

  struct QueryVersionRequest {
    uint32_t client_major_version{};
    uint32_t client_minor_version{};
  };

  struct QueryVersionReply {
    uint16_t sequence{};
    uint32_t major_version{};
    uint32_t minor_version{};
  };

  using QueryVersionResponse = Response<QueryVersionReply>;

  Future<QueryVersionReply> QueryVersion(const QueryVersionRequest& request);

  Future<QueryVersionReply> QueryVersion(
      const uint32_t& client_major_version = {},
      const uint32_t& client_minor_version = {});

  struct QueryPictFormatsRequest {};

  struct QueryPictFormatsReply {
    uint16_t sequence{};
    uint32_t num_depths{};
    uint32_t num_visuals{};
    std::vector<PictFormInfo> formats{};
    std::vector<PictScreen> screens{};
    std::vector<SubPixel> subpixels{};
  };

  using QueryPictFormatsResponse = Response<QueryPictFormatsReply>;

  Future<QueryPictFormatsReply> QueryPictFormats(
      const QueryPictFormatsRequest& request);

  Future<QueryPictFormatsReply> QueryPictFormats();

  struct QueryPictIndexValuesRequest {
    PictFormat format{};
  };

  struct QueryPictIndexValuesReply {
    uint16_t sequence{};
    std::vector<IndexValue> values{};
  };

  using QueryPictIndexValuesResponse = Response<QueryPictIndexValuesReply>;

  Future<QueryPictIndexValuesReply> QueryPictIndexValues(
      const QueryPictIndexValuesRequest& request);

  Future<QueryPictIndexValuesReply> QueryPictIndexValues(
      const PictFormat& format = {});

  struct CreatePictureRequest {
    Picture pid{};
    Drawable drawable{};
    PictFormat format{};
    std::optional<Repeat> repeat{};
    std::optional<Picture> alphamap{};
    std::optional<int32_t> alphaxorigin{};
    std::optional<int32_t> alphayorigin{};
    std::optional<int32_t> clipxorigin{};
    std::optional<int32_t> clipyorigin{};
    std::optional<Pixmap> clipmask{};
    std::optional<uint32_t> graphicsexposure{};
    std::optional<SubwindowMode> subwindowmode{};
    std::optional<PolyEdge> polyedge{};
    std::optional<PolyMode> polymode{};
    std::optional<Atom> dither{};
    std::optional<uint32_t> componentalpha{};
  };

  using CreatePictureResponse = Response<void>;

  Future<void> CreatePicture(const CreatePictureRequest& request);

  Future<void> CreatePicture(
      const Picture& pid = {},
      const Drawable& drawable = {},
      const PictFormat& format = {},
      const std::optional<Repeat>& repeat = std::nullopt,
      const std::optional<Picture>& alphamap = std::nullopt,
      const std::optional<int32_t>& alphaxorigin = std::nullopt,
      const std::optional<int32_t>& alphayorigin = std::nullopt,
      const std::optional<int32_t>& clipxorigin = std::nullopt,
      const std::optional<int32_t>& clipyorigin = std::nullopt,
      const std::optional<Pixmap>& clipmask = std::nullopt,
      const std::optional<uint32_t>& graphicsexposure = std::nullopt,
      const std::optional<SubwindowMode>& subwindowmode = std::nullopt,
      const std::optional<PolyEdge>& polyedge = std::nullopt,
      const std::optional<PolyMode>& polymode = std::nullopt,
      const std::optional<Atom>& dither = std::nullopt,
      const std::optional<uint32_t>& componentalpha = std::nullopt);

  struct ChangePictureRequest {
    Picture picture{};
    std::optional<Repeat> repeat{};
    std::optional<Picture> alphamap{};
    std::optional<int32_t> alphaxorigin{};
    std::optional<int32_t> alphayorigin{};
    std::optional<int32_t> clipxorigin{};
    std::optional<int32_t> clipyorigin{};
    std::optional<Pixmap> clipmask{};
    std::optional<uint32_t> graphicsexposure{};
    std::optional<SubwindowMode> subwindowmode{};
    std::optional<PolyEdge> polyedge{};
    std::optional<PolyMode> polymode{};
    std::optional<Atom> dither{};
    std::optional<uint32_t> componentalpha{};
  };

  using ChangePictureResponse = Response<void>;

  Future<void> ChangePicture(const ChangePictureRequest& request);

  Future<void> ChangePicture(
      const Picture& picture = {},
      const std::optional<Repeat>& repeat = std::nullopt,
      const std::optional<Picture>& alphamap = std::nullopt,
      const std::optional<int32_t>& alphaxorigin = std::nullopt,
      const std::optional<int32_t>& alphayorigin = std::nullopt,
      const std::optional<int32_t>& clipxorigin = std::nullopt,
      const std::optional<int32_t>& clipyorigin = std::nullopt,
      const std::optional<Pixmap>& clipmask = std::nullopt,
      const std::optional<uint32_t>& graphicsexposure = std::nullopt,
      const std::optional<SubwindowMode>& subwindowmode = std::nullopt,
      const std::optional<PolyEdge>& polyedge = std::nullopt,
      const std::optional<PolyMode>& polymode = std::nullopt,
      const std::optional<Atom>& dither = std::nullopt,
      const std::optional<uint32_t>& componentalpha = std::nullopt);

  struct SetPictureClipRectanglesRequest {
    Picture picture{};
    int16_t clip_x_origin{};
    int16_t clip_y_origin{};
    std::vector<Rectangle> rectangles{};
  };

  using SetPictureClipRectanglesResponse = Response<void>;

  Future<void> SetPictureClipRectangles(
      const SetPictureClipRectanglesRequest& request);

  Future<void> SetPictureClipRectangles(
      const Picture& picture = {},
      const int16_t& clip_x_origin = {},
      const int16_t& clip_y_origin = {},
      const std::vector<Rectangle>& rectangles = {});

  struct FreePictureRequest {
    Picture picture{};
  };

  using FreePictureResponse = Response<void>;

  Future<void> FreePicture(const FreePictureRequest& request);

  Future<void> FreePicture(const Picture& picture = {});

  struct CompositeRequest {
    PictOp op{};
    Picture src{};
    Picture mask{};
    Picture dst{};
    int16_t src_x{};
    int16_t src_y{};
    int16_t mask_x{};
    int16_t mask_y{};
    int16_t dst_x{};
    int16_t dst_y{};
    uint16_t width{};
    uint16_t height{};
  };

  using CompositeResponse = Response<void>;

  Future<void> Composite(const CompositeRequest& request);

  Future<void> Composite(const PictOp& op = {},
                         const Picture& src = {},
                         const Picture& mask = {},
                         const Picture& dst = {},
                         const int16_t& src_x = {},
                         const int16_t& src_y = {},
                         const int16_t& mask_x = {},
                         const int16_t& mask_y = {},
                         const int16_t& dst_x = {},
                         const int16_t& dst_y = {},
                         const uint16_t& width = {},
                         const uint16_t& height = {});

  struct TrapezoidsRequest {
    PictOp op{};
    Picture src{};
    Picture dst{};
    PictFormat mask_format{};
    int16_t src_x{};
    int16_t src_y{};
    std::vector<Trapezoid> traps{};
  };

  using TrapezoidsResponse = Response<void>;

  Future<void> Trapezoids(const TrapezoidsRequest& request);

  Future<void> Trapezoids(const PictOp& op = {},
                          const Picture& src = {},
                          const Picture& dst = {},
                          const PictFormat& mask_format = {},
                          const int16_t& src_x = {},
                          const int16_t& src_y = {},
                          const std::vector<Trapezoid>& traps = {});

  struct TrianglesRequest {
    PictOp op{};
    Picture src{};
    Picture dst{};
    PictFormat mask_format{};
    int16_t src_x{};
    int16_t src_y{};
    std::vector<Triangle> triangles{};
  };

  using TrianglesResponse = Response<void>;

  Future<void> Triangles(const TrianglesRequest& request);

  Future<void> Triangles(const PictOp& op = {},
                         const Picture& src = {},
                         const Picture& dst = {},
                         const PictFormat& mask_format = {},
                         const int16_t& src_x = {},
                         const int16_t& src_y = {},
                         const std::vector<Triangle>& triangles = {});

  struct TriStripRequest {
    PictOp op{};
    Picture src{};
    Picture dst{};
    PictFormat mask_format{};
    int16_t src_x{};
    int16_t src_y{};
    std::vector<PointFix> points{};
  };

  using TriStripResponse = Response<void>;

  Future<void> TriStrip(const TriStripRequest& request);

  Future<void> TriStrip(const PictOp& op = {},
                        const Picture& src = {},
                        const Picture& dst = {},
                        const PictFormat& mask_format = {},
                        const int16_t& src_x = {},
                        const int16_t& src_y = {},
                        const std::vector<PointFix>& points = {});

  struct TriFanRequest {
    PictOp op{};
    Picture src{};
    Picture dst{};
    PictFormat mask_format{};
    int16_t src_x{};
    int16_t src_y{};
    std::vector<PointFix> points{};
  };

  using TriFanResponse = Response<void>;

  Future<void> TriFan(const TriFanRequest& request);

  Future<void> TriFan(const PictOp& op = {},
                      const Picture& src = {},
                      const Picture& dst = {},
                      const PictFormat& mask_format = {},
                      const int16_t& src_x = {},
                      const int16_t& src_y = {},
                      const std::vector<PointFix>& points = {});

  struct CreateGlyphSetRequest {
    GlyphSet gsid{};
    PictFormat format{};
  };

  using CreateGlyphSetResponse = Response<void>;

  Future<void> CreateGlyphSet(const CreateGlyphSetRequest& request);

  Future<void> CreateGlyphSet(const GlyphSet& gsid = {},
                              const PictFormat& format = {});

  struct ReferenceGlyphSetRequest {
    GlyphSet gsid{};
    GlyphSet existing{};
  };

  using ReferenceGlyphSetResponse = Response<void>;

  Future<void> ReferenceGlyphSet(const ReferenceGlyphSetRequest& request);

  Future<void> ReferenceGlyphSet(const GlyphSet& gsid = {},
                                 const GlyphSet& existing = {});

  struct FreeGlyphSetRequest {
    GlyphSet glyphset{};
  };

  using FreeGlyphSetResponse = Response<void>;

  Future<void> FreeGlyphSet(const FreeGlyphSetRequest& request);

  Future<void> FreeGlyphSet(const GlyphSet& glyphset = {});

  struct AddGlyphsRequest {
    GlyphSet glyphset{};
    std::vector<uint32_t> glyphids{};
    std::vector<GlyphInfo> glyphs{};
    std::vector<uint8_t> data{};
  };

  using AddGlyphsResponse = Response<void>;

  Future<void> AddGlyphs(const AddGlyphsRequest& request);

  Future<void> AddGlyphs(const GlyphSet& glyphset = {},
                         const std::vector<uint32_t>& glyphids = {},
                         const std::vector<GlyphInfo>& glyphs = {},
                         const std::vector<uint8_t>& data = {});

  struct FreeGlyphsRequest {
    GlyphSet glyphset{};
    std::vector<Glyph> glyphs{};
  };

  using FreeGlyphsResponse = Response<void>;

  Future<void> FreeGlyphs(const FreeGlyphsRequest& request);

  Future<void> FreeGlyphs(const GlyphSet& glyphset = {},
                          const std::vector<Glyph>& glyphs = {});

  struct CompositeGlyphs8Request {
    PictOp op{};
    Picture src{};
    Picture dst{};
    PictFormat mask_format{};
    GlyphSet glyphset{};
    int16_t src_x{};
    int16_t src_y{};
    std::vector<uint8_t> glyphcmds{};
  };

  using CompositeGlyphs8Response = Response<void>;

  Future<void> CompositeGlyphs8(const CompositeGlyphs8Request& request);

  Future<void> CompositeGlyphs8(const PictOp& op = {},
                                const Picture& src = {},
                                const Picture& dst = {},
                                const PictFormat& mask_format = {},
                                const GlyphSet& glyphset = {},
                                const int16_t& src_x = {},
                                const int16_t& src_y = {},
                                const std::vector<uint8_t>& glyphcmds = {});

  struct CompositeGlyphs16Request {
    PictOp op{};
    Picture src{};
    Picture dst{};
    PictFormat mask_format{};
    GlyphSet glyphset{};
    int16_t src_x{};
    int16_t src_y{};
    std::vector<uint8_t> glyphcmds{};
  };

  using CompositeGlyphs16Response = Response<void>;

  Future<void> CompositeGlyphs16(const CompositeGlyphs16Request& request);

  Future<void> CompositeGlyphs16(const PictOp& op = {},
                                 const Picture& src = {},
                                 const Picture& dst = {},
                                 const PictFormat& mask_format = {},
                                 const GlyphSet& glyphset = {},
                                 const int16_t& src_x = {},
                                 const int16_t& src_y = {},
                                 const std::vector<uint8_t>& glyphcmds = {});

  struct CompositeGlyphs32Request {
    PictOp op{};
    Picture src{};
    Picture dst{};
    PictFormat mask_format{};
    GlyphSet glyphset{};
    int16_t src_x{};
    int16_t src_y{};
    std::vector<uint8_t> glyphcmds{};
  };

  using CompositeGlyphs32Response = Response<void>;

  Future<void> CompositeGlyphs32(const CompositeGlyphs32Request& request);

  Future<void> CompositeGlyphs32(const PictOp& op = {},
                                 const Picture& src = {},
                                 const Picture& dst = {},
                                 const PictFormat& mask_format = {},
                                 const GlyphSet& glyphset = {},
                                 const int16_t& src_x = {},
                                 const int16_t& src_y = {},
                                 const std::vector<uint8_t>& glyphcmds = {});

  struct FillRectanglesRequest {
    PictOp op{};
    Picture dst{};
    Color color{};
    std::vector<Rectangle> rects{};
  };

  using FillRectanglesResponse = Response<void>;

  Future<void> FillRectangles(const FillRectanglesRequest& request);

  Future<void> FillRectangles(const PictOp& op = {},
                              const Picture& dst = {},
                              const Color& color = {{}, {}, {}, {}},
                              const std::vector<Rectangle>& rects = {});

  struct CreateCursorRequest {
    Cursor cid{};
    Picture source{};
    uint16_t x{};
    uint16_t y{};
  };

  using CreateCursorResponse = Response<void>;

  Future<void> CreateCursor(const CreateCursorRequest& request);

  Future<void> CreateCursor(const Cursor& cid = {},
                            const Picture& source = {},
                            const uint16_t& x = {},
                            const uint16_t& y = {});

  struct SetPictureTransformRequest {
    Picture picture{};
    Transform transform{};
  };

  using SetPictureTransformResponse = Response<void>;

  Future<void> SetPictureTransform(const SetPictureTransformRequest& request);

  Future<void> SetPictureTransform(
      const Picture& picture = {},
      const Transform& transform = {{}, {}, {}, {}, {}, {}, {}, {}, {}});

  struct QueryFiltersRequest {
    Drawable drawable{};
  };

  struct QueryFiltersReply {
    uint16_t sequence{};
    std::vector<uint16_t> aliases{};
    std::vector<Str> filters{};
  };

  using QueryFiltersResponse = Response<QueryFiltersReply>;

  Future<QueryFiltersReply> QueryFilters(const QueryFiltersRequest& request);

  Future<QueryFiltersReply> QueryFilters(const Drawable& drawable = {});

  struct SetPictureFilterRequest {
    Picture picture{};
    std::string filter{};
    std::vector<Fixed> values{};
  };

  using SetPictureFilterResponse = Response<void>;

  Future<void> SetPictureFilter(const SetPictureFilterRequest& request);

  Future<void> SetPictureFilter(const Picture& picture = {},
                                const std::string& filter = {},
                                const std::vector<Fixed>& values = {});

  struct CreateAnimCursorRequest {
    Cursor cid{};
    std::vector<AnimationCursorElement> cursors{};
  };

  using CreateAnimCursorResponse = Response<void>;

  Future<void> CreateAnimCursor(const CreateAnimCursorRequest& request);

  Future<void> CreateAnimCursor(
      const Cursor& cid = {},
      const std::vector<AnimationCursorElement>& cursors = {});

  struct AddTrapsRequest {
    Picture picture{};
    int16_t x_off{};
    int16_t y_off{};
    std::vector<Trap> traps{};
  };

  using AddTrapsResponse = Response<void>;

  Future<void> AddTraps(const AddTrapsRequest& request);

  Future<void> AddTraps(const Picture& picture = {},
                        const int16_t& x_off = {},
                        const int16_t& y_off = {},
                        const std::vector<Trap>& traps = {});

  struct CreateSolidFillRequest {
    Picture picture{};
    Color color{};
  };

  using CreateSolidFillResponse = Response<void>;

  Future<void> CreateSolidFill(const CreateSolidFillRequest& request);

  Future<void> CreateSolidFill(const Picture& picture = {},
                               const Color& color = {{}, {}, {}, {}});

  struct CreateLinearGradientRequest {
    Picture picture{};
    PointFix p1{};
    PointFix p2{};
    std::vector<Fixed> stops{};
    std::vector<Color> colors{};
  };

  using CreateLinearGradientResponse = Response<void>;

  Future<void> CreateLinearGradient(const CreateLinearGradientRequest& request);

  Future<void> CreateLinearGradient(const Picture& picture = {},
                                    const PointFix& p1 = {{}, {}},
                                    const PointFix& p2 = {{}, {}},
                                    const std::vector<Fixed>& stops = {},
                                    const std::vector<Color>& colors = {});

  struct CreateRadialGradientRequest {
    Picture picture{};
    PointFix inner{};
    PointFix outer{};
    Fixed inner_radius{};
    Fixed outer_radius{};
    std::vector<Fixed> stops{};
    std::vector<Color> colors{};
  };

  using CreateRadialGradientResponse = Response<void>;

  Future<void> CreateRadialGradient(const CreateRadialGradientRequest& request);

  Future<void> CreateRadialGradient(const Picture& picture = {},
                                    const PointFix& inner = {{}, {}},
                                    const PointFix& outer = {{}, {}},
                                    const Fixed& inner_radius = {},
                                    const Fixed& outer_radius = {},
                                    const std::vector<Fixed>& stops = {},
                                    const std::vector<Color>& colors = {});

  struct CreateConicalGradientRequest {
    Picture picture{};
    PointFix center{};
    Fixed angle{};
    std::vector<Fixed> stops{};
    std::vector<Color> colors{};
  };

  using CreateConicalGradientResponse = Response<void>;

  Future<void> CreateConicalGradient(
      const CreateConicalGradientRequest& request);

  Future<void> CreateConicalGradient(const Picture& picture = {},
                                     const PointFix& center = {{}, {}},
                                     const Fixed& angle = {},
                                     const std::vector<Fixed>& stops = {},
                                     const std::vector<Color>& colors = {});

 private:
  Connection* const connection_;
  x11::QueryExtensionReply info_{};
};

}  // namespace x11

inline constexpr x11::Render::PictType operator|(x11::Render::PictType l,
                                                 x11::Render::PictType r) {
  using T = std::underlying_type_t<x11::Render::PictType>;
  return static_cast<x11::Render::PictType>(static_cast<T>(l) |
                                            static_cast<T>(r));
}

inline constexpr x11::Render::PictType operator&(x11::Render::PictType l,
                                                 x11::Render::PictType r) {
  using T = std::underlying_type_t<x11::Render::PictType>;
  return static_cast<x11::Render::PictType>(static_cast<T>(l) &
                                            static_cast<T>(r));
}

inline constexpr x11::Render::Picture operator|(x11::Render::Picture l,
                                                x11::Render::Picture r) {
  using T = std::underlying_type_t<x11::Render::Picture>;
  return static_cast<x11::Render::Picture>(static_cast<T>(l) |
                                           static_cast<T>(r));
}

inline constexpr x11::Render::Picture operator&(x11::Render::Picture l,
                                                x11::Render::Picture r) {
  using T = std::underlying_type_t<x11::Render::Picture>;
  return static_cast<x11::Render::Picture>(static_cast<T>(l) &
                                           static_cast<T>(r));
}

inline constexpr x11::Render::PictOp operator|(x11::Render::PictOp l,
                                               x11::Render::PictOp r) {
  using T = std::underlying_type_t<x11::Render::PictOp>;
  return static_cast<x11::Render::PictOp>(static_cast<T>(l) |
                                          static_cast<T>(r));
}

inline constexpr x11::Render::PictOp operator&(x11::Render::PictOp l,
                                               x11::Render::PictOp r) {
  using T = std::underlying_type_t<x11::Render::PictOp>;
  return static_cast<x11::Render::PictOp>(static_cast<T>(l) &
                                          static_cast<T>(r));
}

inline constexpr x11::Render::PolyEdge operator|(x11::Render::PolyEdge l,
                                                 x11::Render::PolyEdge r) {
  using T = std::underlying_type_t<x11::Render::PolyEdge>;
  return static_cast<x11::Render::PolyEdge>(static_cast<T>(l) |
                                            static_cast<T>(r));
}

inline constexpr x11::Render::PolyEdge operator&(x11::Render::PolyEdge l,
                                                 x11::Render::PolyEdge r) {
  using T = std::underlying_type_t<x11::Render::PolyEdge>;
  return static_cast<x11::Render::PolyEdge>(static_cast<T>(l) &
                                            static_cast<T>(r));
}

inline constexpr x11::Render::PolyMode operator|(x11::Render::PolyMode l,
                                                 x11::Render::PolyMode r) {
  using T = std::underlying_type_t<x11::Render::PolyMode>;
  return static_cast<x11::Render::PolyMode>(static_cast<T>(l) |
                                            static_cast<T>(r));
}

inline constexpr x11::Render::PolyMode operator&(x11::Render::PolyMode l,
                                                 x11::Render::PolyMode r) {
  using T = std::underlying_type_t<x11::Render::PolyMode>;
  return static_cast<x11::Render::PolyMode>(static_cast<T>(l) &
                                            static_cast<T>(r));
}

inline constexpr x11::Render::CreatePictureAttribute operator|(
    x11::Render::CreatePictureAttribute l,
    x11::Render::CreatePictureAttribute r) {
  using T = std::underlying_type_t<x11::Render::CreatePictureAttribute>;
  return static_cast<x11::Render::CreatePictureAttribute>(static_cast<T>(l) |
                                                          static_cast<T>(r));
}

inline constexpr x11::Render::CreatePictureAttribute operator&(
    x11::Render::CreatePictureAttribute l,
    x11::Render::CreatePictureAttribute r) {
  using T = std::underlying_type_t<x11::Render::CreatePictureAttribute>;
  return static_cast<x11::Render::CreatePictureAttribute>(static_cast<T>(l) &
                                                          static_cast<T>(r));
}

inline constexpr x11::Render::SubPixel operator|(x11::Render::SubPixel l,
                                                 x11::Render::SubPixel r) {
  using T = std::underlying_type_t<x11::Render::SubPixel>;
  return static_cast<x11::Render::SubPixel>(static_cast<T>(l) |
                                            static_cast<T>(r));
}

inline constexpr x11::Render::SubPixel operator&(x11::Render::SubPixel l,
                                                 x11::Render::SubPixel r) {
  using T = std::underlying_type_t<x11::Render::SubPixel>;
  return static_cast<x11::Render::SubPixel>(static_cast<T>(l) &
                                            static_cast<T>(r));
}

inline constexpr x11::Render::Repeat operator|(x11::Render::Repeat l,
                                               x11::Render::Repeat r) {
  using T = std::underlying_type_t<x11::Render::Repeat>;
  return static_cast<x11::Render::Repeat>(static_cast<T>(l) |
                                          static_cast<T>(r));
}

inline constexpr x11::Render::Repeat operator&(x11::Render::Repeat l,
                                               x11::Render::Repeat r) {
  using T = std::underlying_type_t<x11::Render::Repeat>;
  return static_cast<x11::Render::Repeat>(static_cast<T>(l) &
                                          static_cast<T>(r));
}

#endif  // UI_GFX_X_GENERATED_PROTOS_RENDER_H_