egluGLContextFactory.hpp revision 3c827367444ee418f129b2c238299f49d3264554
14ee2ad04344446e610172a0e73949212923014dfSebastian Redl#ifndef _EGLUGLCONTEXTFACTORY_HPP
22cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor#define _EGLUGLCONTEXTFACTORY_HPP
32cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor/*-------------------------------------------------------------------------
42cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * drawElements Quality Program Tester Core
52cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * ----------------------------------------
62cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor *
72cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * Copyright 2014 The Android Open Source Project
82cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor *
92cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * Licensed under the Apache License, Version 2.0 (the "License");
10a4232eb646d89e7d52424bb42eb87d9061f39e63Sebastian Redl * you may not use this file except in compliance with the License.
112cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * You may obtain a copy of the License at
122cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor *
132cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor *      http://www.apache.org/licenses/LICENSE-2.0
147faa2ec03a7ef120ac165bb45b6c70a8b20c9f1cSebastian Redl *
150eca89e9890db4d8336ce762a5b359a1d58ca02bArgyrios Kyrtzidis * Unless required by applicable law or agreed to in writing, software
16e737f5041a36d0befb39ffeed8d50ba15916d3daDouglas Gregor * distributed under the License is distributed on an "AS IS" BASIS,
17e737f5041a36d0befb39ffeed8d50ba15916d3daDouglas Gregor * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
182cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * See the License for the specific language governing permissions and
192cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * limitations under the License.
202cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor *
212a7fb27913999d132cf9e10e03dc5271faa2e9d3John McCall *//*!
2289eaf3af92c72c0c1aae807644e39cabc461d685Argyrios Kyrtzidis * \file
230b7489194f9f89fac39d57211c1e7953ae50251fDouglas Gregor * \brief GL context factory using EGL.
247a1fad38256eb4c5129359be85ba1ea1678eb5c9John McCall *//*--------------------------------------------------------------------*/
252cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor
26a1ee0c548b8aa4aaf93d1917e304e3da13171a08John McCall#include "tcuDefs.hpp"
276ab7cd853e9c15cf986a8a7c3db1f8d20e275409Sebastian Redl#include "gluContextFactory.hpp"
287c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner#include "egluNativeDisplay.hpp"
296a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor
307c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattnernamespace tcu
3183d63c78810556d26b62ac4cbae2eda6cdd2570cSteve Naroff{
3214f79002e58556798e86168c63e48d533287eda5Douglas Gregorclass Platform;
333251ceb90b3fec68e86d6dcfa58836e20a7205c3Douglas Gregor} // tcu
3414f79002e58556798e86168c63e48d533287eda5Douglas Gregor
35bd94500d3aa60092fb0f1e90f53fb0d03fa502a8Douglas Gregornamespace eglu
362bec0410d268779f601bd509e0302a500af7ac6aDouglas Gregor{
37ab41e63821dc60ad144d0684df8d79a9eef86b75Douglas Gregor
3817fc223395d51be582fc666bb6ea21bd1dff26dcDouglas Gregor//! EGL-specific render context interface - used in OpenCL interop
3917fc223395d51be582fc666bb6ea21bd1dff26dcDouglas Gregorclass GLRenderContext : public glu::RenderContext
402596e429a61602312bdd149786045b8a90cd2d10Daniel Dunbar{
412cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregorpublic:
4214f79002e58556798e86168c63e48d533287eda5Douglas Gregor	virtual EGLDisplay						getEGLDisplay		(void) const = 0;
43b64c19365deab788753d29c9bc881253c3f16f37Douglas Gregor	virtual EGLContext						getEGLContext		(void) const = 0;
443c304bd9ec2b4611572d4cbae9e1727bbecb5dc9Chris Lattner};
452cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor
468538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redlclass GLContextFactory : public glu::ContextFactory
472cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor{
48ade5000c8763f4bec41f452d7efa3a9b2a6d4712Sebastian Redlpublic:
49ade5000c8763f4bec41f452d7efa3a9b2a6d4712Sebastian Redl											GLContextFactory	(const NativeDisplayFactoryRegistry& displayFactoryRegistry);
50ade5000c8763f4bec41f452d7efa3a9b2a6d4712Sebastian Redl	virtual glu::RenderContext*				createContext		(const glu::RenderConfig& config, const tcu::CommandLine& cmdLine) const;
51ade5000c8763f4bec41f452d7efa3a9b2a6d4712Sebastian Redl
52ade5000c8763f4bec41f452d7efa3a9b2a6d4712Sebastian Redlprivate:
53ade5000c8763f4bec41f452d7efa3a9b2a6d4712Sebastian Redl	const NativeDisplayFactoryRegistry&		m_displayFactoryRegistry;
54ade5000c8763f4bec41f452d7efa3a9b2a6d4712Sebastian Redl};
55ade5000c8763f4bec41f452d7efa3a9b2a6d4712Sebastian Redl
56ade5000c8763f4bec41f452d7efa3a9b2a6d4712Sebastian Redl} // eglu
572cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor
582cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor#endif // _EGLUGLCONTEXTFACTORY_HPP
592cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor