Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/x11/standalone/glxbackend.cpp
Show First 20 Lines • Show All 425 Lines • ▼ Show 20 Line(s) | 419 | const int attribs_srgb[] = { | |||
---|---|---|---|---|---|
426 | GLX_DEPTH_SIZE, 0, | 426 | GLX_DEPTH_SIZE, 0, | ||
427 | GLX_STENCIL_SIZE, 0, | 427 | GLX_STENCIL_SIZE, 0, | ||
428 | GLX_CONFIG_CAVEAT, GLX_NONE, | 428 | GLX_CONFIG_CAVEAT, GLX_NONE, | ||
429 | GLX_DOUBLEBUFFER, true, | 429 | GLX_DOUBLEBUFFER, true, | ||
430 | GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB, true, | 430 | GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB, true, | ||
431 | 0 | 431 | 0 | ||
432 | }; | 432 | }; | ||
433 | 433 | | |||
434 | bool llvmpipe = false; | ||||
435 | | ||||
436 | // Note that we cannot use GLPlatform::driver() here, because it has not been initialized at this point | ||||
437 | if (hasExtension(QByteArrayLiteral("GLX_MESA_query_renderer"))) { | ||||
438 | const QByteArray device = glXQueryRendererStringMESA(display(), DefaultScreen(display()), 0, GLX_RENDERER_DEVICE_ID_MESA); | ||||
439 | if (device.contains(QByteArrayLiteral("llvmpipe"))) { | ||||
440 | llvmpipe = true; | ||||
441 | } | ||||
442 | } | ||||
443 | | ||||
434 | // Try to find a double buffered sRGB capable configuration | 444 | // Try to find a double buffered sRGB capable configuration | ||
435 | int count = 0; | 445 | int count = 0; | ||
436 | GLXFBConfig *configs = glXChooseFBConfig(display(), DefaultScreen(display()), attribs_srgb, &count); | 446 | GLXFBConfig *configs = nullptr; | ||
447 | | ||||
448 | // sRGB configurations are reported to be broken on LLVMpipe. See bug #408594. | ||||
449 | if (!llvmpipe) { | ||||
450 | configs = glXChooseFBConfig(display(), DefaultScreen(display()), attribs_srgb, &count); | ||||
451 | } | ||||
437 | 452 | | |||
438 | if (count == 0) { | 453 | if (count == 0) { | ||
439 | // Try to find a double buffered non-sRGB capable configuration | 454 | // Try to find a double buffered non-sRGB capable configuration | ||
440 | configs = glXChooseFBConfig(display(), DefaultScreen(display()), attribs, &count); | 455 | configs = glXChooseFBConfig(display(), DefaultScreen(display()), attribs, &count); | ||
441 | } | 456 | } | ||
442 | 457 | | |||
443 | struct FBConfig { | 458 | struct FBConfig { | ||
444 | GLXFBConfig config; | 459 | GLXFBConfig config; | ||
▲ Show 20 Lines • Show All 505 Lines • Show Last 20 Lines |