mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 05:45:37 +00:00
Back out d22c4f57daaf and 6c27b32ad788 (bug 758635) on suspicion of causing reftest failures
This commit is contained in:
parent
2a33ae1f2a
commit
b8af2d92b2
@ -42,7 +42,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
||||
/**
|
||||
* The layer renderer implements the rendering logic for a layer view.
|
||||
*/
|
||||
public class LayerRenderer {
|
||||
public class LayerRenderer implements GLSurfaceView.Renderer {
|
||||
private static final String LOGTAG = "GeckoLayerRenderer";
|
||||
private static final String PROFTAG = "GeckoLayerRendererProf";
|
||||
|
||||
@ -196,7 +196,7 @@ public class LayerRenderer {
|
||||
}
|
||||
}
|
||||
|
||||
void onSurfaceCreated(GL10 gl, EGLConfig config) {
|
||||
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
|
||||
checkMonitoringEnabled();
|
||||
createDefaultProgram();
|
||||
activateDefaultProgram();
|
||||
@ -268,6 +268,23 @@ public class LayerRenderer {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called whenever a new frame is about to be drawn.
|
||||
*/
|
||||
public void onDrawFrame(GL10 gl) {
|
||||
/* This code is causing crashes when the surface changes. (bug 738188)
|
||||
* I'm not sure if it actually works, so I'm disabling it now to avoid the crash.
|
||||
Frame frame = createFrame(mView.getController().getViewportMetrics());
|
||||
synchronized (mView.getController()) {
|
||||
frame.beginDrawing();
|
||||
frame.drawBackground();
|
||||
frame.drawRootLayer();
|
||||
frame.drawForeground();
|
||||
frame.endDrawing();
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
private void printCheckerboardStats() {
|
||||
Log.d(PROFTAG, "Frames rendered over last 1000ms: " + mCompleteFramesRendered + "/" + mFramesRendered);
|
||||
mFramesRendered = 0;
|
||||
@ -307,13 +324,21 @@ public class LayerRenderer {
|
||||
mCoordBuffer);
|
||||
}
|
||||
|
||||
void onSurfaceChanged(GL10 gl, final int width, final int height) {
|
||||
public void onSurfaceChanged(GL10 gl, final int width, final int height) {
|
||||
GLES20.glViewport(0, 0, width, height);
|
||||
|
||||
if (mFrameRateLayer != null) {
|
||||
moveFrameRateLayer(width, 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() {
|
||||
public void run() {
|
||||
mView.setViewportSize(new IntSize(width, height));
|
||||
}
|
||||
});
|
||||
|
||||
/* TODO: Throw away tile images? */
|
||||
}
|
||||
|
||||
|
@ -90,6 +90,11 @@ public class LayerView extends SurfaceView implements SurfaceHolder.Callback {
|
||||
public LayerController getController() { return mController; }
|
||||
public TouchEventHandler getTouchEventHandler() { return mTouchEventHandler; }
|
||||
|
||||
/** The LayerRenderer calls this to indicate that the window has changed size. */
|
||||
public void setViewportSize(IntSize size) {
|
||||
mController.setViewportSize(new FloatSize(size));
|
||||
}
|
||||
|
||||
public GeckoInputConnection setInputConnectionHandler() {
|
||||
GeckoInputConnection geckoInputConnection = GeckoInputConnection.create(this);
|
||||
mInputConnectionHandler = geckoInputConnection;
|
||||
|
Loading…
Reference in New Issue
Block a user