Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | // |
michael@0 | 2 | // Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved. |
michael@0 | 3 | // Use of this source code is governed by a BSD-style license that can be |
michael@0 | 4 | // found in the LICENSE file. |
michael@0 | 5 | // |
michael@0 | 6 | |
michael@0 | 7 | // main.h: Management of thread-local data. |
michael@0 | 8 | |
michael@0 | 9 | #ifndef LIBGLESV2_MAIN_H_ |
michael@0 | 10 | #define LIBGLESV2_MAIN_H_ |
michael@0 | 11 | |
michael@0 | 12 | #include "common/debug.h" |
michael@0 | 13 | #include "common/system.h" |
michael@0 | 14 | |
michael@0 | 15 | namespace egl |
michael@0 | 16 | { |
michael@0 | 17 | class Display; |
michael@0 | 18 | class Surface; |
michael@0 | 19 | } |
michael@0 | 20 | |
michael@0 | 21 | namespace gl |
michael@0 | 22 | { |
michael@0 | 23 | class Context; |
michael@0 | 24 | |
michael@0 | 25 | struct Current |
michael@0 | 26 | { |
michael@0 | 27 | Context *context; |
michael@0 | 28 | egl::Display *display; |
michael@0 | 29 | }; |
michael@0 | 30 | |
michael@0 | 31 | void makeCurrent(Context *context, egl::Display *display, egl::Surface *surface); |
michael@0 | 32 | |
michael@0 | 33 | Context *getContext(); |
michael@0 | 34 | Context *getNonLostContext(); |
michael@0 | 35 | egl::Display *getDisplay(); |
michael@0 | 36 | |
michael@0 | 37 | void error(GLenum errorCode); |
michael@0 | 38 | |
michael@0 | 39 | template<class T> |
michael@0 | 40 | const T &error(GLenum errorCode, const T &returnValue) |
michael@0 | 41 | { |
michael@0 | 42 | error(errorCode); |
michael@0 | 43 | |
michael@0 | 44 | return returnValue; |
michael@0 | 45 | } |
michael@0 | 46 | |
michael@0 | 47 | } |
michael@0 | 48 | |
michael@0 | 49 | namespace rx |
michael@0 | 50 | { |
michael@0 | 51 | class Renderer; |
michael@0 | 52 | } |
michael@0 | 53 | |
michael@0 | 54 | extern "C" |
michael@0 | 55 | { |
michael@0 | 56 | // Exported functions for use by EGL |
michael@0 | 57 | gl::Context *glCreateContext(const gl::Context *shareContext, rx::Renderer *renderer, bool notifyResets, bool robustAccess); |
michael@0 | 58 | void glDestroyContext(gl::Context *context); |
michael@0 | 59 | void glMakeCurrent(gl::Context *context, egl::Display *display, egl::Surface *surface); |
michael@0 | 60 | gl::Context *glGetCurrentContext(); |
michael@0 | 61 | rx::Renderer *glCreateRenderer(egl::Display *display, HDC hDc, EGLNativeDisplayType displayId); |
michael@0 | 62 | void glDestroyRenderer(rx::Renderer *renderer); |
michael@0 | 63 | |
michael@0 | 64 | __eglMustCastToProperFunctionPointerType __stdcall glGetProcAddress(const char *procname); |
michael@0 | 65 | bool __stdcall glBindTexImage(egl::Surface *surface); |
michael@0 | 66 | } |
michael@0 | 67 | |
michael@0 | 68 | #endif // LIBGLESV2_MAIN_H_ |