1 #ifndef _EGLUUNIQUE_HPP
2 #define _EGLUUNIQUE_HPP
3 /*-------------------------------------------------------------------------
4 * drawElements Quality Program Tester Core
5 * ----------------------------------------
7 * Copyright 2014 The Android Open Source Project
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
23 * \brief EGL unique resources
24 *//*--------------------------------------------------------------------*/
26 #include "egluDefs.hpp"
27 #include "eglwDefs.hpp"
40 UniqueDisplay (const eglw::Library& egl, eglw::EGLDisplay display);
41 ~UniqueDisplay (void);
43 eglw::EGLDisplay operator* (void) const { return m_display; }
44 operator bool (void) const;
47 const eglw::Library& m_egl;
48 eglw::EGLDisplay m_display;
51 UniqueDisplay& operator= (const UniqueDisplay&);
52 UniqueDisplay (const UniqueDisplay&);
58 UniqueSurface (const eglw::Library& egl, eglw::EGLDisplay display, eglw::EGLSurface surface);
59 ~UniqueSurface (void);
61 eglw::EGLSurface operator* (void) const { return m_surface; }
62 operator bool (void) const;
65 const eglw::Library& m_egl;
66 eglw::EGLDisplay m_display;
67 eglw::EGLSurface m_surface;
70 UniqueSurface& operator= (const UniqueSurface&);
71 UniqueSurface (const UniqueSurface&);
77 UniqueContext (const eglw::Library& egl, eglw::EGLDisplay display, eglw::EGLContext context);
78 ~UniqueContext (void);
80 eglw::EGLContext operator* (void) const { return m_context; }
81 operator bool (void) const;
84 const eglw::Library& m_egl;
85 eglw::EGLDisplay m_display;
86 eglw::EGLContext m_context;
89 UniqueContext operator= (const UniqueContext&);
90 UniqueContext (const UniqueContext&);
93 class ScopedCurrentContext
96 ScopedCurrentContext (const eglw::Library& egl, eglw::EGLDisplay display, eglw::EGLSurface draw, eglw::EGLSurface read, eglw::EGLContext context);
97 ~ScopedCurrentContext (void);
100 const eglw::Library& m_egl;
101 eglw::EGLDisplay m_display;
107 UniqueImage (const eglw::Library& egl, eglw::EGLDisplay display, eglw::EGLImage image);
110 eglw::EGLImage operator* (void) const { return m_image; }
111 operator bool (void) const;
114 const eglw::Library& m_egl;
115 eglw::EGLDisplay m_display;
116 eglw::EGLImage m_image;
119 UniqueImage operator= (const UniqueImage&);
120 UniqueImage (const UniqueImage&);
125 #endif // _EGLUUNIQUE_HPP