Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 1 | /* |
Alex Sakhartchouk | a04e30d | 2011-04-29 16:49:08 -0700 | [diff] [blame] | 2 | * Copyright (C) 2011 The Android Open Source Project |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 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_H |
| 18 | #define ANDROID_RS_CONTEXT_H |
| 19 | |
Jason Sams | a557780 | 2009-07-13 12:20:31 -0700 | [diff] [blame] | 20 | #include "rsUtils.h" |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 21 | #include "rs_hal.h" |
| 22 | |
Alex Sakhartchouk | 77d9f4b | 2011-01-31 14:53:24 -0800 | [diff] [blame] | 23 | #include "rsThreadIO.h" |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 24 | #include "rsScriptC.h" |
Jason Sams | dbe66d6 | 2012-09-17 13:54:41 -0700 | [diff] [blame] | 25 | #include "rsScriptGroup.h" |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 26 | #include "rsSampler.h" |
Alex Sakhartchouk | d3e0ad4 | 2010-06-24 17:15:34 -0700 | [diff] [blame] | 27 | #include "rsFont.h" |
Jason Sams | 9e0afb5 | 2011-10-31 13:23:43 -0700 | [diff] [blame] | 28 | #include "rsPath.h" |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 29 | #include "rsProgramFragment.h" |
Jason Sams | ccc010b | 2010-05-13 18:30:11 -0700 | [diff] [blame] | 30 | #include "rsProgramStore.h" |
Jason Sams | 5fd09d8 | 2009-09-23 13:57:02 -0700 | [diff] [blame] | 31 | #include "rsProgramRaster.h" |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 32 | #include "rsProgramVertex.h" |
Alex Sakhartchouk | 7d9c5ff | 2011-04-01 14:19:01 -0700 | [diff] [blame] | 33 | #include "rsFBOCache.h" |
Shih-wei Liao | da3b58d | 2012-08-03 04:24:33 -0700 | [diff] [blame] | 34 | #include <string.h> |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 35 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 36 | // --------------------------------------------------------------------------- |
| 37 | namespace android { |
Mathias Agopian | d4c25e3 | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 38 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 39 | namespace renderscript { |
| 40 | |
Alex Sakhartchouk | 4edf030 | 2012-03-09 10:47:27 -0800 | [diff] [blame] | 41 | class Device; |
| 42 | |
Jason Sams | 605048a | 2010-09-30 18:15:52 -0700 | [diff] [blame] | 43 | #if 0 |
| 44 | #define CHECK_OBJ(o) { \ |
| 45 | GET_TLS(); \ |
Alex Sakhartchouk | afb743a | 2010-11-09 17:00:54 -0800 | [diff] [blame] | 46 | if (!ObjectBase::isValid(rsc, (const ObjectBase *)o)) { \ |
Steve Block | af12ac6 | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 47 | ALOGE("Bad object %p at %s, %i", o, __FILE__, __LINE__); \ |
Jason Sams | 605048a | 2010-09-30 18:15:52 -0700 | [diff] [blame] | 48 | } \ |
| 49 | } |
| 50 | #define CHECK_OBJ_OR_NULL(o) { \ |
| 51 | GET_TLS(); \ |
Alex Sakhartchouk | afb743a | 2010-11-09 17:00:54 -0800 | [diff] [blame] | 52 | if (o && !ObjectBase::isValid(rsc, (const ObjectBase *)o)) { \ |
Steve Block | af12ac6 | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 53 | ALOGE("Bad object %p at %s, %i", o, __FILE__, __LINE__); \ |
Jason Sams | 605048a | 2010-09-30 18:15:52 -0700 | [diff] [blame] | 54 | } \ |
| 55 | } |
| 56 | #else |
| 57 | #define CHECK_OBJ(o) |
| 58 | #define CHECK_OBJ_OR_NULL(o) |
| 59 | #endif |
| 60 | |
Alex Sakhartchouk | afb743a | 2010-11-09 17:00:54 -0800 | [diff] [blame] | 61 | class Context { |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 62 | public: |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 63 | struct Hal { |
| 64 | void * drv; |
| 65 | |
| 66 | RsdHalFunctions funcs; |
| 67 | }; |
| 68 | Hal mHal; |
| 69 | |
Jason Sams | 5c1c79a | 2010-11-03 14:27:11 -0700 | [diff] [blame] | 70 | static Context * createContext(Device *, const RsSurfaceConfig *sc); |
Tim Murray | 0e92fa3 | 2012-11-06 14:36:38 -0800 | [diff] [blame] | 71 | static Context * createContext(Device *, const RsSurfaceConfig *sc, bool forceCpu); |
Alex Sakhartchouk | b81a0eb | 2011-06-03 10:18:01 -0700 | [diff] [blame] | 72 | static Context * createContextLite(); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 73 | ~Context(); |
| 74 | |
Jason Sams | fb03a22 | 2009-10-15 16:47:31 -0700 | [diff] [blame] | 75 | static pthread_mutex_t gInitMutex; |
Stephen Hines | ca3f09c | 2011-01-07 15:11:30 -0800 | [diff] [blame] | 76 | // Library mutex (for providing thread-safe calls from the runtime) |
| 77 | static pthread_mutex_t gLibMutex; |
Jason Sams | fb03a22 | 2009-10-15 16:47:31 -0700 | [diff] [blame] | 78 | |
Jason Sams | 6070925 | 2010-11-17 15:29:32 -0800 | [diff] [blame] | 79 | class PushState { |
| 80 | public: |
| 81 | PushState(Context *); |
| 82 | ~PushState(); |
| 83 | |
| 84 | private: |
| 85 | ObjectBaseRef<ProgramFragment> mFragment; |
| 86 | ObjectBaseRef<ProgramVertex> mVertex; |
| 87 | ObjectBaseRef<ProgramStore> mStore; |
| 88 | ObjectBaseRef<ProgramRaster> mRaster; |
| 89 | ObjectBaseRef<Font> mFont; |
| 90 | Context *mRsc; |
| 91 | }; |
| 92 | |
Jason Sams | 6b8552a | 2010-10-13 15:31:10 -0700 | [diff] [blame] | 93 | RsSurfaceConfig mUserSurfaceConfig; |
Jason Sams | e576910 | 2009-06-19 16:03:18 -0700 | [diff] [blame] | 94 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 95 | ElementState mStateElement; |
| 96 | TypeState mStateType; |
| 97 | SamplerState mStateSampler; |
| 98 | ProgramFragmentState mStateFragment; |
Jason Sams | ccc010b | 2010-05-13 18:30:11 -0700 | [diff] [blame] | 99 | ProgramStoreState mStateFragmentStore; |
Jason Sams | 5fd09d8 | 2009-09-23 13:57:02 -0700 | [diff] [blame] | 100 | ProgramRasterState mStateRaster; |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 101 | ProgramVertexState mStateVertex; |
Alex Sakhartchouk | d3e0ad4 | 2010-06-24 17:15:34 -0700 | [diff] [blame] | 102 | FontState mStateFont; |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 103 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 104 | ScriptCState mScriptC; |
Alex Sakhartchouk | 7d9c5ff | 2011-04-01 14:19:01 -0700 | [diff] [blame] | 105 | FBOCache mFBOCache; |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 106 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 107 | void swapBuffers(); |
| 108 | void setRootScript(Script *); |
Jason Sams | 6070925 | 2010-11-17 15:29:32 -0800 | [diff] [blame] | 109 | void setProgramRaster(ProgramRaster *); |
| 110 | void setProgramVertex(ProgramVertex *); |
| 111 | void setProgramFragment(ProgramFragment *); |
| 112 | void setProgramStore(ProgramStore *); |
Alex Sakhartchouk | d3e0ad4 | 2010-06-24 17:15:34 -0700 | [diff] [blame] | 113 | void setFont(Font *); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 114 | |
| 115 | void updateSurface(void *sur); |
| 116 | |
Jason Sams | 6070925 | 2010-11-17 15:29:32 -0800 | [diff] [blame] | 117 | ProgramFragment * getProgramFragment() {return mFragment.get();} |
| 118 | ProgramStore * getProgramStore() {return mFragmentStore.get();} |
| 119 | ProgramRaster * getProgramRaster() {return mRaster.get();} |
| 120 | ProgramVertex * getProgramVertex() {return mVertex.get();} |
Alex Sakhartchouk | d3e0ad4 | 2010-06-24 17:15:34 -0700 | [diff] [blame] | 121 | Font * getFont() {return mFont.get();} |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 122 | |
Jason Sams | a2cf755 | 2010-03-03 13:03:18 -0800 | [diff] [blame] | 123 | bool setupCheck(); |
Alex Sakhartchouk | 889fe50 | 2010-10-01 10:54:06 -0700 | [diff] [blame] | 124 | void setupProgramStore(); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 125 | |
Jason Sams | 86f1b23 | 2009-09-24 17:38:20 -0700 | [diff] [blame] | 126 | void pause(); |
| 127 | void resume(); |
Alex Sakhartchouk | 7257c7e | 2011-05-17 12:32:47 -0700 | [diff] [blame] | 128 | void setSurface(uint32_t w, uint32_t h, RsNativeWindow sur); |
Jason Sams | 1583244 | 2009-11-15 12:14:26 -0800 | [diff] [blame] | 129 | void setPriority(int32_t p); |
Jason Sams | 741aac9 | 2010-12-24 14:38:39 -0800 | [diff] [blame] | 130 | void destroyWorkerThreadResources(); |
Jason Sams | 86f1b23 | 2009-09-24 17:38:20 -0700 | [diff] [blame] | 131 | |
Jason Sams | a4a54e4 | 2009-06-10 18:39:40 -0700 | [diff] [blame] | 132 | void assignName(ObjectBase *obj, const char *name, uint32_t len); |
Jason Sams | a0a1b6f | 2009-06-10 15:04:38 -0700 | [diff] [blame] | 133 | void removeName(ObjectBase *obj); |
Jason Sams | 8ce125b | 2009-06-17 16:52:59 -0700 | [diff] [blame] | 134 | |
Jason Sams | 1a4efa3 | 2011-05-17 15:01:29 -0700 | [diff] [blame] | 135 | RsMessageToClientType peekMessageToClient(size_t *receiveLen, uint32_t *subID); |
| 136 | RsMessageToClientType getMessageToClient(void *data, size_t *receiveLen, uint32_t *subID, size_t bufferLen); |
Jason Sams | 87319de | 2010-11-22 16:20:16 -0800 | [diff] [blame] | 137 | bool sendMessageToClient(const void *data, RsMessageToClientType cmdID, uint32_t subID, size_t len, bool waitForSpace) const; |
Jason Sams | c61346b | 2010-05-28 18:23:22 -0700 | [diff] [blame] | 138 | uint32_t runScript(Script *s); |
Jason Sams | 8c401ef | 2009-10-06 13:58:47 -0700 | [diff] [blame] | 139 | |
| 140 | void initToClient(); |
| 141 | void deinitToClient(); |
| 142 | |
Jason Sams | 8ce125b | 2009-06-17 16:52:59 -0700 | [diff] [blame] | 143 | ProgramFragment * getDefaultProgramFragment() const { |
| 144 | return mStateFragment.mDefault.get(); |
| 145 | } |
| 146 | ProgramVertex * getDefaultProgramVertex() const { |
| 147 | return mStateVertex.mDefault.get(); |
| 148 | } |
Jason Sams | ccc010b | 2010-05-13 18:30:11 -0700 | [diff] [blame] | 149 | ProgramStore * getDefaultProgramStore() const { |
Jason Sams | 8ce125b | 2009-06-17 16:52:59 -0700 | [diff] [blame] | 150 | return mStateFragmentStore.mDefault.get(); |
| 151 | } |
Jason Sams | 5fd09d8 | 2009-09-23 13:57:02 -0700 | [diff] [blame] | 152 | ProgramRaster * getDefaultProgramRaster() const { |
| 153 | return mStateRaster.mDefault.get(); |
| 154 | } |
Alex Sakhartchouk | d3e0ad4 | 2010-06-24 17:15:34 -0700 | [diff] [blame] | 155 | Font* getDefaultFont() const { |
| 156 | return mStateFont.mDefault.get(); |
| 157 | } |
Jason Sams | 8ce125b | 2009-06-17 16:52:59 -0700 | [diff] [blame] | 158 | |
Jason Sams | 771565f | 2010-05-14 15:30:29 -0700 | [diff] [blame] | 159 | uint32_t getWidth() const {return mWidth;} |
| 160 | uint32_t getHeight() const {return mHeight;} |
Jason Sams | e579df4 | 2009-08-10 14:55:26 -0700 | [diff] [blame] | 161 | |
Alex Sakhartchouk | a74a8f6 | 2011-11-16 12:22:10 -0800 | [diff] [blame] | 162 | uint32_t getCurrentSurfaceWidth() const; |
| 163 | uint32_t getCurrentSurfaceHeight() const; |
| 164 | |
Jason Sams | 87319de | 2010-11-22 16:20:16 -0800 | [diff] [blame] | 165 | mutable ThreadIO mIO; |
Jason Sams | fcd3192 | 2009-08-17 18:35:48 -0700 | [diff] [blame] | 166 | |
Jason Sams | 24371d9 | 2009-08-19 12:17:14 -0700 | [diff] [blame] | 167 | // Timers |
| 168 | enum Timers { |
| 169 | RS_TIMER_IDLE, |
| 170 | RS_TIMER_INTERNAL, |
| 171 | RS_TIMER_SCRIPT, |
| 172 | RS_TIMER_CLEAR_SWAP, |
| 173 | _RS_TIMER_TOTAL |
| 174 | }; |
| 175 | uint64_t getTime() const; |
| 176 | void timerInit(); |
| 177 | void timerReset(); |
| 178 | void timerSet(Timers); |
| 179 | void timerPrint(); |
Jason Sams | 1d54f10 | 2009-09-03 15:43:13 -0700 | [diff] [blame] | 180 | void timerFrame(); |
Jason Sams | 24371d9 | 2009-08-19 12:17:14 -0700 | [diff] [blame] | 181 | |
Jason Sams | 1fddd90 | 2009-09-25 15:25:00 -0700 | [diff] [blame] | 182 | struct { |
| 183 | bool mLogTimes; |
| 184 | bool mLogScripts; |
| 185 | bool mLogObjects; |
Jason Sams | cd50653 | 2009-12-15 19:10:11 -0800 | [diff] [blame] | 186 | bool mLogShaders; |
Alex Sakhartchouk | 886f11a | 2010-09-29 09:49:13 -0700 | [diff] [blame] | 187 | bool mLogShadersAttr; |
| 188 | bool mLogShadersUniforms; |
Alex Sakhartchouk | 0cae59f | 2010-08-03 12:03:16 -0700 | [diff] [blame] | 189 | bool mLogVisual; |
Jason Sams | d1f7da6 | 2012-03-15 19:18:03 -0700 | [diff] [blame] | 190 | uint32_t mDebugMaxThreads; |
Jason Sams | 1fddd90 | 2009-09-25 15:25:00 -0700 | [diff] [blame] | 191 | } props; |
Joe Onorato | 76371ff | 2009-09-23 16:37:36 -0700 | [diff] [blame] | 192 | |
Jason Sams | 2382aba | 2011-09-13 15:41:01 -0700 | [diff] [blame] | 193 | mutable struct { |
| 194 | bool inRoot; |
| 195 | const char *command; |
| 196 | const char *file; |
| 197 | uint32_t line; |
| 198 | } watchdog; |
| 199 | static void printWatchdogInfo(void *ctx); |
| 200 | void setWatchdogGL(const char *cmd, uint32_t line, const char *file) const { |
| 201 | watchdog.command = cmd; |
| 202 | watchdog.file = file; |
| 203 | watchdog.line = line; |
| 204 | } |
| 205 | |
Jason Sams | 13e2634 | 2009-11-24 12:26:35 -0800 | [diff] [blame] | 206 | void dumpDebug() const; |
Jason Sams | 87319de | 2010-11-22 16:20:16 -0800 | [diff] [blame] | 207 | void setError(RsError e, const char *msg = NULL) const; |
Jason Sams | 13e2634 | 2009-11-24 12:26:35 -0800 | [diff] [blame] | 208 | |
Jason Sams | e514b45 | 2009-09-25 14:51:22 -0700 | [diff] [blame] | 209 | mutable const ObjectBase * mObjHead; |
| 210 | |
Alex Sakhartchouk | 7b3e9bd | 2011-03-16 19:28:25 -0700 | [diff] [blame] | 211 | uint32_t getDPI() const {return mDPI;} |
| 212 | void setDPI(uint32_t dpi) {mDPI = dpi;} |
Jason Sams | 7bf29dd | 2010-07-19 15:38:19 -0700 | [diff] [blame] | 213 | |
Stephen Hines | cbb0b8a | 2011-08-01 15:02:34 -0700 | [diff] [blame] | 214 | uint32_t getTargetSdkVersion() const {return mTargetSdkVersion;} |
| 215 | void setTargetSdkVersion(uint32_t sdkVer) {mTargetSdkVersion = sdkVer;} |
| 216 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 217 | Device *mDev; |
Jason Sams | 4b3de47 | 2011-04-06 17:52:23 -0700 | [diff] [blame] | 218 | protected: |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 219 | |
Stephen Hines | cbb0b8a | 2011-08-01 15:02:34 -0700 | [diff] [blame] | 220 | uint32_t mTargetSdkVersion; |
Alex Sakhartchouk | 7b3e9bd | 2011-03-16 19:28:25 -0700 | [diff] [blame] | 221 | uint32_t mDPI; |
Jason Sams | 613cad1 | 2009-11-12 15:10:25 -0800 | [diff] [blame] | 222 | uint32_t mWidth; |
| 223 | uint32_t mHeight; |
Jason Sams | 2dca84d | 2009-12-09 11:05:45 -0800 | [diff] [blame] | 224 | int32_t mThreadPriority; |
Jason Sams | 4820e8b | 2010-02-09 16:05:07 -0800 | [diff] [blame] | 225 | bool mIsGraphicsContext; |
Jason Sams | 613cad1 | 2009-11-12 15:10:25 -0800 | [diff] [blame] | 226 | |
Tim Murray | 0e92fa3 | 2012-11-06 14:36:38 -0800 | [diff] [blame] | 227 | bool mForceCpu; |
| 228 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 229 | bool mRunning; |
| 230 | bool mExit; |
Jason Sams | 86f1b23 | 2009-09-24 17:38:20 -0700 | [diff] [blame] | 231 | bool mPaused; |
Jason Sams | 87319de | 2010-11-22 16:20:16 -0800 | [diff] [blame] | 232 | mutable RsError mError; |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 233 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 234 | pthread_t mThreadId; |
Jason Sams | 1583244 | 2009-11-15 12:14:26 -0800 | [diff] [blame] | 235 | pid_t mNativeThreadId; |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 236 | |
| 237 | ObjectBaseRef<Script> mRootScript; |
| 238 | ObjectBaseRef<ProgramFragment> mFragment; |
| 239 | ObjectBaseRef<ProgramVertex> mVertex; |
Jason Sams | ccc010b | 2010-05-13 18:30:11 -0700 | [diff] [blame] | 240 | ObjectBaseRef<ProgramStore> mFragmentStore; |
Jason Sams | 5fd09d8 | 2009-09-23 13:57:02 -0700 | [diff] [blame] | 241 | ObjectBaseRef<ProgramRaster> mRaster; |
Alex Sakhartchouk | d3e0ad4 | 2010-06-24 17:15:34 -0700 | [diff] [blame] | 242 | ObjectBaseRef<Font> mFont; |
Jason Sams | 5086938 | 2009-08-18 17:07:09 -0700 | [diff] [blame] | 243 | |
Alex Sakhartchouk | 0cae59f | 2010-08-03 12:03:16 -0700 | [diff] [blame] | 244 | void displayDebugStats(); |
| 245 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 246 | private: |
| 247 | Context(); |
Jason Sams | 5c1c79a | 2010-11-03 14:27:11 -0700 | [diff] [blame] | 248 | bool initContext(Device *, const RsSurfaceConfig *sc); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 249 | |
Jason Sams | 5c1c79a | 2010-11-03 14:27:11 -0700 | [diff] [blame] | 250 | bool initGLThread(); |
Jason Sams | 33b6e3b | 2009-10-27 14:44:31 -0700 | [diff] [blame] | 251 | void deinitEGL(); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 252 | |
Jason Sams | 2dca84d | 2009-12-09 11:05:45 -0800 | [diff] [blame] | 253 | uint32_t runRootScript(); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 254 | |
Tim Murray | 0c66f07 | 2012-10-23 14:05:02 -0700 | [diff] [blame] | 255 | static bool loadRuntime(const char* filename, Context* rsc); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 256 | static void * threadProc(void *); |
Jason Sams | 7bf29dd | 2010-07-19 15:38:19 -0700 | [diff] [blame] | 257 | static void * helperThreadProc(void *); |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 258 | |
Alex Sakhartchouk | 7257c7e | 2011-05-17 12:32:47 -0700 | [diff] [blame] | 259 | bool mHasSurface; |
Alex Sakhartchouk | b81a0eb | 2011-06-03 10:18:01 -0700 | [diff] [blame] | 260 | bool mIsContextLite; |
Jason Sams | a0a1b6f | 2009-06-10 15:04:38 -0700 | [diff] [blame] | 261 | |
| 262 | Vector<ObjectBase *> mNames; |
Jason Sams | 24371d9 | 2009-08-19 12:17:14 -0700 | [diff] [blame] | 263 | |
| 264 | uint64_t mTimers[_RS_TIMER_TOTAL]; |
| 265 | Timers mTimerActive; |
| 266 | uint64_t mTimeLast; |
Jason Sams | 1d54f10 | 2009-09-03 15:43:13 -0700 | [diff] [blame] | 267 | uint64_t mTimeFrame; |
| 268 | uint64_t mTimeLastFrame; |
Jason Sams | 2dca84d | 2009-12-09 11:05:45 -0800 | [diff] [blame] | 269 | uint32_t mTimeMSLastFrame; |
| 270 | uint32_t mTimeMSLastScript; |
| 271 | uint32_t mTimeMSLastSwap; |
Alex Sakhartchouk | c8fb69e | 2010-10-05 13:23:55 -0700 | [diff] [blame] | 272 | uint32_t mAverageFPSFrameCount; |
| 273 | uint64_t mAverageFPSStartTime; |
| 274 | uint32_t mAverageFPS; |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 275 | }; |
| 276 | |
Alex Sakhartchouk | 77d9f4b | 2011-01-31 14:53:24 -0800 | [diff] [blame] | 277 | } // renderscript |
| 278 | } // android |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 279 | #endif |