diff options
author | Sascha Prueter <saschap@google.com> | 2012-12-07 12:40:32 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-12-07 12:40:32 -0800 |
commit | 961ce2afbf82d4b2a9691f1c1cc75a97ce43fe2b (patch) | |
tree | 2a97e9b90fe9b7eac855356701a1b044a32b264d /core/java/android/view | |
parent | 524962c8cf796035f7578515ba48080873d46057 (diff) | |
parent | 2588648b5268526bdc9ed7fb4e9eac36c8c693dc (diff) | |
download | frameworks_base-961ce2afbf82d4b2a9691f1c1cc75a97ce43fe2b.zip frameworks_base-961ce2afbf82d4b2a9691f1c1cc75a97ce43fe2b.tar.gz frameworks_base-961ce2afbf82d4b2a9691f1c1cc75a97ce43fe2b.tar.bz2 |
am 2588648b: am 203f69f0: Merge "Call setSize to sync Surface to SurfaceFlinger. DO NOT MERGE" into jb-mr1.1-dev
* commit '2588648b5268526bdc9ed7fb4e9eac36c8c693dc':
Call setSize to sync Surface to SurfaceFlinger. DO NOT MERGE
Diffstat (limited to 'core/java/android/view')
-rw-r--r-- | core/java/android/view/Surface.java | 19 |
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); } |