Permalink
Browse files

Merge branch 'eclair' of git://github.com/cyanogen/android_packages_w…

…allpapers_Basic into HEAD

Conflicts:
	res/drawable-mdpi/dark_pyramid_background.png
	res/values/arrays.xml
  • Loading branch information...
2 parents 07fcc3d + 1e2bfc9 commit 20a19e3e228a87080bba5339e601e7579b968142 Wes Garner committed Apr 7, 2010
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -110,21 +110,13 @@ void initPulses() {
void drawBackground(int width, int height) {
bindProgramFragment(NAMED_PFTexture565);
- if (State->background == 0) {
- bindTexture(NAMED_PFTexture565, 0, NAMED_TBackground);
- } else if (State->background == 1) {
- bindTexture(NAMED_PFTexture565, 0, NAMED_TBackgroundDark);
- } else if (State->background == 2) { //changed from a else to a else if
- bindTexture(NAMED_PFTexture565, 0, NAMED_TBackgroundLookingGlass);
- } else if (State->background == 3) { //added a else if for if set to 3 (cyanogenmod bg)
- bindTexture(NAMED_PFTexture565, 0, NAMED_TBackgroundCyanogenMod); //added cyanogenmod state
- }
+ bindTexture(NAMED_PFTexture565, 0, NAMED_TBackground);
color(1.0f, 1.0f, 1.0f, 1.0f);
if (State->rotate) {
drawRect(0.0f, 0.0f, height*2, width, 0.0f);
} else {
drawRect(0.0f, 0.0f, width*2, height, 0.0f);
- }
+ }
}
View
@@ -48,6 +48,7 @@
<item>Zion</item>
<item>Sholes Red</item>
<item>Wes Garner</item>
+ <item>Soft Blues</item>
</string-array>
<string-array name="nexus_colorscheme_ids" translatable="false">
<item>0</item>
@@ -58,6 +59,7 @@
<item>5</item>
<item>6</item>
<item>7</item>
+ <item>8</item>
</string-array>
<string-array name="nexus_colorscheme_0" translatable="false">
@@ -116,19 +118,27 @@
<item>#1B4B7D</item>
</string-array>
+ <string-array name="nexus_colorscheme_8" translatable="false">
+ <item>#66CCDD</item>
+ <item>#3366AA</item>
+ <item>#6699AA</item>
+ <item>#AABBBB</item>
+ </string-array>
+
<string-array name="nexus_background_names" translatable="false">
<item>Normal</item>
<item>Dark</item>
<item>Looking Glass</item>
<item>Cyanogenmod</item> //added option for cyanogenmod
-
+ <item>Blue Droid</item>// added jegoss's droid background
</string-array>
<string-array name="nexus_background_ids" translatable="false">
- <item>normal</item>
- <item>dark</item>
+ <item>pyramid</item>
+ <item>dark_pyramid</item>
<item>lookingglass</item>
<item>cyanogenmod</item> //added option for cyanogenmod
+ <item>droid</item>//added jeagoss's droid background
</string-array>
</resources>
@@ -29,7 +29,8 @@
protected Resources mResources;
protected RenderScript mRS;
protected ScriptC mScript;
-
+ protected boolean dirty = false;
+
public RenderScriptScene(int width, int height) {
mWidth = width;
mHeight = height;
@@ -72,6 +73,10 @@ public void stop() {
mRS.contextBindRootScript(null);
}
+ public void destroyScript() {
+ mScript.destroy();
+ }
+
public void start() {
mRS.contextBindRootScript(mScript);
}
@@ -81,6 +86,14 @@ public void resize(int width, int height) {
mHeight = height;
}
+ public boolean isDirty() {
+ return dirty;
+ }
+
+ public void setDirty(boolean isDirty) {
+ this.dirty = isDirty;
+ }
+
@SuppressWarnings({"UnusedDeclaration"})
public void setOffset(float xOffset, float yOffset, int xPixels, int yPixels) {
}
@@ -16,11 +16,11 @@
package com.android.wallpaper;
-import android.service.wallpaper.WallpaperService;
import android.os.Bundle;
import android.renderscript.RenderScript;
-import android.view.SurfaceHolder;
+import android.service.wallpaper.WallpaperService;
import android.view.Surface;
+import android.view.SurfaceHolder;
public abstract class RenderScriptWallpaper<T extends RenderScriptScene> extends WallpaperService {
public Engine onCreateEngine() {
@@ -62,6 +62,7 @@ public void onVisibilityChanged(boolean visible) {
super.onVisibilityChanged(visible);
if (mRenderer != null) {
if (visible) {
+ initRendererIfDirty();
mRenderer.start();
} else {
mRenderer.stop();
@@ -75,15 +76,28 @@ public void onSurfaceChanged(SurfaceHolder holder, int format, int width, int he
if (mRs != null) {
mRs.contextSetSurface(width, height, holder.getSurface());
}
- if (mRenderer == null) {
- mRenderer = createScene(width, height);
- mRenderer.init(mRs, getResources(), isPreview());
+ if (mRenderer == null || mRenderer.isDirty()) {
+ if (mRenderer == null) {
+ mRenderer = createScene(width, height);
+ mRenderer.init(mRs, getResources(), isPreview());
+ } else {
+ initRendererIfDirty();
+ }
mRenderer.start();
} else {
mRenderer.resize(width, height);
}
}
+ private synchronized void initRendererIfDirty() {
+ if (mRenderer != null && mRenderer.isDirty()) {
+ mRenderer.stop();
+ mRenderer.destroyScript();
+ mRenderer.setDirty(false);
+ mRenderer.init(mRs, getResources(), isPreview());
+ }
+ }
+
@Override
public void onOffsetsChanged(float xOffset, float yOffset,
float xStep, float yStep, int xPixels, int yPixels) {
Oops, something went wrong.

0 comments on commit 20a19e3

Please sign in to comment.