зеркало из https://github.com/mozilla/gecko-dev.git
Bug 757944 - Remove GL calls made without a context. r=jrmuizelaar
--HG-- extra : rebase_source : aabc39ae9f9d4a5b66eadf87738af4ae38e1c889
This commit is contained in:
Родитель
ae6f82dc79
Коммит
5bff6f5e9b
|
@ -112,7 +112,7 @@ public class GLController {
|
|||
mWidth = newWidth;
|
||||
mHeight = newHeight;
|
||||
if (mGL != null) {
|
||||
mView.getRenderer().onSurfaceChanged((GL10)mGL, mWidth, mHeight);
|
||||
mView.getRenderer().onSurfaceChanged((GL10)mGL, mWidth, mHeight);
|
||||
}
|
||||
mSurfaceValid = true;
|
||||
notifyAll();
|
||||
|
@ -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);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче