blob: 7e8ec3972696ddf439f685ec11b5c1c1931056cf [file] [log] [blame]
Alex Sakhartchoukaa7d2882010-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"
Alex Sakhartchoukaa7d2882010-05-21 12:53:13 -070021#include "rsType.h"
Alex Sakhartchoukaa7d2882010-05-21 12:53:13 -070022#include "rsAllocation.h"
Alex Sakhartchoukaa7d2882010-05-21 12:53:13 -070023#include "rsMesh.h"
Alex Sakhartchoukaa7d2882010-05-21 12:53:13 -070024#include "rsAllocation.h"
Alex Sakhartchoukaa7d2882010-05-21 12:53:13 -070025
26// ---------------------------------------------------------------------------
27namespace android {
Alex Sakhartchoukaa7d2882010-05-21 12:53:13 -070028namespace renderscript {
29
Alex Sakhartchouka3b59602011-01-28 09:31:47 -080030#define CHECK_OBJ(o)
31#define CHECK_OBJ_OR_NULL(o)
32
Alex Sakhartchoukaa7d2882010-05-21 12:53:13 -070033class Device;
34
Alex Sakhartchouked9f2102010-11-09 17:00:54 -080035class Context {
Alex Sakhartchoukaa7d2882010-05-21 12:53:13 -070036public:
37 Context(Device *, bool isGraphics, bool useDepth) {
38 mObjHead = NULL;
39 }
40 ~Context() {
41 }
42
Alex Sakhartchoukaa7d2882010-05-21 12:53:13 -070043 //StructuredAllocationContext mStateAllocation;
44 ElementState mStateElement;
45 TypeState mStateType;
Alex Sakhartchouk98bfe5d2010-10-18 17:18:50 -070046 RsSurfaceConfig mUserSurfaceConfig;
Alex Sakhartchoukaa7d2882010-05-21 12:53:13 -070047
48 //bool setupCheck();
Alex Sakhartchoukaa7d2882010-05-21 12:53:13 -070049
Alex Sakhartchoukaa7d2882010-05-21 12:53:13 -070050
51 uint32_t getWidth() const {return 0;}
52 uint32_t getHeight() const {return 0;}
53
54 // Timers
55 enum Timers {
56 RS_TIMER_IDLE,
57 RS_TIMER_INTERNAL,
58 RS_TIMER_SCRIPT,
59 RS_TIMER_CLEAR_SWAP,
60 _RS_TIMER_TOTAL
61 };
62
Alex Sakhartchouka3b59602011-01-28 09:31:47 -080063 void timerSet(Timers) { }
64
Alex Sakhartchoukaa7d2882010-05-21 12:53:13 -070065 bool checkVersion1_1() const {return false; }
66 bool checkVersion2_0() const {return false; }
67
68 struct {
69 bool mLogTimes;
70 bool mLogScripts;
71 bool mLogObjects;
72 bool mLogShaders;
Alex Sakhartchoukf5b35102010-09-30 11:36:37 -070073 bool mLogShadersAttr;
74 bool mLogShadersUniforms;
75 bool mLogVisual;
Alex Sakhartchoukaa7d2882010-05-21 12:53:13 -070076 } props;
77
78 void dumpDebug() const { }
79 void checkError(const char *) const { };
80 void setError(RsError e, const char *msg = NULL) { }
81
82 mutable const ObjectBase * mObjHead;
83
84 bool ext_OES_texture_npot() const {return mGL.OES_texture_npot;}
Alex Sakhartchoukf5c876e2011-01-13 14:53:43 -080085 bool ext_GL_NV_texture_npot_2D_mipmap() const {return mGL.GL_NV_texture_npot_2D_mipmap;}
86 float ext_texture_max_aniso() const {return mGL.EXT_texture_max_aniso; }
Alex Sakhartchoukb89aaac2010-09-23 16:16:33 -070087 uint32_t getMaxFragmentTextures() const {return mGL.mMaxFragmentTextureImageUnits;}
88 uint32_t getMaxFragmentUniformVectors() const {return mGL.mMaxFragmentUniformVectors;}
89 uint32_t getMaxVertexUniformVectors() const {return mGL.mMaxVertexUniformVectors;}
Alex Sakhartchoukf5c876e2011-01-13 14:53:43 -080090 uint32_t getMaxVertexAttributes() const {return mGL.mMaxVertexAttribs;}
Alex Sakhartchoukaa7d2882010-05-21 12:53:13 -070091
92protected:
93
94 struct {
95 const uint8_t * mVendor;
96 const uint8_t * mRenderer;
97 const uint8_t * mVersion;
98 const uint8_t * mExtensions;
99
100 uint32_t mMajorVersion;
101 uint32_t mMinorVersion;
102
103 int32_t mMaxVaryingVectors;
104 int32_t mMaxTextureImageUnits;
105
106 int32_t mMaxFragmentTextureImageUnits;
107 int32_t mMaxFragmentUniformVectors;
108
109 int32_t mMaxVertexAttribs;
110 int32_t mMaxVertexUniformVectors;
111 int32_t mMaxVertexTextureUnits;
112
113 bool OES_texture_npot;
Alex Sakhartchoukf5c876e2011-01-13 14:53:43 -0800114 bool GL_NV_texture_npot_2D_mipmap;
115 float EXT_texture_max_aniso;
Alex Sakhartchoukaa7d2882010-05-21 12:53:13 -0700116 } mGL;
117
118};
119
120}
121}
122#endif
Alex Sakhartchouka3b59602011-01-28 09:31:47 -0800123