Alex Sakhartchouk | aa7d288 | 2010-05-21 12:53:13 -0700 | [diff] [blame] | 1 | /* |
| 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 Sakhartchouk | aa7d288 | 2010-05-21 12:53:13 -0700 | [diff] [blame] | 21 | #include "rsType.h" |
Alex Sakhartchouk | aa7d288 | 2010-05-21 12:53:13 -0700 | [diff] [blame] | 22 | #include "rsAllocation.h" |
Alex Sakhartchouk | aa7d288 | 2010-05-21 12:53:13 -0700 | [diff] [blame] | 23 | #include "rsMesh.h" |
Alex Sakhartchouk | aa7d288 | 2010-05-21 12:53:13 -0700 | [diff] [blame] | 24 | #include "rsAllocation.h" |
Alex Sakhartchouk | aa7d288 | 2010-05-21 12:53:13 -0700 | [diff] [blame] | 25 | |
| 26 | // --------------------------------------------------------------------------- |
| 27 | namespace android { |
Alex Sakhartchouk | aa7d288 | 2010-05-21 12:53:13 -0700 | [diff] [blame] | 28 | namespace renderscript { |
| 29 | |
Alex Sakhartchouk | a3b5960 | 2011-01-28 09:31:47 -0800 | [diff] [blame] | 30 | #define CHECK_OBJ(o) |
| 31 | #define CHECK_OBJ_OR_NULL(o) |
| 32 | |
Alex Sakhartchouk | aa7d288 | 2010-05-21 12:53:13 -0700 | [diff] [blame] | 33 | class Device; |
| 34 | |
Alex Sakhartchouk | ed9f210 | 2010-11-09 17:00:54 -0800 | [diff] [blame] | 35 | class Context { |
Alex Sakhartchouk | aa7d288 | 2010-05-21 12:53:13 -0700 | [diff] [blame] | 36 | public: |
| 37 | Context(Device *, bool isGraphics, bool useDepth) { |
| 38 | mObjHead = NULL; |
| 39 | } |
| 40 | ~Context() { |
| 41 | } |
| 42 | |
Alex Sakhartchouk | aa7d288 | 2010-05-21 12:53:13 -0700 | [diff] [blame] | 43 | //StructuredAllocationContext mStateAllocation; |
| 44 | ElementState mStateElement; |
| 45 | TypeState mStateType; |
Alex Sakhartchouk | 98bfe5d | 2010-10-18 17:18:50 -0700 | [diff] [blame] | 46 | RsSurfaceConfig mUserSurfaceConfig; |
Alex Sakhartchouk | aa7d288 | 2010-05-21 12:53:13 -0700 | [diff] [blame] | 47 | |
| 48 | //bool setupCheck(); |
Alex Sakhartchouk | aa7d288 | 2010-05-21 12:53:13 -0700 | [diff] [blame] | 49 | |
Alex Sakhartchouk | aa7d288 | 2010-05-21 12:53:13 -0700 | [diff] [blame] | 50 | |
| 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 Sakhartchouk | a3b5960 | 2011-01-28 09:31:47 -0800 | [diff] [blame] | 63 | void timerSet(Timers) { } |
| 64 | |
Alex Sakhartchouk | aa7d288 | 2010-05-21 12:53:13 -0700 | [diff] [blame] | 65 | 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 Sakhartchouk | f5b3510 | 2010-09-30 11:36:37 -0700 | [diff] [blame] | 73 | bool mLogShadersAttr; |
| 74 | bool mLogShadersUniforms; |
| 75 | bool mLogVisual; |
Alex Sakhartchouk | aa7d288 | 2010-05-21 12:53:13 -0700 | [diff] [blame] | 76 | } 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 Sakhartchouk | f5c876e | 2011-01-13 14:53:43 -0800 | [diff] [blame] | 85 | 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 Sakhartchouk | b89aaac | 2010-09-23 16:16:33 -0700 | [diff] [blame] | 87 | uint32_t getMaxFragmentTextures() const {return mGL.mMaxFragmentTextureImageUnits;} |
| 88 | uint32_t getMaxFragmentUniformVectors() const {return mGL.mMaxFragmentUniformVectors;} |
| 89 | uint32_t getMaxVertexUniformVectors() const {return mGL.mMaxVertexUniformVectors;} |
Alex Sakhartchouk | f5c876e | 2011-01-13 14:53:43 -0800 | [diff] [blame] | 90 | uint32_t getMaxVertexAttributes() const {return mGL.mMaxVertexAttribs;} |
Alex Sakhartchouk | aa7d288 | 2010-05-21 12:53:13 -0700 | [diff] [blame] | 91 | |
| 92 | protected: |
| 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 Sakhartchouk | f5c876e | 2011-01-13 14:53:43 -0800 | [diff] [blame] | 114 | bool GL_NV_texture_npot_2D_mipmap; |
| 115 | float EXT_texture_max_aniso; |
Alex Sakhartchouk | aa7d288 | 2010-05-21 12:53:13 -0700 | [diff] [blame] | 116 | } mGL; |
| 117 | |
| 118 | }; |
| 119 | |
| 120 | } |
| 121 | } |
| 122 | #endif |
Alex Sakhartchouk | a3b5960 | 2011-01-28 09:31:47 -0800 | [diff] [blame] | 123 | |