1 /*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 #ifndef _EGL_CONTEXT_H
17 #define _EGL_CONTEXT_H
18 
19 #include "gfxstream/guest/GLClientState.h"
20 #include "gfxstream/guest/GLSharedGroup.h"
21 
22 #include <string>
23 #include <vector>
24 
25 struct EGLContext_t {
26 
27     enum {
28         IS_CURRENT      =   0x00010000,
29         NEVER_CURRENT   =   0x00020000
30     };
31 
32     EGLContext_t(EGLDisplay dpy, EGLConfig config, EGLContext_t* shareCtx, int maj, int min);
33     ~EGLContext_t();
34     uint32_t            flags;
35     EGLDisplay          dpy;
36     EGLConfig           config;
37     EGLSurface          read;
38     EGLSurface          draw;
39     EGLSurface          dummy_surface;
40     EGLContext_t    *   shareCtx;
41     uint32_t            rcContext;
42     const char*         versionString;
43     EGLint              majorVersion;
44     EGLint              minorVersion;
45     EGLint              deviceMajorVersion;
46     EGLint              deviceMinorVersion;
47     const char*         vendorString;
48     const char*         rendererString;
49     const char*         shaderVersionString;
50     const char*         extensionString;
51     std::vector<std::string> extensionStringArray;
52     EGLint              deletePending;
getClientStateEGLContext_t53     gfxstream::guest::GLClientState * getClientState(){ return clientState; }
getSharedGroupEGLContext_t54     gfxstream::guest::GLSharedGroupPtr getSharedGroup(){ return sharedGroup; }
55     int getGoldfishSyncFd();
56 private:
57     gfxstream::guest::GLClientState    *    clientState;
58     gfxstream::guest::GLSharedGroupPtr      sharedGroup;
59     int goldfishSyncFd;
60 };
61 
62 #endif
63