blob: d20ff1c1818ca7f95a46bc2ef9ec9e9e7162961e [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>
25
26#include "RenderEngine.h"
27
28// ---------------------------------------------------------------------------
29namespace android {
30// ---------------------------------------------------------------------------
31
32class String8;
Mathias Agopian3f844832013-08-07 21:24:32 -070033class Mesh;
Mathias Agopian875d8e12013-06-07 15:35:48 -070034
35class GLES11RenderEngine : public RenderEngine {
36 GLuint mProtectedTexName;
37 GLint mMaxViewportDims[2];
38 GLint mMaxTextureSize;
39
Mathias Agopian458197d2013-08-15 14:56:51 -070040 virtual void bindImageAsFramebuffer(EGLImageKHR image,
41 uint32_t* texName, uint32_t* fbName, uint32_t* status);
42 virtual void unbindFramebuffer(uint32_t texName, uint32_t fbName);
43
Mathias Agopian875d8e12013-06-07 15:35:48 -070044public:
45 GLES11RenderEngine();
46
47protected:
48 virtual ~GLES11RenderEngine();
49
50 virtual void dump(String8& result);
Mathias Agopian3f844832013-08-07 21:24:32 -070051 virtual void setViewportAndProjection(size_t vpw, size_t vph, size_t w, size_t h, bool yswap);
Mathias Agopian875d8e12013-06-07 15:35:48 -070052 virtual void setupLayerBlending(bool premultipliedAlpha, bool opaque, int alpha);
53 virtual void setupDimLayerBlending(int alpha);
54 virtual void setupLayerTexturing(size_t textureName, bool useFiltering, const float* textureMatrix);
55 virtual void setupLayerBlackedOut();
56 virtual void disableTexturing();
57 virtual void disableBlending();
58
Mathias Agopian3f844832013-08-07 21:24:32 -070059 virtual void fillWithColor(const Mesh& mesh, float r, float g, float b, float a) ;
60 virtual void drawMesh(const Mesh& mesh);
Mathias Agopian875d8e12013-06-07 15:35:48 -070061
62 virtual size_t getMaxTextureSize() const;
63 virtual size_t getMaxViewportDims() const;
64};
65
66// ---------------------------------------------------------------------------
67}; // namespace android
68// ---------------------------------------------------------------------------
69
70#endif /* SF_GLES11RENDERENGINE_H_ */