blob: 1433fdd8a5a886eb424b7a9ec5c1a2101f92e23e [file] [log] [blame]
Arun Kumar K.R2b75da32016-11-11 14:37:20 -08001/*
Pullakavi Srinivas17495f12019-09-16 20:25:20 +05302 * Copyright (c) 2016, 2019 The Linux Foundation. All rights reserved.
Arun Kumar K.R2b75da32016-11-11 14:37:20 -08003 * Not a Contribution.
4 *
5 * Copyright 2015 The Android Open Source Project
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19
20#ifndef __EGLIMAGE_BUFFER_H__
21#define __EGLIMAGE_BUFFER_H__
22
23#include <cutils/native_handle.h>
24#include <gralloc_priv.h>
25#include <ui/GraphicBuffer.h>
26#include "engine.h"
27
28class EGLImageBuffer {
29 // android::sp<android::GraphicBuffer> graphicBuffer;
30 void *eglImageID;
31 int width;
32 int height;
33 uint textureID;
34 uint renderbufferID;
35 uint framebufferID;
36
37 public:
38 int getWidth();
39 int getHeight();
40 EGLImageBuffer(android::sp<android::GraphicBuffer>);
Pullakavi Srinivas17495f12019-09-16 20:25:20 +053041 unsigned int getTexture(int target);
Arun Kumar K.R2b75da32016-11-11 14:37:20 -080042 unsigned int getFramebuffer();
Pullakavi Srinivas17495f12019-09-16 20:25:20 +053043 void bindAsTexture(int target);
Arun Kumar K.R2b75da32016-11-11 14:37:20 -080044 void bindAsFramebuffer();
45 ~EGLImageBuffer();
46 static EGLImageBuffer *from(const private_handle_t *src);
47 static void clear();
48};
49
Pullakavi Srinivas17495f12019-09-16 20:25:20 +053050#endif //__EGLIMAGE_BUFFER_H_