diff options
| author | Android (Google) Code Review <android-gerrit@google.com> | 2009-09-24 17:56:39 -0400 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-09-24 17:56:39 -0400 |
| commit | a6a4113d50d43930099d26b5f420f293c475e484 (patch) | |
| tree | 5e5392642e20105b0b675a1ed6b7e8c99ad4d23c /libs | |
| parent | b7e89e4cdc4d0e769244b2ceaf9077359843de13 (diff) | |
| parent | e60446b9c1a0f4f48372a36de5b01a2ddb8121e3 (diff) | |
| download | frameworks_base-a6a4113d50d43930099d26b5f420f293c475e484.zip frameworks_base-a6a4113d50d43930099d26b5f420f293c475e484.tar.gz frameworks_base-a6a4113d50d43930099d26b5f420f293c475e484.tar.bz2 | |
Merge change 26917 into eclair
* changes:
Fix invokables to make sure script pointers are setup before invoking function calls. Reduce app startup time up to 1s.
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/rs/java/Fountain/AndroidManifest.xml | 3 | ||||
| -rw-r--r-- | libs/rs/rsContext.cpp | 2 | ||||
| -rw-r--r-- | libs/rs/rsLocklessFifo.cpp | 4 | ||||
| -rw-r--r-- | libs/rs/rsScript.cpp | 1 | ||||
| -rw-r--r-- | libs/rs/rsScript.h | 1 | ||||
| -rw-r--r-- | libs/rs/rsScriptC.cpp | 16 | ||||
| -rw-r--r-- | libs/rs/rsScriptC.h | 1 |
7 files changed, 17 insertions, 11 deletions
diff --git a/libs/rs/java/Fountain/AndroidManifest.xml b/libs/rs/java/Fountain/AndroidManifest.xml index dd0e428..1185930 100644 --- a/libs/rs/java/Fountain/AndroidManifest.xml +++ b/libs/rs/java/Fountain/AndroidManifest.xml @@ -2,8 +2,7 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.fountain"> <application android:label="Fountain"> - <activity android:name="Fountain" - android:theme="@android:style/Theme.Translucent"> + <activity android:name="Fountain"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp index cc11ab2..0ac8320 100644 --- a/libs/rs/rsContext.cpp +++ b/libs/rs/rsContext.cpp @@ -317,7 +317,7 @@ Context::Context(Device *dev, Surface *sur, bool useDepth) } while(!mRunning) { - sleep(1); + usleep(100); } pthread_attr_destroy(&threadAttr); diff --git a/libs/rs/rsLocklessFifo.cpp b/libs/rs/rsLocklessFifo.cpp index 0c40389..f4f5d40 100644 --- a/libs/rs/rsLocklessFifo.cpp +++ b/libs/rs/rsLocklessFifo.cpp @@ -159,7 +159,7 @@ void LocklessCommandFifo::makeSpace(uint32_t bytes) if ((mPut+bytes) > mEnd) { // Need to loop regardless of where get is. while((mGet > mPut) && (mBuffer+4 >= mGet)) { - sleep(1); + usleep(100); } // Toss in a reset then the normal wait for space will do the rest. @@ -170,7 +170,7 @@ void LocklessCommandFifo::makeSpace(uint32_t bytes) // it will fit here so we just need to wait for space. while(getFreeSpace() < bytes) { - sleep(1); + usleep(100); } } diff --git a/libs/rs/rsScript.cpp b/libs/rs/rsScript.cpp index 99a085d..76fed3b 100644 --- a/libs/rs/rsScript.cpp +++ b/libs/rs/rsScript.cpp @@ -94,6 +94,7 @@ void rsi_ScriptSetInvoke(Context *rsc, const char *name, uint32_t slot) void rsi_ScriptInvoke(Context *rsc, RsScript vs, uint32_t slot) { Script *s = static_cast<Script *>(vs); + s->setupScript(); s->mEnviroment.mInvokables[slot](); } diff --git a/libs/rs/rsScript.h b/libs/rs/rsScript.h index e40531e..97cb67a 100644 --- a/libs/rs/rsScript.h +++ b/libs/rs/rsScript.h @@ -69,6 +69,7 @@ public: + virtual void setupScript() = 0; virtual bool run(Context *, uint32_t launchID) = 0; }; diff --git a/libs/rs/rsScriptC.cpp b/libs/rs/rsScriptC.cpp index 108ae5a..bff337c 100644 --- a/libs/rs/rsScriptC.cpp +++ b/libs/rs/rsScriptC.cpp @@ -46,6 +46,15 @@ ScriptC::~ScriptC() } } +void ScriptC::setupScript() +{ + for (int ct=0; ct < MAX_SCRIPT_BANKS; ct++) { + if (mProgram.mSlotPointers[ct]) { + *mProgram.mSlotPointers[ct] = mSlots[ct]->getPtr(); + } + } +} + bool ScriptC::run(Context *rsc, uint32_t launchIndex) { @@ -66,12 +75,7 @@ bool ScriptC::run(Context *rsc, uint32_t launchIndex) mEnviroment.mStartTimeMillis = nanoseconds_to_milliseconds(systemTime(SYSTEM_TIME_MONOTONIC)); } - - for (int ct=0; ct < MAX_SCRIPT_BANKS; ct++) { - if (mProgram.mSlotPointers[ct]) { - *mProgram.mSlotPointers[ct] = mSlots[ct]->getPtr(); - } - } + setupScript(); bool ret = false; tls->mScript = this; diff --git a/libs/rs/rsScriptC.h b/libs/rs/rsScriptC.h index 355f0c3..16eb8de 100644 --- a/libs/rs/rsScriptC.h +++ b/libs/rs/rsScriptC.h @@ -58,6 +58,7 @@ public: ACCscript* mAccScript; + virtual void setupScript(); virtual bool run(Context *, uint32_t launchID); }; |
