1 // Copyright 2016 The SwiftShader Authors. All Rights Reserved. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #ifndef egl_Context_hpp 16 #define egl_Context_hpp 17 18 #include "common/Object.hpp" 19 20 #include <EGL/egl.h> 21 #include <GLES/gl.h> 22 23 namespace egl 24 { 25 class Surface; 26 class Image; 27 28 class Context : public gl::Object 29 { 30 public: 31 virtual void makeCurrent(Surface *surface) = 0; 32 virtual void bindTexImage(Surface *surface) = 0; 33 virtual EGLenum validateSharedImage(EGLenum target, GLuint name, GLuint textureLevel) = 0; 34 virtual Image *createSharedImage(EGLenum target, GLuint name, GLuint textureLevel) = 0; 35 virtual int getClientVersion() const = 0; 36 virtual void finish() = 0; 37 38 protected: ~Context()39 virtual ~Context() {}; 40 }; 41 } 42 43 #endif // egl_Context_hpp 44