summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/java/android/app/ActivityManager.java3
-rw-r--r--core/java/android/service/wallpaper/WallpaperService.java2
-rw-r--r--core/java/android/view/HardwareRenderer.java5
-rw-r--r--core/jni/android_view_DisplayListCanvas.cpp11
-rw-r--r--core/res/res/raw/color_fade_frag.frag6
5 files changed, 19 insertions, 8 deletions
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index 0ae9187..5fc3437 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -529,7 +529,8 @@ public class ActivityManager {
static public boolean isHighEndGfx() {
return (!isLowRamDeviceStatic() &&
!Resources.getSystem().getBoolean(com.android.internal.R.bool.config_avoidGfxAccel))
- || isForcedHighEndGfx();
+ || isForcedHighEndGfx()
+ || "0".equals(SystemProperties.get("ro.softwaregl", "0"));
}
/**
diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java
index d598291..fa3d9c9 100644
--- a/core/java/android/service/wallpaper/WallpaperService.java
+++ b/core/java/android/service/wallpaper/WallpaperService.java
@@ -189,7 +189,7 @@ public abstract class WallpaperService extends Service {
final BaseSurfaceHolder mSurfaceHolder = new BaseSurfaceHolder() {
{
- mRequestedFormat = PixelFormat.RGBX_8888;
+ mRequestedFormat = PixelFormat.RGBA_8888;
}
@Override
diff --git a/core/java/android/view/HardwareRenderer.java b/core/java/android/view/HardwareRenderer.java
index 5e58250..f67bb9c 100644
--- a/core/java/android/view/HardwareRenderer.java
+++ b/core/java/android/view/HardwareRenderer.java
@@ -19,6 +19,7 @@ package android.view;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Rect;
+import android.os.SystemProperties;
import android.view.Surface.OutOfResourcesException;
import java.io.File;
@@ -161,14 +162,14 @@ public abstract class HardwareRenderer {
*
* @hide
*/
- public static boolean sRendererDisabled = false;
+ public static boolean sRendererDisabled = SystemProperties.get("ro.softwaregl").equals("1") ? true : false;
/**
* Further hardware renderer disabling for the system process.
*
* @hide
*/
- public static boolean sSystemRendererDisabled = false;
+ public static boolean sSystemRendererDisabled = SystemProperties.get("ro.softwaregl").equals("1") ? true : false;
private boolean mEnabled;
private boolean mRequested = true;
diff --git a/core/jni/android_view_DisplayListCanvas.cpp b/core/jni/android_view_DisplayListCanvas.cpp
index ef1e4ab..fedb37d 100644
--- a/core/jni/android_view_DisplayListCanvas.cpp
+++ b/core/jni/android_view_DisplayListCanvas.cpp
@@ -222,14 +222,19 @@ static void android_view_DisplayListCanvas_drawLayer(JNIEnv* env, jobject clazz,
static jboolean android_view_DisplayListCanvas_isAvailable(JNIEnv* env, jobject clazz) {
char prop[PROPERTY_VALUE_MAX];
- if (property_get("ro.kernel.qemu", prop, NULL) == 0) {
- // not in the emulator
+ char software_rendering[PROPERTY_VALUE_MAX];
+
+ property_get("ro.softwaregl", software_rendering, "0");
+
+ if (property_get("ro.kernel.qemu", prop, NULL) == 0 && !atoi(software_rendering)) {
+ // not in the emulator and device has hardware acceleration
return JNI_TRUE;
}
+
// In the emulator this property will be set to 1 when hardware GLES is
// enabled, 0 otherwise. On old emulator versions it will be undefined.
property_get("ro.kernel.qemu.gles", prop, "0");
- return atoi(prop) == 1 ? JNI_TRUE : JNI_FALSE;
+ return (atoi(prop) == 1 && !atoi(software_rendering)) ? JNI_TRUE : JNI_FALSE;
}
// ----------------------------------------------------------------------------
diff --git a/core/res/res/raw/color_fade_frag.frag b/core/res/res/raw/color_fade_frag.frag
index a66a5a7..df3d704 100644
--- a/core/res/res/raw/color_fade_frag.frag
+++ b/core/res/res/raw/color_fade_frag.frag
@@ -7,6 +7,7 @@ uniform float saturation;
uniform float gamma;
varying vec2 UV;
+/*
vec3 rgb2hsl(vec3 rgb)
{
float e = 1.0e-7;
@@ -32,11 +33,14 @@ vec3 hsl2rgb(vec3 hsl)
float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y;
return (rgb - vec3(0.5)) * c + hsl.z;
}
+*/
void main()
{
+/*
vec4 color = texture2D(texUnit, UV);
vec3 hsl = rgb2hsl(color.xyz);
vec3 rgb = pow(hsl2rgb(vec3(hsl.x, hsl.y * saturation, hsl.z * opacity)), vec3(gamma));
- gl_FragColor = vec4(rgb, 1.0);
+*/
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
}