blob: 08de6465f4568ac1ffd3a8c2a9975a326dc1c292 [file] [log] [blame]
Mathias Agopian875d8e12013-06-07 15:35:48 -07001/*
2 * Copyright 2013 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
18#ifndef SF_GLES11RENDERENGINE_H_
19#define SF_GLES11RENDERENGINE_H_
20
21#include <stdint.h>
22#include <sys/types.h>
23
24#include <GLES/gl.h>
Riley Andrewsc3ebe662014-09-04 16:20:31 -070025#include <Transform.h>
Mathias Agopian875d8e12013-06-07 15:35:48 -070026
27#include "RenderEngine.h"
28
29// ---------------------------------------------------------------------------
30namespace android {
31// ---------------------------------------------------------------------------
32
33class String8;
Mathias Agopian3f844832013-08-07 21:24:32 -070034class Mesh;
Mathias Agopian49457ac2013-08-14 18:20:17 -070035class Texture;
Mathias Agopian875d8e12013-06-07 15:35:48 -070036
37class GLES11RenderEngine : public RenderEngine {
38 GLuint mProtectedTexName;
39 GLint mMaxViewportDims[2];
40 GLint mMaxTextureSize;
41
Mathias Agopian458197d2013-08-15 14:56:51 -070042 virtual void bindImageAsFramebuffer(EGLImageKHR image,
43 uint32_t* texName, uint32_t* fbName, uint32_t* status);
44 virtual void unbindFramebuffer(uint32_t texName, uint32_t fbName);
45
Mathias Agopian875d8e12013-06-07 15:35:48 -070046public:
47 GLES11RenderEngine();
48
49protected:
50 virtual ~GLES11RenderEngine();
51
52 virtual void dump(String8& result);
Dan Stozac1879002014-05-22 15:59:05 -070053 virtual void setViewportAndProjection(size_t vpw, size_t vph,
Riley Andrewsc3ebe662014-09-04 16:20:31 -070054 Rect sourceCrop, size_t hwh, bool yswap, Transform::orientation_flags rotation);
Mathias Agopian875d8e12013-06-07 15:35:48 -070055 virtual void setupLayerBlending(bool premultipliedAlpha, bool opaque, int alpha);
56 virtual void setupDimLayerBlending(int alpha);
Mathias Agopian49457ac2013-08-14 18:20:17 -070057 virtual void setupLayerTexturing(const Texture& texture);
Mathias Agopian875d8e12013-06-07 15:35:48 -070058 virtual void setupLayerBlackedOut();
Mathias Agopian19733a32013-08-28 18:13:56 -070059 virtual void setupFillWithColor(float r, float g, float b, float a) ;
Mathias Agopian875d8e12013-06-07 15:35:48 -070060 virtual void disableTexturing();
61 virtual void disableBlending();
62
Mathias Agopian3f844832013-08-07 21:24:32 -070063 virtual void drawMesh(const Mesh& mesh);
Mathias Agopian875d8e12013-06-07 15:35:48 -070064
Mathias Agopian875d8e12013-06-07 15:35:48 -070065 virtual size_t getMaxTextureSize() const;
66 virtual size_t getMaxViewportDims() const;
67};
68
69// ---------------------------------------------------------------------------
70}; // namespace android
71// ---------------------------------------------------------------------------
72
73#endif /* SF_GLES11RENDERENGINE_H_ */