blob: c437606cdb482408816e2a694e24be27755b81a1 [file] [log] [blame]
Alex Sakhartchoukfb6b6142010-05-21 12:53:13 -07001/*
2 * Copyright (C) 2009 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#ifndef ANDROID_RS_CONTEXT_HOST_STUB_H
18#define ANDROID_RS_CONTEXT_HOST_STUB_H
19
20#include "rsUtils.h"
21//#include "rsMutex.h"
22
23//#include "rsThreadIO.h"
24#include "rsType.h"
25#include "rsMatrix.h"
26#include "rsAllocation.h"
Alex Sakhartchoukfb6b6142010-05-21 12:53:13 -070027#include "rsMesh.h"
28//#include "rsDevice.h"
29#include "rsScriptC.h"
30#include "rsAllocation.h"
31#include "rsAdapter.h"
32#include "rsSampler.h"
33#include "rsLight.h"
34#include "rsProgramFragment.h"
35#include "rsProgramStore.h"
36#include "rsProgramRaster.h"
37#include "rsProgramVertex.h"
38#include "rsShaderCache.h"
39#include "rsVertexArray.h"
40
41//#include "rsgApiStructs.h"
42//#include "rsLocklessFifo.h"
43
44//#include <ui/egl/android_natives.h>
45
46// ---------------------------------------------------------------------------
47namespace android {
48
49namespace renderscript {
50
51class Device;
52
53class Context
54{
55public:
56 Context(Device *, bool isGraphics, bool useDepth) {
57 mObjHead = NULL;
58 }
59 ~Context() {
60 }
61
62
63 //StructuredAllocationContext mStateAllocation;
64 ElementState mStateElement;
65 TypeState mStateType;
66 SamplerState mStateSampler;
67 //ProgramFragmentState mStateFragment;
68 ProgramStoreState mStateFragmentStore;
69 //ProgramRasterState mStateRaster;
70 //ProgramVertexState mStateVertex;
71 LightState mStateLight;
72 VertexArrayState mStateVertexArray;
73
74 //ScriptCState mScriptC;
75 ShaderCache mShaderCache;
76
77
78 //bool setupCheck();
79 bool checkDriver() const {return false;}
80
81 ProgramFragment * getDefaultProgramFragment() const {
82 return NULL;
83 }
84 ProgramVertex * getDefaultProgramVertex() const {
85 return NULL;
86 }
87 ProgramStore * getDefaultProgramStore() const {
88 return NULL;
89 }
90 ProgramRaster * getDefaultProgramRaster() const {
91 return NULL;
92 }
93
94 uint32_t getWidth() const {return 0;}
95 uint32_t getHeight() const {return 0;}
96
97 // Timers
98 enum Timers {
99 RS_TIMER_IDLE,
100 RS_TIMER_INTERNAL,
101 RS_TIMER_SCRIPT,
102 RS_TIMER_CLEAR_SWAP,
103 _RS_TIMER_TOTAL
104 };
105
106 bool checkVersion1_1() const {return false; }
107 bool checkVersion2_0() const {return false; }
108
109 struct {
110 bool mLogTimes;
111 bool mLogScripts;
112 bool mLogObjects;
113 bool mLogShaders;
114 } props;
115
116 void dumpDebug() const { }
117 void checkError(const char *) const { };
118 void setError(RsError e, const char *msg = NULL) { }
119
120 mutable const ObjectBase * mObjHead;
121
122 bool ext_OES_texture_npot() const {return mGL.OES_texture_npot;}
123
124protected:
125
126 struct {
127 const uint8_t * mVendor;
128 const uint8_t * mRenderer;
129 const uint8_t * mVersion;
130 const uint8_t * mExtensions;
131
132 uint32_t mMajorVersion;
133 uint32_t mMinorVersion;
134
135 int32_t mMaxVaryingVectors;
136 int32_t mMaxTextureImageUnits;
137
138 int32_t mMaxFragmentTextureImageUnits;
139 int32_t mMaxFragmentUniformVectors;
140
141 int32_t mMaxVertexAttribs;
142 int32_t mMaxVertexUniformVectors;
143 int32_t mMaxVertexTextureUnits;
144
145 bool OES_texture_npot;
146 } mGL;
147
148};
149
150}
151}
152#endif