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 #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 EGLContext_t * shareCtx; 40 uint32_t rcContext; 41 const char* versionString; 42 EGLint majorVersion; 43 EGLint minorVersion; 44 EGLint deviceMajorVersion; 45 EGLint deviceMinorVersion; 46 const char* vendorString; 47 const char* rendererString; 48 const char* shaderVersionString; 49 const char* extensionString; 50 std::vector<std::string> extensionStringArray; 51 EGLint deletePending; getClientStateEGLContext_t52 GLClientState * getClientState(){ return clientState; } getSharedGroupEGLContext_t53 GLSharedGroupPtr getSharedGroup(){ return sharedGroup; } 54 int getGoldfishSyncFd(); 55 private: 56 GLClientState * clientState; 57 GLSharedGroupPtr sharedGroup; 58 int goldfishSyncFd; 59 }; 60 61 #endif 62