// Public API from X11/extensions/Xrender.h and render.h. The C headers own the ABI. // Raw calls retain Xlib ownership rules and asynchronous error semantics. module render import vx11 #flag -lXrender #include // render.h pub const name = 'RENDER' pub const major_version = 0 pub const minor_version = 11 // Minor request opcodes, for decoding XErrorEvent.minor_code. pub const x_query_version = 0 pub const x_query_pict_formats = 1 pub const x_query_pict_index_values = 2 pub const x_query_dithers = 3 pub const x_create_picture = 4 pub const x_change_picture = 5 pub const x_set_picture_clip_rectangles = 6 pub const x_free_picture = 7 pub const x_composite = 8 pub const x_scale = 9 pub const x_trapezoids = 10 pub const x_triangles = 11 pub const x_tri_strip = 12 pub const x_tri_fan = 13 pub const x_color_trapezoids = 14 pub const x_color_triangles = 15 pub const x_create_glyph_set = 17 pub const x_reference_glyph_set = 18 pub const x_free_glyph_set = 19 pub const x_add_glyphs = 20 pub const x_add_glyphs_from_picture = 21 pub const x_free_glyphs = 22 pub const x_composite_glyphs8 = 23 pub const x_composite_glyphs16 = 24 pub const x_composite_glyphs32 = 25 pub const x_fill_rectangles = 26 pub const x_create_cursor = 27 pub const x_set_picture_transform = 28 pub const x_query_filters = 29 pub const x_set_picture_filter = 30 pub const x_create_anim_cursor = 31 pub const x_add_traps = 32 pub const x_create_solid_fill = 33 pub const x_create_linear_gradient = 34 pub const x_create_radial_gradient = 35 pub const x_create_conical_gradient = 36 pub const number_requests = 37 // Error codes are offsets from the server-assigned error base. pub const bad_pict_format = 0 pub const bad_picture = 1 pub const bad_pict_op = 2 pub const bad_glyph_set = 3 pub const bad_glyph = 4 pub const number_errors = 5 pub const pict_type_indexed = 0 pub const pict_type_direct = 1 // Porter-Duff operators. pub const op_minimum = 0 pub const op_clear = 0 pub const op_src = 1 pub const op_dst = 2 pub const op_over = 3 pub const op_over_reverse = 4 pub const op_in = 5 pub const op_in_reverse = 6 pub const op_out = 7 pub const op_out_reverse = 8 pub const op_atop = 9 pub const op_atop_reverse = 10 pub const op_xor = 11 pub const op_add = 12 pub const op_saturate = 13 pub const op_maximum = 13 // Disjoint and conjoint operators (Render 0.2). pub const op_disjoint_minimum = 0x10 pub const op_disjoint_clear = 0x10 pub const op_disjoint_src = 0x11 pub const op_disjoint_dst = 0x12 pub const op_disjoint_over = 0x13 pub const op_disjoint_over_reverse = 0x14 pub const op_disjoint_in = 0x15 pub const op_disjoint_in_reverse = 0x16 pub const op_disjoint_out = 0x17 pub const op_disjoint_out_reverse = 0x18 pub const op_disjoint_atop = 0x19 pub const op_disjoint_atop_reverse = 0x1a pub const op_disjoint_xor = 0x1b pub const op_disjoint_maximum = 0x1b pub const op_conjoint_minimum = 0x20 pub const op_conjoint_clear = 0x20 pub const op_conjoint_src = 0x21 pub const op_conjoint_dst = 0x22 pub const op_conjoint_over = 0x23 pub const op_conjoint_over_reverse = 0x24 pub const op_conjoint_in = 0x25 pub const op_conjoint_in_reverse = 0x26 pub const op_conjoint_out = 0x27 pub const op_conjoint_out_reverse = 0x28 pub const op_conjoint_atop = 0x29 pub const op_conjoint_atop_reverse = 0x2a pub const op_conjoint_xor = 0x2b pub const op_conjoint_maximum = 0x2b // PDF blend modes (Render 0.11). pub const op_blend_minimum = 0x30 pub const op_multiply = 0x30 pub const op_screen = 0x31 pub const op_overlay = 0x32 pub const op_darken = 0x33 pub const op_lighten = 0x34 pub const op_color_dodge = 0x35 pub const op_color_burn = 0x36 pub const op_hard_light = 0x37 pub const op_soft_light = 0x38 pub const op_difference = 0x39 pub const op_exclusion = 0x3a pub const op_hsl_hue = 0x3b pub const op_hsl_saturation = 0x3c pub const op_hsl_color = 0x3d pub const op_hsl_luminosity = 0x3e pub const op_blend_maximum = 0x3e pub const poly_edge_sharp = 0 pub const poly_edge_smooth = 1 pub const poly_mode_precise = 0 pub const poly_mode_imprecise = 1 // Picture attribute mask bits for create_picture and change_picture. pub const cp_repeat = vx11.CULong(1 << 0) pub const cp_alpha_map = vx11.CULong(1 << 1) pub const cp_alpha_x_origin = vx11.CULong(1 << 2) pub const cp_alpha_y_origin = vx11.CULong(1 << 3) pub const cp_clip_x_origin = vx11.CULong(1 << 4) pub const cp_clip_y_origin = vx11.CULong(1 << 5) pub const cp_clip_mask = vx11.CULong(1 << 6) pub const cp_graphics_exposure = vx11.CULong(1 << 7) pub const cp_subwindow_mode = vx11.CULong(1 << 8) pub const cp_poly_edge = vx11.CULong(1 << 9) pub const cp_poly_mode = vx11.CULong(1 << 10) pub const cp_dither = vx11.CULong(1 << 11) pub const cp_component_alpha = vx11.CULong(1 << 12) pub const cp_last_bit = 12 pub const filter_nearest = 'nearest' pub const filter_bilinear = 'bilinear' pub const filter_convolution = 'convolution' pub const filter_fast = 'fast' pub const filter_good = 'good' pub const filter_best = 'best' pub const filter_alias_none = -1 pub const subpixel_unknown = 0 pub const subpixel_horizontal_rgb = 1 pub const subpixel_horizontal_bgr = 2 pub const subpixel_vertical_rgb = 3 pub const subpixel_vertical_bgr = 4 pub const subpixel_none = 5 // Repeat modes; pad and reflect require Render 0.10. pub const repeat_none = 0 pub const repeat_normal = 1 pub const repeat_pad = 2 pub const repeat_reflect = 3 pub type Glyph = vx11.XID pub type GlyphSet = vx11.XID pub type Picture = vx11.XID pub type PictFormat = vx11.XID // Xrender.h // Format mask bits for find_format: which template fields must match. pub const format_id = vx11.CULong(1 << 0) pub const format_type = vx11.CULong(1 << 1) pub const format_depth = vx11.CULong(1 << 2) pub const format_red = vx11.CULong(1 << 3) pub const format_red_mask = vx11.CULong(1 << 4) pub const format_green = vx11.CULong(1 << 5) pub const format_green_mask = vx11.CULong(1 << 6) pub const format_blue = vx11.CULong(1 << 7) pub const format_blue_mask = vx11.CULong(1 << 8) pub const format_alpha = vx11.CULong(1 << 9) pub const format_alpha_mask = vx11.CULong(1 << 10) pub const format_colormap = vx11.CULong(1 << 11) pub const standard_argb32 = 0 pub const standard_rgb24 = 1 pub const standard_a8 = 2 pub const standard_a4 = 3 pub const standard_a1 = 4 pub const standard_num = 5 // Fixed is XFixed, a signed 16.16 fixed-point value; Double is XDouble. pub type Fixed = i32 pub type Double = f64 @[typedef] pub struct C.XRenderDirectFormat { pub mut: red i16 redMask i16 green i16 greenMask i16 blue i16 blueMask i16 alpha i16 alphaMask i16 } pub type DirectFormat = C.XRenderDirectFormat // Format is XRenderPictFormat. Pointers returned by the find functions are // borrowed from libXrender's per-display cache; never free them. @[typedef] pub struct C.XRenderPictFormat { pub mut: id PictFormat @type i32 depth i32 direct DirectFormat colormap vx11.Colormap } pub type Format = C.XRenderPictFormat @[typedef] pub struct C.XRenderPictureAttributes { pub mut: repeat i32 alpha_map Picture alpha_x_origin i32 alpha_y_origin i32 clip_x_origin i32 clip_y_origin i32 clip_mask vx11.Pixmap graphics_exposures i32 subwindow_mode i32 poly_edge i32 poly_mode i32 dither vx11.Atom component_alpha i32 } pub type PictureAttributes = C.XRenderPictureAttributes // Color is XRenderColor. Fill and solid-fill colors are premultiplied by // alpha; gradient stop colors are not. @[typedef] pub struct C.XRenderColor { pub mut: red u16 green u16 blue u16 alpha u16 } pub type Color = C.XRenderColor @[typedef] pub struct C.XGlyphInfo { pub mut: width u16 height u16 x i16 y i16 xOff i16 yOff i16 } pub type GlyphInfo = C.XGlyphInfo @[typedef] pub struct C.XGlyphElt8 { pub mut: glyphset GlyphSet chars &char nchars i32 xOff i32 yOff i32 } pub type GlyphElt8 = C.XGlyphElt8 @[typedef] pub struct C.XGlyphElt16 { pub mut: glyphset GlyphSet chars &u16 nchars i32 xOff i32 yOff i32 } pub type GlyphElt16 = C.XGlyphElt16 @[typedef] pub struct C.XGlyphElt32 { pub mut: glyphset GlyphSet chars &u32 nchars i32 xOff i32 yOff i32 } pub type GlyphElt32 = C.XGlyphElt32 @[typedef] pub struct C.XPointDouble { pub mut: x Double y Double } pub type PointDouble = C.XPointDouble @[typedef] pub struct C.XPointFixed { pub mut: x Fixed y Fixed } pub type PointFixed = C.XPointFixed @[typedef] pub struct C.XLineFixed { pub mut: p1 PointFixed p2 PointFixed } pub type LineFixed = C.XLineFixed @[typedef] pub struct C.XTriangle { pub mut: p1 PointFixed p2 PointFixed p3 PointFixed } pub type Triangle = C.XTriangle @[typedef] pub struct C.XCircle { pub mut: x Fixed y Fixed radius Fixed } pub type Circle = C.XCircle @[typedef] pub struct C.XTrapezoid { pub mut: top Fixed bottom Fixed left LineFixed right LineFixed } pub type Trapezoid = C.XTrapezoid @[typedef] pub struct C.XTransform { pub mut: matrix [3][3]Fixed } pub type Transform = C.XTransform // Filters is one allocation: release the whole result with vx11.free. @[typedef] pub struct C.XFilters { pub mut: nfilter i32 filter &&char nalias i32 alias &i16 } pub type Filters = C.XFilters @[typedef] pub struct C.XIndexValue { pub mut: pixel vx11.CULong red u16 green u16 blue u16 alpha u16 } pub type IndexValue = C.XIndexValue @[typedef] pub struct C.XAnimCursor { pub mut: cursor vx11.Cursor delay vx11.CULong } pub type AnimCursor = C.XAnimCursor @[typedef] pub struct C.XSpanFix { pub mut: left Fixed right Fixed y Fixed } pub type SpanFix = C.XSpanFix @[typedef] pub struct C.XTrap { pub mut: top SpanFix bottom SpanFix } pub type Trap = C.XTrap @[typedef] pub struct C.XLinearGradient { pub mut: p1 PointFixed p2 PointFixed } pub type LinearGradient = C.XLinearGradient @[typedef] pub struct C.XRadialGradient { pub mut: inner Circle outer Circle } pub type RadialGradient = C.XRadialGradient // angle is in degrees. @[typedef] pub struct C.XConicalGradient { pub mut: center PointFixed angle Fixed } pub type ConicalGradient = C.XConicalGradient // fixed converts a float to XRender 16.16 notation, like XDoubleToFixed. The // value must lie within Fixed's range. pub fn fixed(value f64) Fixed { return Fixed(value * 65536.0) } // fixed_to_double converts 16.16 notation back to a float, like XFixedToDouble. pub fn fixed_to_double(value Fixed) f64 { return f64(value) / 65536.0 } fn C.XRenderQueryExtension(&vx11.Display, &i32, &i32) i32 fn C.XRenderQueryVersion(&vx11.Display, &i32, &i32) i32 fn C.XRenderQueryFormats(&vx11.Display) i32 fn C.XRenderQuerySubpixelOrder(&vx11.Display, i32) i32 fn C.XRenderSetSubpixelOrder(&vx11.Display, i32, i32) i32 fn C.XRenderFindVisualFormat(&vx11.Display, &vx11.Visual) &Format fn C.XRenderFindFormat(&vx11.Display, vx11.CULong, &Format, i32) &Format fn C.XRenderFindStandardFormat(&vx11.Display, i32) &Format fn C.XRenderQueryPictIndexValues(&vx11.Display, &Format, &i32) &IndexValue fn C.XRenderCreatePicture(&vx11.Display, vx11.Drawable, &Format, vx11.CULong, &PictureAttributes) Picture fn C.XRenderFreePicture(&vx11.Display, Picture) fn C.XRenderChangePicture(&vx11.Display, Picture, vx11.CULong, &PictureAttributes) fn C.XRenderSetPictureClipRectangles(&vx11.Display, Picture, i32, i32, &vx11.XRectangle, i32) fn C.XRenderSetPictureClipRegion(&vx11.Display, Picture, vx11.Region) fn C.XRenderSetPictureTransform(&vx11.Display, Picture, &Transform) fn C.XRenderComposite(&vx11.Display, i32, Picture, Picture, Picture, i32, i32, i32, i32, i32, i32, u32, u32) fn C.XRenderCreateGlyphSet(&vx11.Display, &Format) GlyphSet fn C.XRenderReferenceGlyphSet(&vx11.Display, GlyphSet) GlyphSet fn C.XRenderFreeGlyphSet(&vx11.Display, GlyphSet) fn C.XRenderAddGlyphs(&vx11.Display, GlyphSet, &Glyph, &GlyphInfo, i32, &char, i32) fn C.XRenderFreeGlyphs(&vx11.Display, GlyphSet, &Glyph, i32) fn C.XRenderCompositeString8(&vx11.Display, i32, Picture, Picture, &Format, GlyphSet, i32, i32, i32, i32, &char, i32) fn C.XRenderCompositeString16(&vx11.Display, i32, Picture, Picture, &Format, GlyphSet, i32, i32, i32, i32, &u16, i32) fn C.XRenderCompositeString32(&vx11.Display, i32, Picture, Picture, &Format, GlyphSet, i32, i32, i32, i32, &u32, i32) fn C.XRenderCompositeText8(&vx11.Display, i32, Picture, Picture, &Format, i32, i32, i32, i32, &GlyphElt8, i32) fn C.XRenderCompositeText16(&vx11.Display, i32, Picture, Picture, &Format, i32, i32, i32, i32, &GlyphElt16, i32) fn C.XRenderCompositeText32(&vx11.Display, i32, Picture, Picture, &Format, i32, i32, i32, i32, &GlyphElt32, i32) fn C.XRenderFillRectangle(&vx11.Display, i32, Picture, &Color, i32, i32, u32, u32) fn C.XRenderFillRectangles(&vx11.Display, i32, Picture, &Color, &vx11.XRectangle, i32) fn C.XRenderCompositeTrapezoids(&vx11.Display, i32, Picture, Picture, &Format, i32, i32, &Trapezoid, i32) fn C.XRenderCompositeTriangles(&vx11.Display, i32, Picture, Picture, &Format, i32, i32, &Triangle, i32) fn C.XRenderCompositeTriStrip(&vx11.Display, i32, Picture, Picture, &Format, i32, i32, &PointFixed, i32) fn C.XRenderCompositeTriFan(&vx11.Display, i32, Picture, Picture, &Format, i32, i32, &PointFixed, i32) fn C.XRenderCompositeDoublePoly(&vx11.Display, i32, Picture, Picture, &Format, i32, i32, i32, i32, &PointDouble, i32, i32) fn C.XRenderParseColor(&vx11.Display, &char, &Color) i32 fn C.XRenderCreateCursor(&vx11.Display, Picture, u32, u32) vx11.Cursor fn C.XRenderQueryFilters(&vx11.Display, vx11.Drawable) &Filters fn C.XRenderSetPictureFilter(&vx11.Display, Picture, &char, &Fixed, i32) fn C.XRenderCreateAnimCursor(&vx11.Display, i32, &AnimCursor) vx11.Cursor fn C.XRenderAddTraps(&vx11.Display, Picture, i32, i32, &Trap, i32) fn C.XRenderCreateSolidFill(&vx11.Display, &Color) Picture fn C.XRenderCreateLinearGradient(&vx11.Display, &LinearGradient, &Fixed, &Color, i32) Picture fn C.XRenderCreateRadialGradient(&vx11.Display, &RadialGradient, &Fixed, &Color, i32) Picture fn C.XRenderCreateConicalGradient(&vx11.Display, &ConicalGradient, &Fixed, &Color, i32) Picture // Extension and formats pub fn query_extension(d &vx11.Display, event_base &i32, error_base &i32) i32 { return C.XRenderQueryExtension(d, event_base, error_base) } pub fn query_version(d &vx11.Display, major &i32, minor &i32) i32 { return C.XRenderQueryVersion(d, major, minor) } // Loads libXrender's format cache. Returns nonzero on success. pub fn query_formats(d &vx11.Display) i32 { return C.XRenderQueryFormats(d) } // Returns a subpixel_* value, or subpixel_unknown when the server does not say. pub fn query_subpixel_order(d &vx11.Display, screen i32) i32 { return C.XRenderQuerySubpixelOrder(d, screen) } // Changes only libXrender's client-side cache, not the server. pub fn set_subpixel_order(d &vx11.Display, screen i32, subpixel i32) i32 { return C.XRenderSetSubpixelOrder(d, screen, subpixel) } // The result is borrowed from libXrender's cache; NULL when no format matches. pub fn find_visual_format(d &vx11.Display, visual &vx11.Visual) &Format { return C.XRenderFindVisualFormat(d, visual) } // Returns the count-th cached format whose mask-selected fields equal template. // The result is borrowed; NULL when there are no more matches. pub fn find_format(d &vx11.Display, mask vx11.CULong, template &Format, count i32) &Format { return C.XRenderFindFormat(d, mask, template, count) } // format is a standard_* value. The result is borrowed; NULL when unsupported. pub fn find_standard_format(d &vx11.Display, format i32) &Format { return C.XRenderFindStandardFormat(d, format) } // Requires Render 0.7 and an indexed format. Release the result with vx11.free. pub fn query_pict_index_values(d &vx11.Display, format &Format, count &i32) &IndexValue { return C.XRenderQueryPictIndexValues(d, format, count) } // Pictures // The caller owns the picture; release it with free_picture before its drawable. pub fn create_picture(d &vx11.Display, drawable vx11.Drawable, format &Format, mask vx11.CULong, attributes &PictureAttributes) Picture { return C.XRenderCreatePicture(d, drawable, format, mask, attributes) } pub fn free_picture(d &vx11.Display, picture Picture) { C.XRenderFreePicture(d, picture) } pub fn change_picture(d &vx11.Display, picture Picture, mask vx11.CULong, attributes &PictureAttributes) { C.XRenderChangePicture(d, picture, mask, attributes) } pub fn set_picture_clip_rectangles(d &vx11.Display, picture Picture, x_origin i32, y_origin i32, rectangles &vx11.XRectangle, count i32) { C.XRenderSetPictureClipRectangles(d, picture, x_origin, y_origin, rectangles, count) } // The region is copied; the caller keeps ownership of r. pub fn set_picture_clip_region(d &vx11.Display, picture Picture, r vx11.Region) { C.XRenderSetPictureClipRegion(d, picture, r) } // Requires Render 0.6. pub fn set_picture_transform(d &vx11.Display, picture Picture, transform &Transform) { C.XRenderSetPictureTransform(d, picture, transform) } pub fn composite(d &vx11.Display, op i32, src Picture, mask Picture, dst Picture, src_x i32, src_y i32, mask_x i32, mask_y i32, dst_x i32, dst_y i32, width u32, height u32) { C.XRenderComposite(d, op, src, mask, dst, src_x, src_y, mask_x, mask_y, dst_x, dst_y, width, height) } // Glyphs // The caller owns the glyph set; release it with free_glyph_set. pub fn create_glyph_set(d &vx11.Display, format &Format) GlyphSet { return C.XRenderCreateGlyphSet(d, format) } // Returns a new ID sharing existing's glyphs. Free each ID separately. // Upstream defect: renderproto.h gives sz_xRenderReferenceGlyphSetReq as 24 // bytes, but the request is 12, so libXrender sends a bad length and servers // that check it (Xorg, Xvfb) report a fatal BadLength. Avoid it, or call it // under an error handler. pub fn reference_glyph_set(d &vx11.Display, existing GlyphSet) GlyphSet { return C.XRenderReferenceGlyphSet(d, existing) } pub fn free_glyph_set(d &vx11.Display, glyphset GlyphSet) { C.XRenderFreeGlyphSet(d, glyphset) } // images holds each glyph as a Z-format image whose rows are padded to 32 bits. pub fn add_glyphs(d &vx11.Display, glyphset GlyphSet, gids &Glyph, glyphs &GlyphInfo, count i32, images &char, image_bytes i32) { C.XRenderAddGlyphs(d, glyphset, gids, glyphs, count, images, image_bytes) } // Every glyph must exist in glyphset, or the server reports a Match error. pub fn free_glyphs(d &vx11.Display, glyphset GlyphSet, gids &Glyph, count i32) { C.XRenderFreeGlyphs(d, glyphset, gids, count) } pub fn composite_string8(d &vx11.Display, op i32, src Picture, dst Picture, mask_format &Format, glyphset GlyphSet, src_x i32, src_y i32, dst_x i32, dst_y i32, text &char, count i32) { C.XRenderCompositeString8(d, op, src, dst, mask_format, glyphset, src_x, src_y, dst_x, dst_y, text, count) } pub fn composite_string16(d &vx11.Display, op i32, src Picture, dst Picture, mask_format &Format, glyphset GlyphSet, src_x i32, src_y i32, dst_x i32, dst_y i32, text &u16, count i32) { C.XRenderCompositeString16(d, op, src, dst, mask_format, glyphset, src_x, src_y, dst_x, dst_y, text, count) } pub fn composite_string32(d &vx11.Display, op i32, src Picture, dst Picture, mask_format &Format, glyphset GlyphSet, src_x i32, src_y i32, dst_x i32, dst_y i32, text &u32, count i32) { C.XRenderCompositeString32(d, op, src, dst, mask_format, glyphset, src_x, src_y, dst_x, dst_y, text, count) } pub fn composite_text8(d &vx11.Display, op i32, src Picture, dst Picture, mask_format &Format, src_x i32, src_y i32, dst_x i32, dst_y i32, elements &GlyphElt8, count i32) { C.XRenderCompositeText8(d, op, src, dst, mask_format, src_x, src_y, dst_x, dst_y, elements, count) } pub fn composite_text16(d &vx11.Display, op i32, src Picture, dst Picture, mask_format &Format, src_x i32, src_y i32, dst_x i32, dst_y i32, elements &GlyphElt16, count i32) { C.XRenderCompositeText16(d, op, src, dst, mask_format, src_x, src_y, dst_x, dst_y, elements, count) } pub fn composite_text32(d &vx11.Display, op i32, src Picture, dst Picture, mask_format &Format, src_x i32, src_y i32, dst_x i32, dst_y i32, elements &GlyphElt32, count i32) { C.XRenderCompositeText32(d, op, src, dst, mask_format, src_x, src_y, dst_x, dst_y, elements, count) } // Filling and geometry // color is premultiplied by alpha. pub fn fill_rectangle(d &vx11.Display, op i32, dst Picture, color &Color, x i32, y i32, width u32, height u32) { C.XRenderFillRectangle(d, op, dst, color, x, y, width, height) } // color is premultiplied by alpha. pub fn fill_rectangles(d &vx11.Display, op i32, dst Picture, color &Color, rectangles &vx11.XRectangle, count i32) { C.XRenderFillRectangles(d, op, dst, color, rectangles, count) } // Requires Render 0.4. A NULL mask_format composites each trapezoid separately. pub fn composite_trapezoids(d &vx11.Display, op i32, src Picture, dst Picture, mask_format &Format, src_x i32, src_y i32, traps &Trapezoid, count i32) { C.XRenderCompositeTrapezoids(d, op, src, dst, mask_format, src_x, src_y, traps, count) } // Requires Render 0.4. pub fn composite_triangles(d &vx11.Display, op i32, src Picture, dst Picture, mask_format &Format, src_x i32, src_y i32, triangles &Triangle, count i32) { C.XRenderCompositeTriangles(d, op, src, dst, mask_format, src_x, src_y, triangles, count) } // Requires Render 0.4 and at least three points. pub fn composite_tri_strip(d &vx11.Display, op i32, src Picture, dst Picture, mask_format &Format, src_x i32, src_y i32, points &PointFixed, count i32) { C.XRenderCompositeTriStrip(d, op, src, dst, mask_format, src_x, src_y, points, count) } // Requires Render 0.4 and at least three points. pub fn composite_tri_fan(d &vx11.Display, op i32, src Picture, dst Picture, mask_format &Format, src_x i32, src_y i32, points &PointFixed, count i32) { C.XRenderCompositeTriFan(d, op, src, dst, mask_format, src_x, src_y, points, count) } // Tessellates the polygon into trapezoids client-side. winding is nonzero for // the nonzero rule and 0 for even-odd. Requires Render 0.4. pub fn composite_double_poly(d &vx11.Display, op i32, src Picture, dst Picture, mask_format &Format, src_x i32, src_y i32, dst_x i32, dst_y i32, points &PointDouble, count i32, winding i32) { C.XRenderCompositeDoublePoly(d, op, src, dst, mask_format, src_x, src_y, dst_x, dst_y, points, count, winding) } // Accepts XParseColor specifications and rgba:r/g/b/a. The result is // premultiplied. Returns nonzero on success. pub fn parse_color(d &vx11.Display, spec &char, def &Color) i32 { return C.XRenderParseColor(d, spec, def) } // Requires Render 0.5. The caller owns the cursor; release it with vx11.free_cursor. pub fn create_cursor(d &vx11.Display, source Picture, x u32, y u32) vx11.Cursor { return C.XRenderCreateCursor(d, source, x, y) } // Requires Render 0.6. Release the result with vx11.free; NULL on failure. pub fn query_filters(d &vx11.Display, drawable vx11.Drawable) &Filters { return C.XRenderQueryFilters(d, drawable) } // Requires Render 0.6. Unknown filter names produce a BadName error. pub fn set_picture_filter(d &vx11.Display, picture Picture, filter &char, params &Fixed, count i32) { C.XRenderSetPictureFilter(d, picture, filter, params, count) } // Requires Render 0.8. delay is in milliseconds. The frame cursors are copied; // the caller owns the result and releases it with vx11.free_cursor. pub fn create_anim_cursor(d &vx11.Display, count i32, cursors &AnimCursor) vx11.Cursor { return C.XRenderCreateAnimCursor(d, count, cursors) } // Requires Render 0.9. picture must have an alpha-only format. pub fn add_traps(d &vx11.Display, picture Picture, x_offset i32, y_offset i32, traps &Trap, count i32) { C.XRenderAddTraps(d, picture, x_offset, y_offset, traps, count) } // Requires Render 0.10. color is premultiplied. Release with free_picture. pub fn create_solid_fill(d &vx11.Display, color &Color) Picture { return C.XRenderCreateSolidFill(d, color) } // Requires Render 0.10. Stops lie in [0, 1] in increasing order; colors are // not premultiplied. Release with free_picture. pub fn create_linear_gradient(d &vx11.Display, gradient &LinearGradient, stops &Fixed, colors &Color, count i32) Picture { return C.XRenderCreateLinearGradient(d, gradient, stops, colors, count) } // Requires Render 0.10. Stops lie in [0, 1] in increasing order; colors are // not premultiplied. Release with free_picture. pub fn create_radial_gradient(d &vx11.Display, gradient &RadialGradient, stops &Fixed, colors &Color, count i32) Picture { return C.XRenderCreateRadialGradient(d, gradient, stops, colors, count) } // Requires Render 0.10. Stops lie in [0, 1] in increasing order; colors are // not premultiplied. Release with free_picture. pub fn create_conical_gradient(d &vx11.Display, gradient &ConicalGradient, stops &Fixed, colors &Color, count i32) Picture { return C.XRenderCreateConicalGradient(d, gradient, stops, colors, count) }