summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2010-10-06 19:49:23 -0700
committerRomain Guy <romainguy@google.com>2010-10-06 19:49:23 -0700
commit6b7bd24659fb175fe1f0e97c86c18969918b496a (patch)
tree7f72a7811783f52871bdb49c702ef1247ce9d3a2 /core
parente3095e0c1e2a4a4f34f741aa386eae56536ca5aa (diff)
downloadframeworks_base-6b7bd24659fb175fe1f0e97c86c18969918b496a.zip
frameworks_base-6b7bd24659fb175fe1f0e97c86c18969918b496a.tar.gz
frameworks_base-6b7bd24659fb175fe1f0e97c86c18969918b496a.tar.bz2
Don't clear the framebuffer when not needed.
Diffstat (limited to 'core')
-rw-r--r--core/java/android/view/GLES20Canvas.java4
-rw-r--r--core/java/android/view/HardwareRenderer.java2
-rw-r--r--core/java/android/view/ViewRoot.java49
-rw-r--r--core/jni/android_view_GLES20Canvas.cpp6
4 files changed, 35 insertions, 26 deletions
diff --git a/core/java/android/view/GLES20Canvas.java b/core/java/android/view/GLES20Canvas.java
index f0b00dd..2fadb82 100644
--- a/core/java/android/view/GLES20Canvas.java
+++ b/core/java/android/view/GLES20Canvas.java
@@ -135,10 +135,10 @@ class GLES20Canvas extends HardwareCanvas {
@Override
void onPreDraw() {
- nPrepare(mRenderer);
+ nPrepare(mRenderer, mOpaque);
}
- private native void nPrepare(int renderer);
+ private native void nPrepare(int renderer, boolean opaque);
@Override
void onPostDraw() {
diff --git a/core/java/android/view/HardwareRenderer.java b/core/java/android/view/HardwareRenderer.java
index 2cc4052..b87dbc5 100644
--- a/core/java/android/view/HardwareRenderer.java
+++ b/core/java/android/view/HardwareRenderer.java
@@ -585,7 +585,7 @@ public abstract class HardwareRenderer {
@Override
GLES20Canvas createCanvas() {
- return mGlCanvas = new GLES20Canvas(true);
+ return mGlCanvas = new GLES20Canvas(mTranslucent);
}
@Override
diff --git a/core/java/android/view/ViewRoot.java b/core/java/android/view/ViewRoot.java
index 155122f..79f1f5b 100644
--- a/core/java/android/view/ViewRoot.java
+++ b/core/java/android/view/ViewRoot.java
@@ -16,25 +16,41 @@
package android.view;
-import com.android.internal.view.BaseSurfaceHolder;
-import com.android.internal.view.IInputMethodCallback;
-import com.android.internal.view.IInputMethodSession;
-import com.android.internal.view.RootViewSurfaceTaker;
-
+import android.Manifest;
+import android.app.ActivityManagerNative;
+import android.content.ClipDescription;
+import android.content.ComponentCallbacks;
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.content.res.CompatibilityInfo;
+import android.content.res.Configuration;
+import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.PixelFormat;
-import android.graphics.PorterDuff;
import android.graphics.Point;
import android.graphics.PointF;
+import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.graphics.Region;
-import android.os.*;
+import android.media.AudioManager;
+import android.os.Binder;
+import android.os.Bundle;
+import android.os.Debug;
+import android.os.Handler;
+import android.os.LatencyTimer;
+import android.os.Looper;
+import android.os.Message;
+import android.os.ParcelFileDescriptor;
import android.os.Process;
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import android.os.SystemClock;
+import android.os.SystemProperties;
import android.util.AndroidRuntimeException;
import android.util.Config;
import android.util.DisplayMetrics;
-import android.util.Log;
import android.util.EventLog;
+import android.util.Log;
import android.util.Slog;
import android.util.SparseArray;
import android.view.View.MeasureSpec;
@@ -43,21 +59,14 @@ import android.view.accessibility.AccessibilityManager;
import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputMethodManager;
import android.widget.Scroller;
-import android.content.pm.PackageManager;
-import android.content.res.CompatibilityInfo;
-import android.content.res.Configuration;
-import android.content.res.Resources;
-import android.content.ClipData;
-import android.content.ClipDescription;
-import android.content.ComponentCallbacks;
-import android.content.Context;
-import android.app.ActivityManagerNative;
-import android.Manifest;
-import android.media.AudioManager;
+import com.android.internal.view.BaseSurfaceHolder;
+import com.android.internal.view.IInputMethodCallback;
+import com.android.internal.view.IInputMethodSession;
+import com.android.internal.view.RootViewSurfaceTaker;
-import java.lang.ref.WeakReference;
import java.io.IOException;
import java.io.OutputStream;
+import java.lang.ref.WeakReference;
import java.util.ArrayList;
/**
diff --git a/core/jni/android_view_GLES20Canvas.cpp b/core/jni/android_view_GLES20Canvas.cpp
index 7521af4..2001919 100644
--- a/core/jni/android_view_GLES20Canvas.cpp
+++ b/core/jni/android_view_GLES20Canvas.cpp
@@ -103,8 +103,8 @@ static void android_view_GLES20Canvas_setViewport(JNIEnv* env, jobject canvas,
}
static void android_view_GLES20Canvas_prepare(JNIEnv* env, jobject canvas,
- OpenGLRenderer* renderer) {
- renderer->prepare();
+ OpenGLRenderer* renderer, jboolean opaque) {
+ renderer->prepare(opaque);
}
static void android_view_GLES20Canvas_finish(JNIEnv* env, jobject canvas,
@@ -445,7 +445,7 @@ static JNINativeMethod gMethods[] = {
{ "nCreateRenderer", "()I", (void*) android_view_GLES20Canvas_createRenderer },
{ "nDestroyRenderer", "(I)V", (void*) android_view_GLES20Canvas_destroyRenderer },
{ "nSetViewport", "(III)V", (void*) android_view_GLES20Canvas_setViewport },
- { "nPrepare", "(I)V", (void*) android_view_GLES20Canvas_prepare },
+ { "nPrepare", "(IZ)V", (void*) android_view_GLES20Canvas_prepare },
{ "nFinish", "(I)V", (void*) android_view_GLES20Canvas_finish },
{ "nAcquireContext", "(I)V", (void*) android_view_GLES20Canvas_acquireContext },
{ "nReleaseContext", "(I)V", (void*) android_view_GLES20Canvas_releaseContext },