1 /*
2  * Copyright 2014 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef OPENGL_TESTS_WINDOWSURFACE_H
18 #define OPENGL_TESTS_WINDOWSURFACE_H
19 
20 #include <gui/SurfaceControl.h>
21 
22 #include <EGL/egl.h>
23 
24 
25 /*
26  * A window that covers the entire display surface.
27  *
28  * The window is destroyed when this object is destroyed, so don't try
29  * to use the surface after that point.
30  */
31 class WindowSurface {
32 public:
33     // Creates the window.
34     WindowSurface();
35 
36     // Retrieves a handle to the window.
37     EGLNativeWindowType getSurface() const;
38 
39 private:
40     WindowSurface(const WindowSurface&) = delete;
41     WindowSurface& operator=(const WindowSurface&) = delete;
42 
43     android::sp<android::SurfaceControl> mSurfaceControl;
44 };
45 
46 #endif /* OPENGL_TESTS_WINDOWSURFACE_H */
47