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
24namespace android {
25
26/*
27 * A window that covers the entire display surface.
28 *
29 * The window is destroyed when this object is destroyed, so don't try
30 * to use the surface after that point.
31 */
32class WindowSurface {
33public:
34    // Creates the window.
35    WindowSurface();
36
37    // Retrieves a handle to the window.
38    EGLNativeWindowType getSurface() const;
39
40private:
41    WindowSurface(const WindowSurface&);
42    WindowSurface& operator=(const WindowSurface&);
43
44    sp<SurfaceControl> mSurfaceControl;
45};
46
47} // namespace android
48
49#endif /* OPENGL_TESTS_WINDOWSURFACE_H */
50