1 #ifndef _TEGLIMAGEUTIL_HPP
2 #define _TEGLIMAGEUTIL_HPP
3 /*-------------------------------------------------------------------------
4 * drawElements Quality Program EGL Module
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 Common utilities for EGL images.
24 *//*--------------------------------------------------------------------*/
26 #include "tcuDefs.hpp"
27 #include "tcuTexture.hpp"
29 #include "deUniquePtr.hpp"
31 #include "teglTestCase.hpp"
33 #include "egluUtil.hpp"
34 #include "egluUnique.hpp"
36 #include "glwDefs.hpp"
53 ManagedSurface (de::MovePtr<eglu::UniqueSurface> surface) : m_surface(surface) {}
54 virtual ~ManagedSurface (void) {}
55 eglw::EGLSurface get (void) const { return **m_surface; }
58 de::UniquePtr<eglu::UniqueSurface> m_surface;
61 de::MovePtr<ManagedSurface> createSurface (EglTestContext& eglTestCtx, eglw::EGLDisplay display, eglw::EGLConfig config, int width, int height);
66 virtual ~ClientBuffer (void) {}
67 virtual eglw::EGLClientBuffer get (void) const = 0;
73 virtual ~ImageSource (void) {}
74 virtual std::string getRequiredExtension(void) const = 0;
75 virtual de::MovePtr<ClientBuffer> createBuffer (const glw::Functions& gl, tcu::Texture2D* reference = DE_NULL) const = 0;
76 virtual eglw::EGLImageKHR createImage (const eglw::Library& egl, eglw::EGLDisplay dpy, eglw::EGLContext ctx, eglw::EGLClientBuffer clientBuffer) const = 0;
77 virtual glw::GLenum getEffectiveFormat (void) const = 0;
80 de::MovePtr<ImageSource> createTextureImageSource (eglw::EGLenum source, glw::GLenum internalFormat, glw::GLenum format, glw::GLenum type, bool useTexLevel0 = false);
81 de::MovePtr<ImageSource> createRenderbufferImageSource (glw::GLenum format);
82 de::MovePtr<ImageSource> createUnsupportedImageSource (const std::string& message, glw::GLenum format);
89 #endif // _TEGLIMAGEUTIL_HPP