summaryrefslogtreecommitdiffstats
path: root/libs/rs/rsContext.h
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2009-08-19 12:17:14 -0700
committerJason Sams <rjsams@android.com>2009-08-19 12:17:14 -0700
commitf4d160653fe405eba9d6f55448ac4599c6cadd77 (patch)
tree0e426bfc5a60d271a95a6450e8414b570237c818 /libs/rs/rsContext.h
parent730ee65d4ddb307898053b623120bad1655fadad (diff)
downloadframeworks_base-f4d160653fe405eba9d6f55448ac4599c6cadd77.zip
frameworks_base-f4d160653fe405eba9d6f55448ac4599c6cadd77.tar.gz
frameworks_base-f4d160653fe405eba9d6f55448ac4599c6cadd77.tar.bz2
Improved RS timing code to monitor where we spend CPU time.
Diffstat (limited to 'libs/rs/rsContext.h')
-rw-r--r--libs/rs/rsContext.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/libs/rs/rsContext.h b/libs/rs/rsContext.h
index 52901b2..ca67e40 100644
--- a/libs/rs/rsContext.h
+++ b/libs/rs/rsContext.h
@@ -72,8 +72,6 @@ public:
ScriptCState mScriptC;
- static Context * getContext() {return gCon;}
-
void swapBuffers();
void setRootScript(Script *);
void setVertex(ProgramVertex *);
@@ -120,6 +118,20 @@ public:
ThreadIO mIO;
void objDestroyAdd(ObjectBase *);
+ // Timers
+ enum Timers {
+ RS_TIMER_IDLE,
+ RS_TIMER_INTERNAL,
+ RS_TIMER_SCRIPT,
+ RS_TIMER_CLEAR_SWAP,
+ _RS_TIMER_TOTAL
+ };
+ uint64_t getTime() const;
+ void timerInit();
+ void timerReset();
+ void timerSet(Timers);
+ void timerPrint();
+
protected:
Device *mDev;
@@ -164,13 +176,15 @@ private:
static void * threadProc(void *);
- // todo: put in TLS
- static Context *gCon;
Surface *mWndSurface;
Vector<ObjectBase *> mNames;
KeyedVector<String8,int> mInt32Defines;
KeyedVector<String8,float> mFloatDefines;
+
+ uint64_t mTimers[_RS_TIMER_TOTAL];
+ Timers mTimerActive;
+ uint64_t mTimeLast;
};