gpt4 book ai didi

c - XCreateGC() 中的 (value)mask 真的有必要吗?

转载 作者:太空宇宙 更新时间:2023-11-04 03:46:28 24 4
gpt4 key购买 nike

XCreateGC() 的第三个参数是一个值掩码,但它真的有必要吗?

GC XCreateGC (display, d, valuemask, values)

Display *display;
Drawable d;
unsigned long valuemask; // Specifies which components in the GC are to be set
// using the information in the specified values structure.
// This argument is the bitwise inclusive OR of zero or
// more of the valid GC component mask bits.
XGCValues *values; //`Specifies any values as specified by the valuemask.

我们可以设置XGCValues structure中的每一个元素,那么为什么我们必须使用掩码?

最佳答案

这样您就可以控制哪些值实际通过网络发送到服务器。 CreateGC 请求的长度可变,长度可以从 16 到 108 字节不等,具体取决于您在 valuemask 中实际拥有的值。现在这可能不是什么大问题,但 X11 协议(protocol)是 30 年前的 1984 年设计的,如果使用得当,它实际上在吞吐量和延迟方面都非常有效

关于c - XCreateGC() 中的 (value)mask 真的有必要吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23948038/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com