Bug 757944 - Remove GL calls made without a context. r=jrmuizelaar

--HG--
extra : rebase_source : aabc39ae9f9d4a5b66eadf87738af4ae38e1c889
This commit is contained in:
Benoit Girard 2012-05-31 15:27:45 -04:00
Родитель ae6f82dc79
Коммит 5bff6f5e9b
2 изменённых файлов: 8 добавлений и 10 удалений

Просмотреть файл

@ -139,8 +139,7 @@ public class GLController {
mGL = mEGLContext.getGL();
if (mView.getRenderer() != null) {
mView.getRenderer().onSurfaceCreated((GL10)mGL, mEGLConfig);
mView.getRenderer().onSurfaceChanged((GL10)mGL, mWidth, mHeight);
mView.getRenderer().resizeView(mWidth, mHeight);
}
}

Просмотреть файл

@ -330,13 +330,7 @@ public class LayerRenderer implements GLSurfaceView.Renderer {
mCoordBuffer);
}
public void onSurfaceChanged(GL10 gl, final int width, final int height) {
GLES20.glViewport(0, 0, width, height);
if (mFrameRateLayer != null) {
moveFrameRateLayer(width, height);
}
public void resizeView(final int width, final int height) {
// updating the state in the view/controller/client should be
// done on the main UI thread, not the GL renderer thread
mView.post(new Runnable() {
@ -348,6 +342,11 @@ public class LayerRenderer implements GLSurfaceView.Renderer {
/* TODO: Throw away tile images? */
}
@Override
public void onSurfaceChanged(GL10 gl, final int width, final int height) {
resizeView(width, height);
}
private void updateDroppedFrames(long frameStartTime) {
int frameElapsedTime = (int)(SystemClock.uptimeMillis() - frameStartTime);