summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/HardwareLayer.java
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2011-06-24 13:20:23 -0700
committerRomain Guy <romainguy@google.com>2011-06-24 13:20:23 -0700
commit02ccac69fd1c0a03c24c5f3ace0ad4bed337b1fd (patch)
tree60531b505178d4fb169abc83567d5d8db4f14ed0 /core/java/android/view/HardwareLayer.java
parentb0b1b11b965598cb8fb724e636ebb58a77d437b5 (diff)
downloadframeworks_base-02ccac69fd1c0a03c24c5f3ace0ad4bed337b1fd.zip
frameworks_base-02ccac69fd1c0a03c24c5f3ace0ad4bed337b1fd.tar.gz
frameworks_base-02ccac69fd1c0a03c24c5f3ace0ad4bed337b1fd.tar.bz2
Code cleanup
Change-Id: I64c346004e0adf9a776d0315534d4fe445f0c0ca
Diffstat (limited to 'core/java/android/view/HardwareLayer.java')
-rw-r--r--core/java/android/view/HardwareLayer.java30
1 files changed, 28 insertions, 2 deletions
diff --git a/core/java/android/view/HardwareLayer.java b/core/java/android/view/HardwareLayer.java
index 86dec3f..dfb39ae 100644
--- a/core/java/android/view/HardwareLayer.java
+++ b/core/java/android/view/HardwareLayer.java
@@ -16,6 +16,7 @@
package android.view;
+import android.graphics.Bitmap;
import android.graphics.Canvas;
/**
@@ -34,7 +35,7 @@ abstract class HardwareLayer {
int mWidth;
int mHeight;
- final boolean mOpaque;
+ boolean mOpaque;
/**
* Creates a new hardware layer with undefined dimensions.
@@ -92,7 +93,7 @@ abstract class HardwareLayer {
abstract boolean isValid();
/**
- * Resizes the layer, if necessary, to be at least as large
+ * Resize the layer, if necessary, to be at least as large
* as the supplied dimensions.
*
* @param width The new desired minimum width for this layer
@@ -124,4 +125,29 @@ abstract class HardwareLayer {
* @param currentCanvas
*/
abstract void end(Canvas currentCanvas);
+
+ /**
+ * Copies this layer into the specified bitmap.
+ *
+ * @param bitmap The bitmap to copy they layer into
+ *
+ * @return True if the copy was successful, false otherwise
+ */
+ abstract boolean copyInto(Bitmap bitmap);
+
+ /**
+ * Update the layer's properties. This method should be used
+ * when the underlying storage is modified by an external entity.
+ * To change the underlying storage, use the {@link #resize(int, int)}
+ * method instead.
+ *
+ * @param width The new width of this layer
+ * @param height The new height of this layer
+ * @param isOpaque Whether this layer is opaque
+ */
+ void update(int width, int height, boolean isOpaque) {
+ mWidth = width;
+ mHeight = height;
+ mOpaque = isOpaque;
+ }
}