зеркало из https://github.com/mozilla/gecko-dev.git
Backout 017f6dd98dc0 for robocop failures
This commit is contained in:
Родитель
d48462522e
Коммит
8ed5421d42
|
@ -1743,15 +1743,9 @@ abstract public class GeckoApp
|
|||
* run experience, perhaps?
|
||||
*/
|
||||
mLayerController = new LayerController(this);
|
||||
View v = mLayerController.getView();
|
||||
|
||||
mPlaceholderLayerClient = new PlaceholderLayerClient(mLayerController, mLastViewport);
|
||||
if (!mPlaceholderLayerClient.loadScreenshot()) {
|
||||
// Instead of flickering the checkerboard, show a white screen until Gecko paints
|
||||
v.setBackgroundColor(Color.WHITE);
|
||||
}
|
||||
|
||||
mGeckoLayout.addView(v, 0);
|
||||
mGeckoLayout.addView(mLayerController.getView(), 0);
|
||||
}
|
||||
|
||||
mPluginContainer = (AbsoluteLayout) findViewById(R.id.plugin_container);
|
||||
|
|
|
@ -367,7 +367,6 @@ public class GeckoLayerClient implements GeckoEventResponder,
|
|||
// a full viewport update, which is fine because if browser.js has somehow moved to
|
||||
// be out of sync with this first-paint viewport, then we force them back in sync.
|
||||
mLayerController.abortPanZoomAnimation();
|
||||
mLayerController.getView().setPaintState(LayerView.PAINT_BEFORE_FIRST);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -680,16 +680,6 @@ public class LayerRenderer implements GLSurfaceView.Renderer {
|
|||
pixelBuffer.notify();
|
||||
}
|
||||
}
|
||||
|
||||
// Remove white screen once we've painted
|
||||
if (mView.getPaintState() == LayerView.PAINT_BEFORE_FIRST) {
|
||||
GeckoAppShell.getMainHandler().postAtFrontOfQueue(new Runnable() {
|
||||
public void run() {
|
||||
mView.setBackgroundColor(android.graphics.Color.TRANSPARENT);
|
||||
}
|
||||
});
|
||||
mView.setPaintState(LayerView.PAINT_AFTER_FIRST);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
|
||||
package org.mozilla.gecko.gfx;
|
||||
|
||||
import org.mozilla.gecko.GeckoAppShell;
|
||||
import org.mozilla.gecko.GeckoInputConnection;
|
||||
import org.mozilla.gecko.gfx.FloatSize;
|
||||
import org.mozilla.gecko.gfx.InputConnectionHandler;
|
||||
|
@ -78,14 +77,6 @@ public class LayerView extends FlexibleGLSurfaceView {
|
|||
private static String LOGTAG = "GeckoLayerView";
|
||||
/* List of events to be processed if the page does not prevent them. Should only be touched on the main thread */
|
||||
private LinkedList<MotionEvent> mEventQueue = new LinkedList<MotionEvent>();
|
||||
/* Must be a PAINT_xxx constant */
|
||||
private int mPaintState = PAINT_NONE;
|
||||
|
||||
/* Flags used to determine when to show the painted surface. The integer
|
||||
* order must correspond to the order in which these states occur. */
|
||||
public static final int PAINT_NONE = 0;
|
||||
public static final int PAINT_BEFORE_FIRST = 1;
|
||||
public static final int PAINT_AFTER_FIRST = 2;
|
||||
|
||||
|
||||
public LayerView(Context context, LayerController controller) {
|
||||
|
@ -246,17 +237,5 @@ public class LayerView extends FlexibleGLSurfaceView {
|
|||
public LayerRenderer getLayerRenderer() {
|
||||
return mRenderer;
|
||||
}
|
||||
|
||||
/* paintState must be a PAINT_xxx constant. The state will only be changed
|
||||
* if paintState represents a state that occurs after the current state. */
|
||||
public void setPaintState(int paintState) {
|
||||
if (paintState > mPaintState) {
|
||||
mPaintState = paintState;
|
||||
}
|
||||
}
|
||||
|
||||
public int getPaintState() {
|
||||
return mPaintState;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -79,6 +79,25 @@ public class PlaceholderLayerClient {
|
|||
} else {
|
||||
mViewport = new ViewportMetrics();
|
||||
}
|
||||
loadScreenshot();
|
||||
|
||||
|
||||
if (mViewportUnknown)
|
||||
mViewport.setViewport(mLayerController.getViewport());
|
||||
mLayerController.setViewportMetrics(mViewport);
|
||||
|
||||
BufferedCairoImage image = new BufferedCairoImage(mBuffer, mWidth, mHeight, mFormat);
|
||||
SingleTileLayer tileLayer = new SingleTileLayer(image);
|
||||
|
||||
tileLayer.beginTransaction(); // calling thread irrelevant; nobody else has a ref to tileLayer yet
|
||||
try {
|
||||
Point origin = PointUtils.round(mViewport.getOrigin());
|
||||
tileLayer.setPosition(new Rect(origin.x, origin.y, origin.x + mWidth, origin.y + mHeight));
|
||||
} finally {
|
||||
tileLayer.endTransaction();
|
||||
}
|
||||
|
||||
mLayerController.setRoot(tileLayer);
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
|
@ -88,7 +107,7 @@ public class PlaceholderLayerClient {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean loadScreenshot() {
|
||||
boolean loadScreenshot() {
|
||||
if (GeckoApp.mAppContext.mLastScreen == null)
|
||||
return false;
|
||||
|
||||
|
@ -112,18 +131,6 @@ public class PlaceholderLayerClient {
|
|||
mLayerController.setPageSize(mViewport.getPageSize());
|
||||
}
|
||||
|
||||
BufferedCairoImage image = new BufferedCairoImage(mBuffer, mWidth, mHeight, mFormat);
|
||||
SingleTileLayer tileLayer = new SingleTileLayer(image);
|
||||
|
||||
tileLayer.beginTransaction(); // calling thread irrelevant; nobody else has a ref to tileLayer yet
|
||||
try {
|
||||
Point origin = PointUtils.round(mViewport.getOrigin());
|
||||
tileLayer.setPosition(new Rect(origin.x, origin.y, origin.x + mWidth, origin.y + mHeight));
|
||||
} finally {
|
||||
tileLayer.endTransaction();
|
||||
}
|
||||
|
||||
mLayerController.setRoot(tileLayer);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче