~elementary-os/elementaryos/os-patch-mutter-bionic

« back to all changes in this revision

Viewing changes to cogl/cogl/cogl-glx-renderer-private.h

  • Committer: RabbitBot
  • Date: 2018-04-11 14:49:36 UTC
  • Revision ID: rabbitbot@elementary.io-20180411144936-hgymqa9d8d1xfpbh
Initial import, version 3.28.0-2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Cogl
 
3
 *
 
4
 * A Low Level GPU Graphics and Utilities API
 
5
 *
 
6
 * Copyright (C) 2011 Intel Corporation.
 
7
 *
 
8
 * Permission is hereby granted, free of charge, to any person
 
9
 * obtaining a copy of this software and associated documentation
 
10
 * files (the "Software"), to deal in the Software without
 
11
 * restriction, including without limitation the rights to use, copy,
 
12
 * modify, merge, publish, distribute, sublicense, and/or sell copies
 
13
 * of the Software, and to permit persons to whom the Software is
 
14
 * furnished to do so, subject to the following conditions:
 
15
 *
 
16
 * The above copyright notice and this permission notice shall be
 
17
 * included in all copies or substantial portions of the Software.
 
18
 *
 
19
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 
20
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
21
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 
22
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 
23
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 
24
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 
25
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 
26
 * SOFTWARE.
 
27
 *
 
28
 *
 
29
 */
 
30
 
 
31
#ifndef __COGL_RENDERER_GLX_PRIVATE_H
 
32
#define __COGL_RENDERER_GLX_PRIVATE_H
 
33
 
 
34
#include <gmodule.h>
 
35
#include "cogl-object-private.h"
 
36
#include "cogl-xlib-renderer-private.h"
 
37
 
 
38
typedef struct _CoglGLXRenderer
 
39
{
 
40
  int glx_major;
 
41
  int glx_minor;
 
42
 
 
43
  int glx_error_base;
 
44
  int glx_event_base;
 
45
 
 
46
  /* Vblank stuff */
 
47
  int dri_fd;
 
48
 
 
49
  /* enumeration with relatioship between OML_sync_control
 
50
   * UST (unadjusted-system-time) and the system clock */
 
51
  enum {
 
52
    COGL_GLX_UST_IS_UNKNOWN,
 
53
    COGL_GLX_UST_IS_GETTIMEOFDAY,
 
54
    COGL_GLX_UST_IS_MONOTONIC_TIME,
 
55
    COGL_GLX_UST_IS_OTHER
 
56
  } ust_type;
 
57
 
 
58
  /* GModule pointing to libGL which we use to get glX functions out of */
 
59
  GModule *libgl_module;
 
60
 
 
61
  CoglClosure *flush_notifications_idle;
 
62
 
 
63
  /* Copy of the winsys features that are based purely on the
 
64
   * information we can get without using a GL context. We want to
 
65
   * determine this before we have a context so that we can use the
 
66
   * function pointers from the extensions earlier. This is necessary
 
67
   * to use the glXCreateContextAttribs function. */
 
68
  unsigned long base_winsys_features
 
69
    [COGL_FLAGS_N_LONGS_FOR_SIZE (COGL_WINSYS_FEATURE_N_FEATURES)];
 
70
 
 
71
  CoglFeatureFlags legacy_feature_flags;
 
72
 
 
73
  /* Function pointers for core GLX functionality. We can't just link
 
74
     against these directly because we need to conditionally load
 
75
     libGL when we are using GLX so that it won't conflict with a GLES
 
76
     library if we are using EGL + GLES. These are just the functions
 
77
     that we want to use before calling glXGetProcAddress */
 
78
  Bool
 
79
  (* glXQueryExtension) (Display *dpy, int *errorb, int *event);
 
80
  const char *
 
81
  (* glXQueryExtensionsString) (Display *dpy, int screen);
 
82
  Bool
 
83
  (* glXQueryVersion) (Display *dpy, int *maj, int *min);
 
84
  void *
 
85
  (* glXGetProcAddress) (const GLubyte *procName);
 
86
 
 
87
  int
 
88
  (* glXQueryDrawable) (Display *dpy, GLXDrawable drawable,
 
89
                        int attribute, unsigned int *value);
 
90
 
 
91
  /* Function pointers for GLX specific extensions */
 
92
#define COGL_WINSYS_FEATURE_BEGIN(a, b, c, d, e, f, g)
 
93
 
 
94
#define COGL_WINSYS_FEATURE_FUNCTION(ret, name, args) \
 
95
  ret (APIENTRY * name) args;
 
96
 
 
97
#define COGL_WINSYS_FEATURE_END()
 
98
 
 
99
#include "cogl-winsys-glx-feature-functions.h"
 
100
 
 
101
#undef COGL_WINSYS_FEATURE_BEGIN
 
102
#undef COGL_WINSYS_FEATURE_FUNCTION
 
103
#undef COGL_WINSYS_FEATURE_END
 
104
} CoglGLXRenderer;
 
105
 
 
106
#endif /* __COGL_RENDERER_GLX_PRIVATE_H */