diff options
author | Derek Sollenberger <djsollen@google.com> | 2009-08-06 11:19:23 -0400 |
---|---|---|
committer | Derek Sollenberger <djsollen@google.com> | 2009-08-06 11:41:36 -0400 |
commit | 1bd20523ef1896ad4e6f7026cc54effdd1565d40 (patch) | |
tree | a9abfa768a8e9e84d44758c5b105932a87ff5130 | |
parent | d4f09592f721e6358fdadbdf363f034f842f860d (diff) | |
download | frameworks_base-1bd20523ef1896ad4e6f7026cc54effdd1565d40.zip frameworks_base-1bd20523ef1896ad4e6f7026cc54effdd1565d40.tar.gz frameworks_base-1bd20523ef1896ad4e6f7026cc54effdd1565d40.tar.bz2 |
adding ability to fix the size of a surface view when created.
-rw-r--r-- | core/java/android/webkit/WebViewCore.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java index 7cfe5b5..ff4e736 100644 --- a/core/java/android/webkit/WebViewCore.java +++ b/core/java/android/webkit/WebViewCore.java @@ -1991,14 +1991,16 @@ final class WebViewCore { implements SurfaceHolder.Callback { private final ViewManager.ChildView mChildView; private int mPointer; + private final boolean mIsFixedSize; SurfaceViewProxy(Context context, ViewManager.ChildView childView, - int pointer) { + int pointer, boolean isFixedSize) { super(context); setWillNotDraw(false); // this prevents the black box artifact getHolder().addCallback(this); mChildView = childView; mChildView.mView = this; mPointer = pointer; + mIsFixedSize = isFixedSize; } void destroy() { mPointer = 0; @@ -2006,6 +2008,10 @@ final class WebViewCore { } void attach(int x, int y, int width, int height) { mChildView.attachView(x, y, width, height); + + if (mIsFixedSize) { + getHolder().setFixedSize(width, height); + } } // SurfaceHolder.Callback methods @@ -2029,12 +2035,12 @@ final class WebViewCore { // PluginWidget functions for mainting SurfaceViews for the Surface drawing // model. - private SurfaceView createSurface(int nativePointer) { + private SurfaceView createSurface(int nativePointer, boolean isFixedSize) { if (mWebView == null) { return null; } return new SurfaceViewProxy(mContext, - mWebView.mViewManager.createView(), nativePointer); + mWebView.mViewManager.createView(), nativePointer, isFixedSize); } private void destroySurface(SurfaceView surface) { |