blob: f55aa59a8a1b200caa8e018c929b9214dd216a3c [file] [log] [blame]
Chia-I Wu401ef832017-12-01 10:52:22 -08001/*
2 * Copyright 2017 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#pragma once
18
19#include <cstdint>
20
21#include <EGL/egl.h>
22#include <EGL/eglext.h>
23
24struct ANativeWindowBuffer;
25
26namespace android {
27
28class RenderEngine;
29
30namespace RE {
31
32class Image {
33public:
34 Image(const RenderEngine& engine);
35 ~Image();
36
37 Image(const Image&) = delete;
38 Image& operator=(const Image&) = delete;
39
40 bool setNativeWindowBuffer(ANativeWindowBuffer* buffer, bool isProtected, int32_t cropWidth,
41 int32_t cropHeight);
42
43private:
44 // methods internal to RenderEngine
45 friend class android::RenderEngine;
46 EGLSurface getEGLImage() const { return mEGLImage; }
47
48 EGLDisplay mEGLDisplay;
49 EGLImageKHR mEGLImage = EGL_NO_IMAGE_KHR;
50};
51
52} // namespace RE
53} // namespace android