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 "GLClientState.h" 20 #include "GLSharedGroup.h" 21 22 struct EGLContext_t { 23 24 enum { 25 IS_CURRENT = 0x00010000, 26 NEVER_CURRENT = 0x00020000 27 }; 28 29 EGLContext_t(EGLDisplay dpy, EGLConfig config, EGLContext_t* shareCtx, int maj, int min); 30 ~EGLContext_t(); 31 uint32_t flags; 32 EGLDisplay dpy; 33 EGLConfig config; 34 EGLSurface read; 35 EGLSurface draw; 36 EGLContext_t * shareCtx; 37 uint32_t rcContext; 38 const char* versionString; 39 EGLint majorVersion; 40 EGLint minorVersion; 41 EGLint deviceMajorVersion; 42 EGLint deviceMinorVersion; 43 const char* vendorString; 44 const char* rendererString; 45 const char* shaderVersionString; 46 const char* extensionString; 47 EGLint deletePending; getClientStateEGLContext_t48 GLClientState * getClientState(){ return clientState; } getSharedGroupEGLContext_t49 GLSharedGroupPtr getSharedGroup(){ return sharedGroup; } 50 int getGoldfishSyncFd(); 51 private: 52 GLClientState * clientState; 53 GLSharedGroupPtr sharedGroup; 54 int goldfishSyncFd; 55 }; 56 57 #endif 58