aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorge Ruesga <jorge@ruesga.com>2014-06-14 00:45:52 +0200
committerJorge Ruesga <jorge@ruesga.com>2014-06-14 00:45:52 +0200
commit62c543c58a38bf623718bb4602396bfbd7ad1db1 (patch)
tree159c51a70d21e421efa119a647c1793d72682500
parent1651f35a53ceea044be3d5cbcaed7e759bda0ae5 (diff)
downloadandroid_packages_wallpapers_PhotoPhase-62c543c58a38bf623718bb4602396bfbd7ad1db1.tar.gz
android_packages_wallpapers_PhotoPhase-62c543c58a38bf623718bb4602396bfbd7ad1db1.tar.bz2
android_packages_wallpapers_PhotoPhase-62c543c58a38bf623718bb4602396bfbd7ad1db1.zip
Reduce synchronized lines
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
-rw-r--r--src/org/cyanogenmod/wallpapers/photophase/PhotoPhaseRenderer.java68
1 files changed, 34 insertions, 34 deletions
diff --git a/src/org/cyanogenmod/wallpapers/photophase/PhotoPhaseRenderer.java b/src/org/cyanogenmod/wallpapers/photophase/PhotoPhaseRenderer.java
index 5aef4db..3ec8ced 100644
--- a/src/org/cyanogenmod/wallpapers/photophase/PhotoPhaseRenderer.java
+++ b/src/org/cyanogenmod/wallpapers/photophase/PhotoPhaseRenderer.java
@@ -524,18 +524,18 @@ public class PhotoPhaseRenderer implements GLSurfaceView.Renderer {
mDispatcher.dispatch(new Runnable() {
@Override
public void run() {
- synchronized (mDrawing) {
- try {
+ try {
+ synchronized (mDrawing) {
mLastRunningTransition = 0;
mWorld.recreateWorld(mWidth, mMeasuredHeight);
- } catch (GLException e) {
- Log.e(TAG, "Cannot recreate the wallpaper world.", e);
- } finally {
- mDispatcher.setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);
- mDispatcher.requestRender();
}
- scheduleDispositionRecreation();
+ } catch (GLException e) {
+ Log.e(TAG, "Cannot recreate the wallpaper world.", e);
+ } finally {
+ mDispatcher.setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);
+ mDispatcher.requestRender();
}
+ scheduleDispositionRecreation();
}
});
}
@@ -698,28 +698,29 @@ public class PhotoPhaseRenderer implements GLSurfaceView.Renderer {
*/
@Override
public void onDrawFrame(GL10 glUnused) {
- synchronized (mDrawing) {
- // Set the projection, view and model
- GLES20.glViewport(0, -mStatusBarHeight, mWidth, mHeight);
- Matrix.setLookAtM(mVMatrix, 0, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);
- Matrix.multiplyMM(mMVPMatrix, 0, mProjMatrix, 0, mVMatrix, 0);
-
- if (mTextureManager != null) {
- if (mTextureManager.getStatus() == 1 && mTextureManager.isEmpty()) {
- // Advise the user and stop
- drawOops();
- mDispatcher.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
+
+ // Set the projection, view and model
+ GLES20.glViewport(0, -mStatusBarHeight, mWidth, mHeight);
+ Matrix.setLookAtM(mVMatrix, 0, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);
+ Matrix.multiplyMM(mMVPMatrix, 0, mProjMatrix, 0, mVMatrix, 0);
- } else {
- // Draw the background
- drawBackground();
+ if (mTextureManager != null) {
+ if (mTextureManager.getStatus() == 1 && mTextureManager.isEmpty()) {
+ // Advise the user and stop
+ drawOops();
+ mDispatcher.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
- if (!mIsPaused && mWorld != null) {
- // Now draw the world (all the photo frames with effects)
- mWorld.draw(mMVPMatrix);
+ } else {
+ // Draw the background
+ drawBackground();
- // Check if we have some pending transition or transition has
- // exceed its timeout
+ if (!mIsPaused && mWorld != null) {
+ // Now draw the world (all the photo frames with effects)
+ mWorld.draw(mMVPMatrix);
+
+ // Check if we have some pending transition or transition has
+ // exceed its timeout
+ synchronized (mDrawing) {
if (Preferences.General.Transitions.getTransitionInterval() > 0) {
if (!mWorld.hasRunningTransition() || isTransitionTimeoutFired()) {
mDispatcher.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
@@ -736,15 +737,14 @@ public class PhotoPhaseRenderer implements GLSurfaceView.Renderer {
mDispatcher.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
}
}
- } else if (mIsPaused) {
- mDispatcher.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
}
-
- // Draw the overlay
- drawOverlay();
+ } else if (mIsPaused) {
+ mDispatcher.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
}
- }
+ // Draw the overlay
+ drawOverlay();
+ }
}
}
@@ -789,4 +789,4 @@ public class PhotoPhaseRenderer implements GLSurfaceView.Renderer {
}
}
-}
+} \ No newline at end of file