Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 1 | /* |
Alex Sakhartchouk | 4a36b45 | 2011-04-29 16:49:08 -0700 | [diff] [blame] | 2 | * Copyright (C) 2011 The Android Open Source Project |
Jason Sams | d19f10d | 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 | 399bfce | 2009-07-13 12:20:31 -0700 | [diff] [blame] | 20 | #include "rsUtils.h" |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 21 | #include "rsType.h" |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 22 | #include "rsAllocation.h" |
Jason Sams | 7c878f3 | 2009-06-30 14:13:04 -0700 | [diff] [blame] | 23 | #include "rsMesh.h" |
Alex Sakhartchouk | d0f5bd1 | 2011-01-31 14:53:24 -0800 | [diff] [blame] | 24 | |
Jason Sams | e4a06c5 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 25 | #include "rs_hal.h" |
| 26 | |
Alex Sakhartchouk | d0f5bd1 | 2011-01-31 14:53:24 -0800 | [diff] [blame] | 27 | #include "rsMutex.h" |
| 28 | #include "rsThreadIO.h" |
Jason Sams | fcf7231 | 2011-04-20 15:09:01 -0700 | [diff] [blame] | 29 | #include "rsMatrix4x4.h" |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 30 | #include "rsDevice.h" |
| 31 | #include "rsScriptC.h" |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 32 | #include "rsAdapter.h" |
| 33 | #include "rsSampler.h" |
Alex Sakhartchouk | 9b949fc | 2010-06-24 17:15:34 -0700 | [diff] [blame] | 34 | #include "rsFont.h" |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 35 | #include "rsProgramFragment.h" |
Jason Sams | 54db59c | 2010-05-13 18:30:11 -0700 | [diff] [blame] | 36 | #include "rsProgramStore.h" |
Jason Sams | ebfb436 | 2009-09-23 13:57:02 -0700 | [diff] [blame] | 37 | #include "rsProgramRaster.h" |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 38 | #include "rsProgramVertex.h" |
Alex Sakhartchouk | 8e90f2b | 2011-04-01 14:19:01 -0700 | [diff] [blame] | 39 | #include "rsFBOCache.h" |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 40 | |
| 41 | #include "rsgApiStructs.h" |
| 42 | #include "rsLocklessFifo.h" |
| 43 | |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 44 | // --------------------------------------------------------------------------- |
| 45 | namespace android { |
Mathias Agopian | 000479f | 2010-02-09 17:46:37 -0800 | [diff] [blame] | 46 | |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 47 | namespace renderscript { |
| 48 | |
Jason Sams | f166d9b | 2010-09-30 18:15:52 -0700 | [diff] [blame] | 49 | #if 0 |
| 50 | #define CHECK_OBJ(o) { \ |
| 51 | GET_TLS(); \ |
Alex Sakhartchouk | ed9f210 | 2010-11-09 17:00:54 -0800 | [diff] [blame] | 52 | if (!ObjectBase::isValid(rsc, (const ObjectBase *)o)) { \ |
Jason Sams | f166d9b | 2010-09-30 18:15:52 -0700 | [diff] [blame] | 53 | LOGE("Bad object %p at %s, %i", o, __FILE__, __LINE__); \ |
| 54 | } \ |
| 55 | } |
| 56 | #define CHECK_OBJ_OR_NULL(o) { \ |
| 57 | GET_TLS(); \ |
Alex Sakhartchouk | ed9f210 | 2010-11-09 17:00:54 -0800 | [diff] [blame] | 58 | if (o && !ObjectBase::isValid(rsc, (const ObjectBase *)o)) { \ |
Jason Sams | f166d9b | 2010-09-30 18:15:52 -0700 | [diff] [blame] | 59 | LOGE("Bad object %p at %s, %i", o, __FILE__, __LINE__); \ |
| 60 | } \ |
| 61 | } |
| 62 | #else |
| 63 | #define CHECK_OBJ(o) |
| 64 | #define CHECK_OBJ_OR_NULL(o) |
| 65 | #endif |
| 66 | |
Alex Sakhartchouk | ed9f210 | 2010-11-09 17:00:54 -0800 | [diff] [blame] | 67 | class Context { |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 68 | public: |
Jason Sams | e4a06c5 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 69 | struct Hal { |
| 70 | void * drv; |
| 71 | |
| 72 | RsdHalFunctions funcs; |
| 73 | }; |
| 74 | Hal mHal; |
| 75 | |
Jason Sams | d5f0630 | 2010-11-03 14:27:11 -0700 | [diff] [blame] | 76 | static Context * createContext(Device *, const RsSurfaceConfig *sc); |
Alex Sakhartchouk | 17a8a19 | 2011-06-03 10:18:01 -0700 | [diff] [blame] | 77 | static Context * createContextLite(); |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 78 | ~Context(); |
| 79 | |
Jason Sams | 41c19db9 | 2009-10-15 16:47:31 -0700 | [diff] [blame] | 80 | static pthread_mutex_t gInitMutex; |
Stephen Hines | 1ac9da6 | 2011-01-07 15:11:30 -0800 | [diff] [blame] | 81 | // Library mutex (for providing thread-safe calls from the runtime) |
| 82 | static pthread_mutex_t gLibMutex; |
Jason Sams | 41c19db9 | 2009-10-15 16:47:31 -0700 | [diff] [blame] | 83 | |
Jason Sams | a17af04 | 2010-11-17 15:29:32 -0800 | [diff] [blame] | 84 | class PushState { |
| 85 | public: |
| 86 | PushState(Context *); |
| 87 | ~PushState(); |
| 88 | |
| 89 | private: |
| 90 | ObjectBaseRef<ProgramFragment> mFragment; |
| 91 | ObjectBaseRef<ProgramVertex> mVertex; |
| 92 | ObjectBaseRef<ProgramStore> mStore; |
| 93 | ObjectBaseRef<ProgramRaster> mRaster; |
| 94 | ObjectBaseRef<Font> mFont; |
| 95 | Context *mRsc; |
| 96 | }; |
| 97 | |
Jason Sams | 11c8af9 | 2010-10-13 15:31:10 -0700 | [diff] [blame] | 98 | RsSurfaceConfig mUserSurfaceConfig; |
Jason Sams | 462d11b | 2009-06-19 16:03:18 -0700 | [diff] [blame] | 99 | |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 100 | ElementState mStateElement; |
| 101 | TypeState mStateType; |
| 102 | SamplerState mStateSampler; |
| 103 | ProgramFragmentState mStateFragment; |
Jason Sams | 54db59c | 2010-05-13 18:30:11 -0700 | [diff] [blame] | 104 | ProgramStoreState mStateFragmentStore; |
Jason Sams | ebfb436 | 2009-09-23 13:57:02 -0700 | [diff] [blame] | 105 | ProgramRasterState mStateRaster; |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 106 | ProgramVertexState mStateVertex; |
Alex Sakhartchouk | 9b949fc | 2010-06-24 17:15:34 -0700 | [diff] [blame] | 107 | FontState mStateFont; |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 108 | |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 109 | ScriptCState mScriptC; |
Alex Sakhartchouk | 8e90f2b | 2011-04-01 14:19:01 -0700 | [diff] [blame] | 110 | FBOCache mFBOCache; |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 111 | |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 112 | void swapBuffers(); |
| 113 | void setRootScript(Script *); |
Jason Sams | a17af04 | 2010-11-17 15:29:32 -0800 | [diff] [blame] | 114 | void setProgramRaster(ProgramRaster *); |
| 115 | void setProgramVertex(ProgramVertex *); |
| 116 | void setProgramFragment(ProgramFragment *); |
| 117 | void setProgramStore(ProgramStore *); |
Alex Sakhartchouk | 9b949fc | 2010-06-24 17:15:34 -0700 | [diff] [blame] | 118 | void setFont(Font *); |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 119 | |
| 120 | void updateSurface(void *sur); |
| 121 | |
Jason Sams | a17af04 | 2010-11-17 15:29:32 -0800 | [diff] [blame] | 122 | ProgramFragment * getProgramFragment() {return mFragment.get();} |
| 123 | ProgramStore * getProgramStore() {return mFragmentStore.get();} |
| 124 | ProgramRaster * getProgramRaster() {return mRaster.get();} |
| 125 | ProgramVertex * getProgramVertex() {return mVertex.get();} |
Alex Sakhartchouk | 9b949fc | 2010-06-24 17:15:34 -0700 | [diff] [blame] | 126 | Font * getFont() {return mFont.get();} |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 127 | |
Jason Sams | 156cce6 | 2010-03-03 13:03:18 -0800 | [diff] [blame] | 128 | bool setupCheck(); |
Alex Sakhartchouk | feede2a | 2010-10-01 10:54:06 -0700 | [diff] [blame] | 129 | void setupProgramStore(); |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 130 | |
Jason Sams | 65e7aa5 | 2009-09-24 17:38:20 -0700 | [diff] [blame] | 131 | void pause(); |
| 132 | void resume(); |
Alex Sakhartchouk | 6c72eec | 2011-05-17 12:32:47 -0700 | [diff] [blame] | 133 | void setSurface(uint32_t w, uint32_t h, RsNativeWindow sur); |
Jason Sams | 7d787b4 | 2009-11-15 12:14:26 -0800 | [diff] [blame] | 134 | void setPriority(int32_t p); |
Jason Sams | 5c68a71 | 2010-12-24 14:38:39 -0800 | [diff] [blame] | 135 | void destroyWorkerThreadResources(); |
Jason Sams | 65e7aa5 | 2009-09-24 17:38:20 -0700 | [diff] [blame] | 136 | |
Jason Sams | d5680f9 | 2009-06-10 18:39:40 -0700 | [diff] [blame] | 137 | void assignName(ObjectBase *obj, const char *name, uint32_t len); |
Jason Sams | 3eaa338 | 2009-06-10 15:04:38 -0700 | [diff] [blame] | 138 | void removeName(ObjectBase *obj); |
Jason Sams | 9c54bdb | 2009-06-17 16:52:59 -0700 | [diff] [blame] | 139 | |
Jason Sams | edbfabd | 2011-05-17 15:01:29 -0700 | [diff] [blame] | 140 | RsMessageToClientType peekMessageToClient(size_t *receiveLen, uint32_t *subID); |
| 141 | RsMessageToClientType getMessageToClient(void *data, size_t *receiveLen, uint32_t *subID, size_t bufferLen); |
Jason Sams | add9d96 | 2010-11-22 16:20:16 -0800 | [diff] [blame] | 142 | bool sendMessageToClient(const void *data, RsMessageToClientType cmdID, uint32_t subID, size_t len, bool waitForSpace) const; |
Jason Sams | f17bccc | 2010-05-28 18:23:22 -0700 | [diff] [blame] | 143 | uint32_t runScript(Script *s); |
Jason Sams | 516c319 | 2009-10-06 13:58:47 -0700 | [diff] [blame] | 144 | |
| 145 | void initToClient(); |
| 146 | void deinitToClient(); |
| 147 | |
Jason Sams | 9c54bdb | 2009-06-17 16:52:59 -0700 | [diff] [blame] | 148 | ProgramFragment * getDefaultProgramFragment() const { |
| 149 | return mStateFragment.mDefault.get(); |
| 150 | } |
| 151 | ProgramVertex * getDefaultProgramVertex() const { |
| 152 | return mStateVertex.mDefault.get(); |
| 153 | } |
Jason Sams | 54db59c | 2010-05-13 18:30:11 -0700 | [diff] [blame] | 154 | ProgramStore * getDefaultProgramStore() const { |
Jason Sams | 9c54bdb | 2009-06-17 16:52:59 -0700 | [diff] [blame] | 155 | return mStateFragmentStore.mDefault.get(); |
| 156 | } |
Jason Sams | ebfb436 | 2009-09-23 13:57:02 -0700 | [diff] [blame] | 157 | ProgramRaster * getDefaultProgramRaster() const { |
| 158 | return mStateRaster.mDefault.get(); |
| 159 | } |
Alex Sakhartchouk | 9b949fc | 2010-06-24 17:15:34 -0700 | [diff] [blame] | 160 | Font* getDefaultFont() const { |
| 161 | return mStateFont.mDefault.get(); |
| 162 | } |
Jason Sams | 9c54bdb | 2009-06-17 16:52:59 -0700 | [diff] [blame] | 163 | |
Jason Sams | f603d21 | 2010-05-14 15:30:29 -0700 | [diff] [blame] | 164 | uint32_t getWidth() const {return mWidth;} |
| 165 | uint32_t getHeight() const {return mHeight;} |
Jason Sams | 40a29e8 | 2009-08-10 14:55:26 -0700 | [diff] [blame] | 166 | |
Jason Sams | add9d96 | 2010-11-22 16:20:16 -0800 | [diff] [blame] | 167 | mutable ThreadIO mIO; |
Jason Sams | bc948de | 2009-08-17 18:35:48 -0700 | [diff] [blame] | 168 | |
Jason Sams | f4d1606 | 2009-08-19 12:17:14 -0700 | [diff] [blame] | 169 | // Timers |
| 170 | enum Timers { |
| 171 | RS_TIMER_IDLE, |
| 172 | RS_TIMER_INTERNAL, |
| 173 | RS_TIMER_SCRIPT, |
| 174 | RS_TIMER_CLEAR_SWAP, |
| 175 | _RS_TIMER_TOTAL |
| 176 | }; |
| 177 | uint64_t getTime() const; |
| 178 | void timerInit(); |
| 179 | void timerReset(); |
| 180 | void timerSet(Timers); |
| 181 | void timerPrint(); |
Jason Sams | 2525a81 | 2009-09-03 15:43:13 -0700 | [diff] [blame] | 182 | void timerFrame(); |
Jason Sams | f4d1606 | 2009-08-19 12:17:14 -0700 | [diff] [blame] | 183 | |
Jason Sams | 66b2771 | 2009-09-25 15:25:00 -0700 | [diff] [blame] | 184 | struct { |
| 185 | bool mLogTimes; |
| 186 | bool mLogScripts; |
| 187 | bool mLogObjects; |
Jason Sams | 5dad8b4 | 2009-12-15 19:10:11 -0800 | [diff] [blame] | 188 | bool mLogShaders; |
Alex Sakhartchouk | 4378f11 | 2010-09-29 09:49:13 -0700 | [diff] [blame] | 189 | bool mLogShadersAttr; |
| 190 | bool mLogShadersUniforms; |
Alex Sakhartchouk | 6de5550 | 2010-08-03 12:03:16 -0700 | [diff] [blame] | 191 | bool mLogVisual; |
Jason Sams | 66b2771 | 2009-09-25 15:25:00 -0700 | [diff] [blame] | 192 | } props; |
Joe Onorato | 9ac2c66 | 2009-09-23 16:37:36 -0700 | [diff] [blame] | 193 | |
Jason Sams | 5316b9e | 2011-09-13 15:41:01 -0700 | [diff] [blame] | 194 | mutable struct { |
| 195 | bool inRoot; |
| 196 | const char *command; |
| 197 | const char *file; |
| 198 | uint32_t line; |
| 199 | } watchdog; |
| 200 | static void printWatchdogInfo(void *ctx); |
| 201 | void setWatchdogGL(const char *cmd, uint32_t line, const char *file) const { |
| 202 | watchdog.command = cmd; |
| 203 | watchdog.file = file; |
| 204 | watchdog.line = line; |
| 205 | } |
| 206 | |
Jason Sams | 9dab667 | 2009-11-24 12:26:35 -0800 | [diff] [blame] | 207 | void dumpDebug() const; |
Jason Sams | add9d96 | 2010-11-22 16:20:16 -0800 | [diff] [blame] | 208 | void setError(RsError e, const char *msg = NULL) const; |
Jason Sams | 9dab667 | 2009-11-24 12:26:35 -0800 | [diff] [blame] | 209 | |
Jason Sams | a9e7a05 | 2009-09-25 14:51:22 -0700 | [diff] [blame] | 210 | mutable const ObjectBase * mObjHead; |
| 211 | |
Alex Sakhartchouk | 2c74ad9 | 2011-03-16 19:28:25 -0700 | [diff] [blame] | 212 | uint32_t getDPI() const {return mDPI;} |
| 213 | void setDPI(uint32_t dpi) {mDPI = dpi;} |
Jason Sams | 8e6c17f | 2010-07-19 15:38:19 -0700 | [diff] [blame] | 214 | |
Stephen Hines | 4382467a | 2011-08-01 15:02:34 -0700 | [diff] [blame] | 215 | uint32_t getTargetSdkVersion() const {return mTargetSdkVersion;} |
| 216 | void setTargetSdkVersion(uint32_t sdkVer) {mTargetSdkVersion = sdkVer;} |
| 217 | |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 218 | Device *mDev; |
Jason Sams | 803626f | 2011-04-06 17:52:23 -0700 | [diff] [blame] | 219 | protected: |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 220 | |
Stephen Hines | 4382467a | 2011-08-01 15:02:34 -0700 | [diff] [blame] | 221 | uint32_t mTargetSdkVersion; |
Alex Sakhartchouk | 2c74ad9 | 2011-03-16 19:28:25 -0700 | [diff] [blame] | 222 | uint32_t mDPI; |
Jason Sams | 3bc47d4 | 2009-11-12 15:10:25 -0800 | [diff] [blame] | 223 | uint32_t mWidth; |
| 224 | uint32_t mHeight; |
Jason Sams | b9d5c57 | 2009-12-09 11:05:45 -0800 | [diff] [blame] | 225 | int32_t mThreadPriority; |
Jason Sams | 704ff64 | 2010-02-09 16:05:07 -0800 | [diff] [blame] | 226 | bool mIsGraphicsContext; |
Jason Sams | 3bc47d4 | 2009-11-12 15:10:25 -0800 | [diff] [blame] | 227 | |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 228 | bool mRunning; |
| 229 | bool mExit; |
Jason Sams | 65e7aa5 | 2009-09-24 17:38:20 -0700 | [diff] [blame] | 230 | bool mPaused; |
Jason Sams | add9d96 | 2010-11-22 16:20:16 -0800 | [diff] [blame] | 231 | mutable RsError mError; |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 232 | |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 233 | pthread_t mThreadId; |
Jason Sams | 7d787b4 | 2009-11-15 12:14:26 -0800 | [diff] [blame] | 234 | pid_t mNativeThreadId; |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 235 | |
| 236 | ObjectBaseRef<Script> mRootScript; |
| 237 | ObjectBaseRef<ProgramFragment> mFragment; |
| 238 | ObjectBaseRef<ProgramVertex> mVertex; |
Jason Sams | 54db59c | 2010-05-13 18:30:11 -0700 | [diff] [blame] | 239 | ObjectBaseRef<ProgramStore> mFragmentStore; |
Jason Sams | ebfb436 | 2009-09-23 13:57:02 -0700 | [diff] [blame] | 240 | ObjectBaseRef<ProgramRaster> mRaster; |
Alex Sakhartchouk | 9b949fc | 2010-06-24 17:15:34 -0700 | [diff] [blame] | 241 | ObjectBaseRef<Font> mFont; |
Jason Sams | 730ee65 | 2009-08-18 17:07:09 -0700 | [diff] [blame] | 242 | |
Alex Sakhartchouk | 6de5550 | 2010-08-03 12:03:16 -0700 | [diff] [blame] | 243 | void displayDebugStats(); |
| 244 | |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 245 | private: |
| 246 | Context(); |
Jason Sams | d5f0630 | 2010-11-03 14:27:11 -0700 | [diff] [blame] | 247 | bool initContext(Device *, const RsSurfaceConfig *sc); |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 248 | |
Jason Sams | d5f0630 | 2010-11-03 14:27:11 -0700 | [diff] [blame] | 249 | |
| 250 | bool initGLThread(); |
Jason Sams | 7136220 | 2009-10-27 14:44:31 -0700 | [diff] [blame] | 251 | void deinitEGL(); |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 252 | |
Jason Sams | b9d5c57 | 2009-12-09 11:05:45 -0800 | [diff] [blame] | 253 | uint32_t runRootScript(); |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 254 | |
| 255 | static void * threadProc(void *); |
Jason Sams | 8e6c17f | 2010-07-19 15:38:19 -0700 | [diff] [blame] | 256 | static void * helperThreadProc(void *); |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 257 | |
Alex Sakhartchouk | 6c72eec | 2011-05-17 12:32:47 -0700 | [diff] [blame] | 258 | bool mHasSurface; |
Alex Sakhartchouk | 17a8a19 | 2011-06-03 10:18:01 -0700 | [diff] [blame] | 259 | bool mIsContextLite; |
Jason Sams | 3eaa338 | 2009-06-10 15:04:38 -0700 | [diff] [blame] | 260 | |
| 261 | Vector<ObjectBase *> mNames; |
Jason Sams | f4d1606 | 2009-08-19 12:17:14 -0700 | [diff] [blame] | 262 | |
| 263 | uint64_t mTimers[_RS_TIMER_TOTAL]; |
| 264 | Timers mTimerActive; |
| 265 | uint64_t mTimeLast; |
Jason Sams | 2525a81 | 2009-09-03 15:43:13 -0700 | [diff] [blame] | 266 | uint64_t mTimeFrame; |
| 267 | uint64_t mTimeLastFrame; |
Jason Sams | b9d5c57 | 2009-12-09 11:05:45 -0800 | [diff] [blame] | 268 | uint32_t mTimeMSLastFrame; |
| 269 | uint32_t mTimeMSLastScript; |
| 270 | uint32_t mTimeMSLastSwap; |
Alex Sakhartchouk | 76322af | 2010-10-05 13:23:55 -0700 | [diff] [blame] | 271 | uint32_t mAverageFPSFrameCount; |
| 272 | uint64_t mAverageFPSStartTime; |
| 273 | uint32_t mAverageFPS; |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 274 | }; |
| 275 | |
Alex Sakhartchouk | d0f5bd1 | 2011-01-31 14:53:24 -0800 | [diff] [blame] | 276 | } // renderscript |
| 277 | } // android |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 278 | #endif |