Bug 745243 - Wait for surfaceChanged before calling GLController.provideEGLSurface. r=kats

This commit is contained in:
Ali Juma
2012-05-18 15:58:46 -04:00
parent 313c40000b
commit 13440b7d69
2 changed files with 5 additions and 9 deletions

View File

@@ -135,22 +135,19 @@ public class GLController {
return mHeight;
}
synchronized void surfaceCreated() {
mSurfaceValid = true;
notifyAll();
}
synchronized void surfaceDestroyed() {
mSurfaceValid = false;
notifyAll();
}
synchronized void sizeChanged(int newWidth, int newHeight) {
synchronized void surfaceChanged(int newWidth, int newHeight) {
mWidth = newWidth;
mHeight = newHeight;
if (mGL != null) {
mView.getRenderer().onSurfaceChanged((GL10)mGL, mWidth, mHeight);
}
mSurfaceValid = true;
notifyAll();
}
private void initEGL() {
@@ -175,7 +172,7 @@ public class GLController {
if (mView.getRenderer() != null) {
mView.getRenderer().onSurfaceCreated((GL10)mGL, mEGLConfig);
mView.getRenderer().onSurfaceChanged((GL10)mGL, mView.getWidth(), mView.getHeight());
mView.getRenderer().onSurfaceChanged((GL10)mGL, mWidth, mHeight);
}
}

View File

@@ -236,7 +236,7 @@ public class LayerView extends SurfaceView implements SurfaceHolder.Callback {
/** Implementation of SurfaceHolder.Callback */
public synchronized void surfaceChanged(SurfaceHolder holder, int format, int width,
int height) {
mGLController.sizeChanged(width, height);
mGLController.surfaceChanged(width, height);
if (mListener != null) {
mListener.surfaceChanged(width, height);
@@ -245,7 +245,6 @@ public class LayerView extends SurfaceView implements SurfaceHolder.Callback {
/** Implementation of SurfaceHolder.Callback */
public synchronized void surfaceCreated(SurfaceHolder holder) {
mGLController.surfaceCreated();
}
/** Implementation of SurfaceHolder.Callback */