summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/view/HardwareRenderer.java12
-rw-r--r--core/java/android/view/Surface.java31
2 files changed, 28 insertions, 15 deletions
diff --git a/core/java/android/view/HardwareRenderer.java b/core/java/android/view/HardwareRenderer.java
index 69bdef0..0247f6a 100644
--- a/core/java/android/view/HardwareRenderer.java
+++ b/core/java/android/view/HardwareRenderer.java
@@ -216,9 +216,11 @@ public abstract class HardwareRenderer {
/**
* Return a string for the EGL error code, or the hex representation
- * if an unknown error.
- * @param error EGL error.
- * @return Error string.
+ * if the error is unknown.
+ *
+ * @param error The EGL error to convert into a String.
+ *
+ * @return An error string correponding to the EGL error code.
*/
static String getEGLErrorString(int error) {
switch (error) {
@@ -446,11 +448,9 @@ public abstract class HardwareRenderer {
}
/**
- * Defines the EGL configuration for this renderer. The default configuration
- * is RGBX, no depth, no stencil.
+ * Defines the EGL configuration for this renderer.
*
* @return An {@link android.view.HardwareRenderer.GlRenderer.EglConfigChooser}.
- * @param glVersion
*/
EglConfigChooser getConfigChooser(int glVersion) {
return new ComponentSizeChooser(glVersion, 8, 8, 8, 8, 0, 0);
diff --git a/core/java/android/view/Surface.java b/core/java/android/view/Surface.java
index cd0ae3b..d596a7f 100644
--- a/core/java/android/view/Surface.java
+++ b/core/java/android/view/Surface.java
@@ -86,6 +86,15 @@ public class Surface implements Parcelable {
* play back.
*/
public static final int PUSH_BUFFERS = 0x00000200;
+ /**
+ * Indicates that the surface must be considered opaque, even if its
+ * pixel format is set to translucent. This can be useful if an
+ * application needs full RGBA 8888 support for instance but will
+ * still draw every pixel opaque.
+ *
+ * @hide
+ */
+ public static final int OPAQUE = 0x00000400;
/** Creates a normal surface. This is the default */
public static final int FX_SURFACE_NORMAL = 0x00000000;
@@ -269,7 +278,7 @@ public class Surface implements Parcelable {
}
mOrigMatrix.set(m);
}
- };
+ }
/**
* Sets the display metrics used to provide canva's width/height in compatibility mode.
@@ -422,16 +431,20 @@ public class Surface implements Parcelable {
/* no user serviceable parts here ... */
@Override
protected void finalize() throws Throwable {
- if (mNativeSurface != 0 || mSurfaceControl != 0) {
- if (DEBUG_RELEASE) {
- Log.w(LOG_TAG, "Surface.finalize() has work. You should have called release() ("
- + mNativeSurface + ", " + mSurfaceControl + ")", mCreationStack);
- } else {
- Log.w(LOG_TAG, "Surface.finalize() has work. You should have called release() ("
- + mNativeSurface + ", " + mSurfaceControl + ")");
+ try {
+ super.finalize();
+ } finally {
+ if (mNativeSurface != 0 || mSurfaceControl != 0) {
+ if (DEBUG_RELEASE) {
+ Log.w(LOG_TAG, "Surface.finalize() has work. You should have called release() ("
+ + mNativeSurface + ", " + mSurfaceControl + ")", mCreationStack);
+ } else {
+ Log.w(LOG_TAG, "Surface.finalize() has work. You should have called release() ("
+ + mNativeSurface + ", " + mSurfaceControl + ")");
+ }
}
+ release();
}
- release();
}
private native void init(SurfaceSession s,