blob: 12363360b65f05c5702eef445a8e19e568a69cb4 [file] [log] [blame]
Romain Guye4d01122010-06-16 18:44:05 -07001/*
2 * Copyright (C) 2010 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
Romain Guy85bf02f2010-06-22 13:11:24 -070017#ifndef ANDROID_OPENGL_RENDERER_H
18#define ANDROID_OPENGL_RENDERER_H
19
20#include <SkXfermode.h>
Romain Guye4d01122010-06-16 18:44:05 -070021
22namespace android {
23
Romain Guy85bf02f2010-06-22 13:11:24 -070024class OpenGLRenderer {
Romain Guye4d01122010-06-16 18:44:05 -070025public:
Romain Guy85bf02f2010-06-22 13:11:24 -070026 OpenGLRenderer();
27 ~OpenGLRenderer();
Romain Guye4d01122010-06-16 18:44:05 -070028
29 void setViewport(int width, int height);
30 void prepare();
Romain Guy08ae3172010-06-21 19:35:50 -070031
Romain Guy85bf02f2010-06-22 13:11:24 -070032 void drawColor(int color, SkXfermode::Mode mode);
Romain Guy08ae3172010-06-21 19:35:50 -070033
Romain Guy85bf02f2010-06-22 13:11:24 -070034private:
35 // Matrix used for ortho projection in shaders
36 float mOrthoMatrix[16];
Romain Guye4d01122010-06-16 18:44:05 -070037};
38
39}; // namespace android
40
Romain Guy85bf02f2010-06-22 13:11:24 -070041#endif // ANDROID_OPENGL_RENDERER_H