OSDN Git Service

Merge "Add new system APK locations." into lmp-dev
[android-x86/frameworks-native.git] / services / surfaceflinger / RenderEngine / GLES11RenderEngine.h
1 /*
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 // ---------------------------------------------------------------------------
29 namespace android {
30 // ---------------------------------------------------------------------------
31
32 class String8;
33 class Mesh;
34 class Texture;
35
36 class GLES11RenderEngine : public RenderEngine {
37     GLuint mProtectedTexName;
38     GLint mMaxViewportDims[2];
39     GLint mMaxTextureSize;
40
41     virtual void bindImageAsFramebuffer(EGLImageKHR image,
42             uint32_t* texName, uint32_t* fbName, uint32_t* status);
43     virtual void unbindFramebuffer(uint32_t texName, uint32_t fbName);
44
45 public:
46     GLES11RenderEngine();
47
48 protected:
49     virtual ~GLES11RenderEngine();
50
51     virtual void dump(String8& result);
52     virtual void setViewportAndProjection(size_t vpw, size_t vph,
53             Rect sourceCrop, size_t hwh, bool yswap);
54     virtual void setupLayerBlending(bool premultipliedAlpha, bool opaque, int alpha);
55     virtual void setupDimLayerBlending(int alpha);
56     virtual void setupLayerTexturing(const Texture& texture);
57     virtual void setupLayerBlackedOut();
58     virtual void setupFillWithColor(float r, float g, float b, float a) ;
59     virtual void disableTexturing();
60     virtual void disableBlending();
61
62     virtual void drawMesh(const Mesh& mesh);
63
64     virtual void beginGroup(const mat4& colorTransform);
65     virtual void endGroup();
66
67     virtual size_t getMaxTextureSize() const;
68     virtual size_t getMaxViewportDims() const;
69 };
70
71 // ---------------------------------------------------------------------------
72 }; // namespace android
73 // ---------------------------------------------------------------------------
74
75 #endif /* SF_GLES11RENDERENGINE_H_ */