[SyncFS] Build indexes from FileTracker entries on disk.
[chromium-blink-merge.git] / content / common / gpu / x_util.h
blobc7591e26c615878881031cf65d0495d3656e2cee
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_GPU_X_UTIL_H_
6 #define CHROME_GPU_X_UTIL_H_
8 // Some X-Windows specific stuff. This can be included on any platform, and will
9 // be a NOP on non-Linux ones.
11 #include "build/build_config.h"
12 #include "content/common/gpu/gpu_config.h"
14 #if defined(USE_X11)
16 namespace content {
18 // Forward declares ------------------------------------------------------------
20 // X Windows headers do a lot of evil stuff, like "#define Status int" which
21 // will cause many problems when combined with our other header files (like
22 // ones that define a class local enum called "Status."
24 // These definitions are not Kosher, but allow us to remove this dependency and
25 // actually compile X at all.
27 typedef unsigned long XID;
29 extern "C" {
31 typedef struct _XDisplay Display;
32 typedef struct __GLXcontextRec *GLXContext;
34 } // extern "C"
36 // Utils -----------------------------------------------------------------------
38 // scoped_ptr functor for XFree(). Use as follows:
39 // scoped_ptr_mallox<XVisualInfo, ScopedPtrXFree> foo(...);
40 // where "XVisualInfo" is any X type that is freed with XFree.
41 class ScopedPtrXFree {
42 public:
43 void operator()(void* x) const;
46 } // namespace content
48 #endif // USE_X11
50 #endif // CHROME_GPU_X_UTIL_H_