xref: /aosp_15_r20/external/angle/src/libANGLE/renderer/gl/glx/glx_utils.cpp (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1 //
2 // Copyright 2020 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 
7 // glx_utils.cpp: Utility routines specific to the G:X->EGL implementation.
8 
9 #include "libANGLE/renderer/gl/glx/glx_utils.h"
10 
11 #include "common/angleutils.h"
12 
13 namespace rx
14 {
15 
16 namespace x11
17 {
18 
XErrorToString(Display * display,int status)19 std::string XErrorToString(Display *display, int status)
20 {
21     // Write nulls to the buffer so that if XGetErrorText fails, converting to an std::string will
22     // be an empty string.
23     char buffer[256] = {0};
24     XGetErrorText(display, status, buffer, ArraySize(buffer));
25     return std::string(buffer);
26 }
27 
28 }  // namespace x11
29 
30 }  // namespace rx
31