GLES11RenderEngine.h revision 875d8e1323536e16dcfc90c9674d7ad32116a69a
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// ---------------------------------------------------------------------------
29namespace android {
30// ---------------------------------------------------------------------------
31
32class String8;
33
34class GLES11RenderEngine : public RenderEngine {
35    GLuint mProtectedTexName;
36    GLint mMaxViewportDims[2];
37    GLint mMaxTextureSize;
38
39public:
40    GLES11RenderEngine();
41
42protected:
43    virtual ~GLES11RenderEngine();
44
45    virtual void dump(String8& result);
46    virtual void setViewportAndProjection(size_t w, size_t h);
47    virtual void setupLayerBlending(bool premultipliedAlpha, bool opaque, int alpha);
48    virtual void setupDimLayerBlending(int alpha);
49    virtual void setupLayerTexturing(size_t textureName, bool useFiltering, const float* textureMatrix);
50    virtual void setupLayerBlackedOut();
51    virtual void disableTexturing();
52    virtual void disableBlending();
53
54    virtual void clearWithColor(const float vertices[][2], size_t count,
55        float red, float green, float blue, float alpha);
56
57    virtual void drawMesh2D(const float vertices[][2], const float texCoords[][2], size_t count);
58
59    virtual size_t getMaxTextureSize() const;
60    virtual size_t getMaxViewportDims() const;
61};
62
63// ---------------------------------------------------------------------------
64}; // namespace android
65// ---------------------------------------------------------------------------
66
67#endif /* SF_GLES11RENDERENGINE_H_ */
68