blob: fdaa53343c4f0b96aaed49037e1157eabcec654e [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,
Dan Stoza9e56aa02015-11-02 13:00:03 -080054 Rect sourceCrop, size_t hwh, bool yswap,
55 Transform::orientation_flags rotation);
Dan Stoza9e56aa02015-11-02 13:00:03 -080056 virtual void setupLayerBlending(bool premultipliedAlpha, bool opaque,
57 float alpha) override;
58 virtual void setupDimLayerBlending(float alpha) override;
Mathias Agopian49457ac2013-08-14 18:20:17 -070059 virtual void setupLayerTexturing(const Texture& texture);
Mathias Agopian875d8e12013-06-07 15:35:48 -070060 virtual void setupLayerBlackedOut();
Mathias Agopian19733a32013-08-28 18:13:56 -070061 virtual void setupFillWithColor(float r, float g, float b, float a) ;
Mathias Agopian875d8e12013-06-07 15:35:48 -070062 virtual void disableTexturing();
63 virtual void disableBlending();
64
Mathias Agopian3f844832013-08-07 21:24:32 -070065 virtual void drawMesh(const Mesh& mesh);
Mathias Agopian875d8e12013-06-07 15:35:48 -070066
Mathias Agopian875d8e12013-06-07 15:35:48 -070067 virtual size_t getMaxTextureSize() const;
68 virtual size_t getMaxViewportDims() const;
69};
70
71// ---------------------------------------------------------------------------
72}; // namespace android
73// ---------------------------------------------------------------------------
74
75#endif /* SF_GLES11RENDERENGINE_H_ */