summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/view/Surface.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/core/java/android/view/Surface.java b/core/java/android/view/Surface.java
index 550a740..0a81a71 100644
--- a/core/java/android/view/Surface.java
+++ b/core/java/android/view/Surface.java
@@ -225,6 +225,9 @@ public class Surface implements Parcelable {
// non compatibility mode.
private Matrix mCompatibleMatrix;
+ private int mWidth;
+ private int mHeight;
+
private native void nativeCreate(SurfaceSession session, String name,
int w, int h, int format, int flags)
throws OutOfResourcesException;
@@ -330,6 +333,8 @@ public class Surface implements Parcelable {
checkHeadless();
mName = name;
+ mWidth = w;
+ mHeight = h;
nativeCreate(session, name, w, h, format, flags);
mCloseGuard.open("release");
@@ -538,7 +543,7 @@ public class Surface implements Parcelable {
/** @hide */
public void setPosition(int x, int y) {
- nativeSetPosition((float)x, (float)y);
+ nativeSetPosition(x, y);
}
/** @hide */
@@ -548,10 +553,22 @@ public class Surface implements Parcelable {
/** @hide */
public void setSize(int w, int h) {
+ mWidth = w;
+ mHeight = h;
nativeSetSize(w, h);
}
/** @hide */
+ public int getWidth() {
+ return mWidth;
+ }
+
+ /** @hide */
+ public int getHeight() {
+ return mHeight;
+ }
+
+ /** @hide */
public void hide() {
nativeSetFlags(SURFACE_HIDDEN, SURFACE_HIDDEN);
}