Bug 1273356 - Remove the unused and incorrect ComputeRenderIntegrity codepath for computing checkerboard. r?rbarker
MozReview-Commit-ID: 9lwASRAobar
--- a/gfx/layers/composite/LayerManagerComposite.cpp
+++ b/gfx/layers/composite/LayerManagerComposite.cpp
@@ -1187,231 +1187,16 @@ LayerManagerComposite::RenderToPresentat
composer2D = mCompositor->GetWidget()->GetComposer2D();
if (composer2D) {
composer2D->Render(mirrorScreenWidget);
}
#endif
}
#endif
-static void
-SubtractTransformedRegion(nsIntRegion& aRegion,
- const nsIntRegion& aRegionToSubtract,
- const Matrix4x4& aTransform)
-{
- if (aRegionToSubtract.IsEmpty()) {
- return;
- }
-
- // For each rect in the region, find out its bounds in screen space and
- // subtract it from the screen region.
- for (auto iter = aRegionToSubtract.RectIter(); !iter.Done(); iter.Next()) {
- const IntRect& rect = iter.Get();
- Rect incompleteRect = aTransform.TransformAndClipBounds(IntRectToRect(rect),
- Rect::MaxIntRect());
- aRegion.Sub(aRegion, IntRect(incompleteRect.x,
- incompleteRect.y,
- incompleteRect.width,
- incompleteRect.height));
- }
-}
-
-/* static */ void
-LayerManagerComposite::ComputeRenderIntegrityInternal(Layer* aLayer,
- nsIntRegion& aScreenRegion,
- nsIntRegion& aLowPrecisionScreenRegion,
- const Matrix4x4& aTransform)
-{
- ForEachNode<ForwardIterator>(
- aLayer,
- [&aScreenRegion, &aLowPrecisionScreenRegion, &aTransform] (Layer* layer)
- {
- if (layer->GetOpacity() <= 0.f ||
- (aScreenRegion.IsEmpty() && aLowPrecisionScreenRegion.IsEmpty())) {
- return TraversalFlag::Skip;
- }
-
- // If the layer's a container, recurse into all of its children
- ContainerLayer* container = layer->AsContainerLayer();
- if (container) {
- // Accumulate the transform of intermediate surfaces
- Matrix4x4 transform = aTransform;
- if (container->UseIntermediateSurface()) {
- transform = layer->GetEffectiveTransform();
- transform = aTransform * transform;
- }
- return TraversalFlag::Continue;
- }
-
- // Only painted layers can be incomplete
- PaintedLayer* paintedLayer = layer->AsPaintedLayer();
- if (!paintedLayer || !container) {
- return TraversalFlag::Skip;
- }
- // See if there's any incomplete rendering
- nsIntRegion incompleteRegion = layer->GetLocalVisibleRegion().ToUnknownRegion();
- incompleteRegion.Sub(incompleteRegion, paintedLayer->GetValidRegion());
-
- if (!incompleteRegion.IsEmpty()) {
- // Calculate the transform to get between screen and layer space
- Matrix4x4 transformToScreen = layer->GetEffectiveTransform();
- transformToScreen = aTransform * transformToScreen;
-
- SubtractTransformedRegion(aScreenRegion, incompleteRegion, transformToScreen);
-
- // See if there's any incomplete low-precision rendering
- TiledContentHost* composer = nullptr;
- LayerComposite* shadow = layer->AsLayerComposite();
- if (shadow) {
- composer = shadow->GetCompositableHost()->AsTiledContentHost();
- if (composer) {
- incompleteRegion.Sub(incompleteRegion, composer->GetValidLowPrecisionRegion());
- if (!incompleteRegion.IsEmpty()) {
- SubtractTransformedRegion(aLowPrecisionScreenRegion, incompleteRegion, transformToScreen);
- }
- }
- }
-
- // If we can't get a valid low precision region, assume it's the same as
- // the high precision region.
- if (!composer) {
- SubtractTransformedRegion(aLowPrecisionScreenRegion, incompleteRegion, transformToScreen);
- }
- }
- return TraversalFlag::Skip;
- });
-}
-
-#ifdef MOZ_WIDGET_ANDROID
-static float
-GetDisplayportCoverage(const CSSRect& aDisplayPort,
- const Matrix4x4& aTransformToScreen,
- const IntRect& aScreenRect)
-{
- Rect transformedDisplayport =
- aTransformToScreen.TransformBounds(aDisplayPort.ToUnknownRect());
-
- transformedDisplayport.RoundOut();
- IntRect displayport = IntRect(transformedDisplayport.x,
- transformedDisplayport.y,
- transformedDisplayport.width,
- transformedDisplayport.height);
- if (!displayport.Contains(aScreenRect)) {
- nsIntRegion coveredRegion;
- coveredRegion.And(aScreenRect, displayport);
- return coveredRegion.Area() / (float)(aScreenRect.width * aScreenRect.height);
- }
-
- return 1.0f;
-}
-#endif // MOZ_WIDGET_ANDROID
-
-float
-LayerManagerComposite::ComputeRenderIntegrity()
-{
- // We only ever have incomplete rendering when progressive tiles are enabled.
- Layer* root = GetRoot();
- if (!gfxPlatform::GetPlatform()->UseProgressivePaint() || !root) {
- return 1.f;
- }
-
- FrameMetrics rootMetrics = LayerMetricsWrapper::TopmostScrollableMetrics(root);
- if (!rootMetrics.IsScrollable()) {
- // The root may not have any scrollable metrics, in which case rootMetrics
- // will just be an empty FrameMetrics. Instead use the actual metrics from
- // the root layer.
- rootMetrics = LayerMetricsWrapper(root).Metrics();
- }
- ParentLayerIntRect bounds = RoundedToInt(rootMetrics.GetCompositionBounds());
- IntRect screenRect(bounds.x,
- bounds.y,
- bounds.width,
- bounds.height);
-
- float lowPrecisionMultiplier = 1.0f;
- float highPrecisionMultiplier = 1.0f;
-
-#ifdef MOZ_WIDGET_ANDROID
- // Use the transform on the primary scrollable layer and its FrameMetrics
- // to find out how much of the viewport the current displayport covers
- nsTArray<Layer*> rootScrollableLayers;
- GetRootScrollableLayers(rootScrollableLayers);
- if (rootScrollableLayers.Length() > 0) {
- // This is derived from the code in
- // AsyncCompositionManager::TransformScrollableLayer
- Layer* rootScrollable = rootScrollableLayers[0];
- const FrameMetrics& metrics = LayerMetricsWrapper::TopmostScrollableMetrics(rootScrollable);
- Matrix4x4 transform = rootScrollable->GetEffectiveTransform();
- transform.PostScale(metrics.GetPresShellResolution(), metrics.GetPresShellResolution(), 1);
-
- // Clip the screen rect to the document bounds
- Rect documentBounds =
- transform.TransformBounds(Rect(metrics.GetScrollableRect().x - metrics.GetScrollOffset().x,
- metrics.GetScrollableRect().y - metrics.GetScrollOffset().y,
- metrics.GetScrollableRect().width,
- metrics.GetScrollableRect().height));
- documentBounds.RoundOut();
- screenRect = screenRect.Intersect(IntRect(documentBounds.x, documentBounds.y,
- documentBounds.width, documentBounds.height));
-
- // If the screen rect is empty, the user has scrolled entirely into
- // over-scroll and so we can be considered to have full integrity.
- if (screenRect.IsEmpty()) {
- return 1.0f;
- }
-
- // Work out how much of the critical display-port covers the screen
- bool hasLowPrecision = false;
- if (!metrics.GetCriticalDisplayPort().IsEmpty()) {
- hasLowPrecision = true;
- highPrecisionMultiplier =
- GetDisplayportCoverage(metrics.GetCriticalDisplayPort(), transform, screenRect);
- }
-
- // Work out how much of the display-port covers the screen
- if (!metrics.GetDisplayPort().IsEmpty()) {
- if (hasLowPrecision) {
- lowPrecisionMultiplier =
- GetDisplayportCoverage(metrics.GetDisplayPort(), transform, screenRect);
- } else {
- lowPrecisionMultiplier = highPrecisionMultiplier =
- GetDisplayportCoverage(metrics.GetDisplayPort(), transform, screenRect);
- }
- }
- }
-
- // If none of the screen is covered, we have zero integrity.
- if (highPrecisionMultiplier <= 0.0f && lowPrecisionMultiplier <= 0.0f) {
- return 0.0f;
- }
-#endif // MOZ_WIDGET_ANDROID
-
- nsIntRegion screenRegion(screenRect);
- nsIntRegion lowPrecisionScreenRegion(screenRect);
- Matrix4x4 transform;
- ComputeRenderIntegrityInternal(root, screenRegion,
- lowPrecisionScreenRegion, transform);
-
- if (!screenRegion.IsEqual(screenRect)) {
- // Calculate the area of the region. All rects in an nsRegion are
- // non-overlapping.
- float screenArea = screenRect.width * screenRect.height;
- float highPrecisionIntegrity = screenRegion.Area() / screenArea;
- float lowPrecisionIntegrity = 1.f;
- if (!lowPrecisionScreenRegion.IsEqual(screenRect)) {
- lowPrecisionIntegrity = lowPrecisionScreenRegion.Area() / screenArea;
- }
-
- return ((highPrecisionIntegrity * highPrecisionMultiplier) +
- (lowPrecisionIntegrity * lowPrecisionMultiplier)) / 2;
- }
-
- return 1.f;
-}
-
already_AddRefed<PaintedLayerComposite>
LayerManagerComposite::CreatePaintedLayerComposite()
{
if (mDestroyed) {
NS_WARNING("Call on destroyed layer manager");
return nullptr;
}
return RefPtr<PaintedLayerComposite>(new PaintedLayerComposite(this)).forget();
--- a/gfx/layers/composite/LayerManagerComposite.h
+++ b/gfx/layers/composite/LayerManagerComposite.h
@@ -194,25 +194,16 @@ public:
bool Failed() const { return mFailed; }
private:
CompositableHost* mCompositable;
bool mFailed;
};
/**
- * Calculates the 'completeness' of the rendering that intersected with the
- * screen on the last render. This is only useful when progressive tile
- * drawing is enabled, otherwise this will always return 1.0.
- * This function's expense scales with the size of the layer tree and the
- * complexity of individual layers' valid regions.
- */
- float ComputeRenderIntegrity();
-
- /**
* returns true if PlatformAllocBuffer will return a buffer that supports
* direct texturing
*/
static bool SupportsDirectTexturing();
static void PlatformSyncBeforeReplyUpdate();
void AddInvalidRegion(const nsIntRegion& aRegion)
@@ -344,27 +335,16 @@ private:
/** Region we're clipping our current drawing to. */
nsIntRegion mClippingRegion;
gfx::IntRect mRenderBounds;
/** Current root layer. */
LayerComposite* RootLayer() const;
/**
- * Recursive helper method for use by ComputeRenderIntegrity. Subtracts
- * any incomplete rendering on aLayer from aScreenRegion. Any low-precision
- * rendering is included in aLowPrecisionScreenRegion. aTransform is the
- * accumulated transform of intermediate surfaces beneath aLayer.
- */
- static void ComputeRenderIntegrityInternal(Layer* aLayer,
- nsIntRegion& aScreenRegion,
- nsIntRegion& aLowPrecisionScreenRegion,
- const gfx::Matrix4x4& aTransform);
-
- /**
* Update the invalid region and render it.
*/
void UpdateAndRender();
/**
* Render the current layer tree to the active target.
*/
void Render(const nsIntRegion& aInvalidRegion, const nsIntRegion& aOpaqueRegion);
--- a/gfx/layers/ipc/CompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/CompositorBridgeParent.cpp
@@ -1879,26 +1879,16 @@ CompositorBridgeParent::GetAPZCTreeManag
LayerTreeState* lts = &cit->second;
RefPtr<APZCTreeManager> apzctm = lts->mParent
? lts->mParent->mApzcTreeManager.get()
: nullptr;
return apzctm.forget();
}
-float
-CompositorBridgeParent::ComputeRenderIntegrity()
-{
- if (mLayerManager) {
- return mLayerManager->ComputeRenderIntegrity();
- }
-
- return 1.0f;
-}
-
static void
InsertVsyncProfilerMarker(TimeStamp aVsyncTimestamp)
{
#ifdef MOZ_ENABLE_PROFILER_SPS
MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
VsyncPayload* payload = new VsyncPayload(aVsyncTimestamp);
PROFILER_MARKER_PAYLOAD("VsyncTimestamp", payload);
#endif
--- a/gfx/layers/ipc/CompositorBridgeParent.h
+++ b/gfx/layers/ipc/CompositorBridgeParent.h
@@ -477,18 +477,16 @@ public:
*/
virtual bool RecvRemotePluginsReady() override;
/**
* Used by the profiler to denote when a vsync occured
*/
static void PostInsertVsyncProfilerMarker(mozilla::TimeStamp aVsyncTimestamp);
- float ComputeRenderIntegrity();
-
widget::CompositorWidget* GetWidget() { return mWidget; }
void ForceComposeToTarget(gfx::DrawTarget* aTarget, const gfx::IntRect* aRect = nullptr);
bool AsyncPanZoomEnabled() const {
return !!mApzcTreeManager;
}
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoAppShell.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoAppShell.java
@@ -256,18 +256,16 @@ public class GeckoAppShell
@WrapForJNI
public static native void notifyUriVisited(String uri);
public static native void notifyBatteryChange(double aLevel, boolean aCharging, double aRemainingTime);
public static native void invalidateAndScheduleComposite();
- public static native float computeRenderIntegrity();
-
public static native void addPresentationSurface(Surface surface);
public static native void removePresentationSurface(Surface surface);
public static native void onFullScreenPluginHidden(View view);
private static LayerView sLayerView;
private static Rect sScreenSize;
--- a/mobile/android/base/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
+++ b/mobile/android/base/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
@@ -931,17 +931,16 @@ class GeckoLayerClient implements LayerV
@WrapForJNI(allowMultithread = true)
public LayerRenderer.Frame createFrame() {
// Create the shaders and textures if necessary.
if (!mLayerRendererInitialized) {
if (mLayerRenderer == null) {
return null;
}
- mLayerRenderer.checkMonitoringEnabled();
mLayerRenderer.createDefaultProgram();
mLayerRendererInitialized = true;
}
try {
return mLayerRenderer.createFrame(mFrameMetrics);
} catch (Exception e) {
Log.w(LOGTAG, e);
--- a/mobile/android/base/java/org/mozilla/gecko/gfx/LayerRenderer.java
+++ b/mobile/android/base/java/org/mozilla/gecko/gfx/LayerRenderer.java
@@ -38,17 +38,16 @@ import java.util.List;
import javax.microedition.khronos.egl.EGLConfig;
/**
* The layer renderer implements the rendering logic for a layer view.
*/
public class LayerRenderer implements Tabs.OnTabsChangedListener {
private static final String LOGTAG = "GeckoLayerRenderer";
- private static final String PROFTAG = "GeckoLayerRendererProf";
/*
* The amount of time a frame is allowed to take to render before we declare it a dropped
* frame.
*/
private static final int MAX_FRAME_TIME = 16; /* 1000 ms / 60 FPS */
private static final int FRAME_RATE_METER_WIDTH = 128;
@@ -73,22 +72,16 @@ public class LayerRenderer implements Ta
private final CopyOnWriteArrayList<RenderTask> mTasks;
private final CopyOnWriteArrayList<Layer> mExtraLayers = new CopyOnWriteArrayList<Layer>();
// Dropped frames display
private final int[] mFrameTimings;
private int mCurrentFrame, mFrameTimingsSum, mDroppedFrames;
- // Render profiling output
- private int mFramesRendered;
- private float mCompleteFramesRendered;
- private boolean mProfileRender;
- private long mProfileOutputTime;
-
private IntBuffer mPixelBuffer;
// Used by GLES 2.0
private int mProgram;
private int mPositionHandle;
private int mTextureHandle;
private int mSampleHandle;
private int mTMatrixHandle;
@@ -199,17 +192,16 @@ public class LayerRenderer implements Ta
mHorizScrollLayer.destroy();
mVertScrollLayer.destroy();
}
Tabs.unregisterOnTabsChangedListener(this);
mZoomedViewListeners.clear();
}
void onSurfaceCreated(EGLConfig config) {
- checkMonitoringEnabled();
createDefaultProgram();
activateDefaultProgram();
}
public void createDefaultProgram() {
int vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, DEFAULT_VERTEX_SHADER);
int fragmentShader = loadShader(GLES20.GL_FRAGMENT_SHADER, DEFAULT_FRAGMENT_SHADER);
@@ -303,22 +295,16 @@ public class LayerRenderer implements Ta
}
public void removeLayer(Layer layer) {
synchronized (mExtraLayers) {
mExtraLayers.remove(layer);
}
}
- private void printCheckerboardStats() {
- Log.d(PROFTAG, "Frames rendered over last 1000ms: " + mCompleteFramesRendered + "/" + mFramesRendered);
- mFramesRendered = 0;
- mCompleteFramesRendered = 0;
- }
-
/** Used by robocop for testing purposes. Not for production use! */
IntBuffer getPixels() {
IntBuffer pixelBuffer = IntBuffer.allocate(mView.getWidth() * mView.getHeight());
synchronized (pixelBuffer) {
mPixelBuffer = pixelBuffer;
mView.requestRender();
try {
pixelBuffer.wait();
@@ -369,20 +355,16 @@ public class LayerRenderer implements Ta
mDroppedFrames += (frameElapsedTime + 1) / MAX_FRAME_TIME;
mFrameTimings[mCurrentFrame] = frameElapsedTime;
mCurrentFrame = (mCurrentFrame + 1) % mFrameTimings.length;
int averageTime = mFrameTimingsSum / mFrameTimings.length;
}
- void checkMonitoringEnabled() {
- mProfileRender = Log.isLoggable(PROFTAG, Log.DEBUG);
- }
-
/*
* create a vertex shader type (GLES20.GL_VERTEX_SHADER)
* or a fragment shader type (GLES20.GL_FRAGMENT_SHADER)
*/
public static int loadShader(int type, String shaderCode) {
int shader = GLES20.glCreateShader(type);
GLES20.glShaderSource(shader, shaderCode);
GLES20.glCompileShader(shader);
@@ -549,37 +531,16 @@ public class LayerRenderer implements Ta
if (mPageRect.height() > mFrameMetrics.getHeight())
mVertScrollLayer.draw(mPageContext);
/* Draw the horizontal scrollbar. */
if (mPageRect.width() > mFrameMetrics.getWidth())
mHorizScrollLayer.draw(mPageContext);
}
- /* Measure how much of the screen is checkerboarding */
- Layer rootLayer = mView.getLayerClient().getRoot();
- if ((rootLayer != null) &&
- (mProfileRender || PanningPerfAPI.isRecordingCheckerboard())) {
- // Calculate the incompletely rendered area of the page
- float checkerboard = 1.0f - GeckoAppShell.computeRenderIntegrity();
-
- PanningPerfAPI.recordCheckerboard(checkerboard);
- if (checkerboard < 0.0f || checkerboard > 1.0f) {
- Log.e(LOGTAG, "Checkerboard value out of bounds: " + checkerboard);
- }
-
- mCompleteFramesRendered += 1.0f - checkerboard;
- mFramesRendered ++;
-
- if (mFrameStartTime - mProfileOutputTime > NANOS_PER_SECOND) {
- mProfileOutputTime = mFrameStartTime;
- printCheckerboardStats();
- }
- }
-
runRenderTasks(mTasks, true, mFrameStartTime);
}
private void maybeRequestZoomedViewRender(RenderContext context) {
// Concurrently update of mZoomedViewListeners should not be an issue here
// because the following line is just a short-circuit
if (mZoomedViewListeners.size() == 0) {
--- a/mobile/android/base/java/org/mozilla/gecko/gfx/PanningPerfAPI.java
+++ b/mobile/android/base/java/org/mozilla/gecko/gfx/PanningPerfAPI.java
@@ -20,36 +20,27 @@ public class PanningPerfAPI {
// list, as that may be expensive and impact the thing we're trying
// to measure.
private static final int EXPECTED_FRAME_COUNT = 2048;
private static boolean mRecordingFrames;
private static List<Long> mFrameTimes;
private static long mFrameStartTime;
- private static boolean mRecordingCheckerboard;
- private static List<Float> mCheckerboardAmounts;
- private static long mCheckerboardStartTime;
-
private static void initialiseRecordingArrays() {
if (mFrameTimes == null) {
mFrameTimes = new ArrayList<Long>(EXPECTED_FRAME_COUNT);
} else {
mFrameTimes.clear();
}
- if (mCheckerboardAmounts == null) {
- mCheckerboardAmounts = new ArrayList<Float>(EXPECTED_FRAME_COUNT);
- } else {
- mCheckerboardAmounts.clear();
- }
}
@RobocopTarget
public static void startFrameTimeRecording() {
- if (mRecordingFrames || mRecordingCheckerboard) {
+ if (mRecordingFrames) {
Log.e(LOGTAG, "Error: startFrameTimeRecording() called while already recording!");
return;
}
mRecordingFrames = true;
initialiseRecordingArrays();
mFrameStartTime = SystemClock.uptimeMillis();
}
@@ -65,63 +56,18 @@ public class PanningPerfAPI {
public static void recordFrameTime() {
// this will be called often, so try to make it as quick as possible
if (mRecordingFrames) {
mFrameTimes.add(SystemClock.uptimeMillis() - mFrameStartTime);
}
}
- public static boolean isRecordingCheckerboard() {
- return mRecordingCheckerboard;
- }
-
@RobocopTarget
public static void startCheckerboardRecording() {
- if (mRecordingCheckerboard || mRecordingFrames) {
- Log.e(LOGTAG, "Error: startCheckerboardRecording() called while already recording!");
- return;
- }
- mRecordingCheckerboard = true;
- initialiseRecordingArrays();
- mCheckerboardStartTime = SystemClock.uptimeMillis();
+ throw new UnsupportedOperationException();
}
@RobocopTarget
public static List<Float> stopCheckerboardRecording() {
- if (!mRecordingCheckerboard) {
- Log.e(LOGTAG, "Error: stopCheckerboardRecording() called when not recording!");
- return null;
- }
- mRecordingCheckerboard = false;
-
- // We take the number of values in mCheckerboardAmounts here, as there's
- // the possibility that this function is called while recordCheckerboard
- // is still executing. As values are added to this list last, we use
- // this number as the canonical number of recordings.
- int values = mCheckerboardAmounts.size();
- if (values == 0) {
- Log.w(LOGTAG, "stopCheckerboardRecording() found no checkerboard amounts!");
- return mCheckerboardAmounts;
- }
-
- // The score will be the sum of all the values in mCheckerboardAmounts,
- // so weight the checkerboard values by time so that frame-rate and
- // run-length don't affect score.
- long lastTime = 0;
- float totalTime = mFrameTimes.get(values - 1);
- for (int i = 0; i < values; i++) {
- long elapsedTime = mFrameTimes.get(i) - lastTime;
- mCheckerboardAmounts.set(i, mCheckerboardAmounts.get(i) * elapsedTime / totalTime);
- lastTime += elapsedTime;
- }
-
- return mCheckerboardAmounts;
- }
-
- public static void recordCheckerboard(float amount) {
- // this will be called often, so try to make it as quick as possible
- if (mRecordingCheckerboard) {
- mFrameTimes.add(SystemClock.uptimeMillis() - mCheckerboardStartTime);
- mCheckerboardAmounts.add(amount);
- }
+ throw new UnsupportedOperationException();
}
}
--- a/mozglue/android/jni-stubs.inc
+++ b/mozglue/android/jni-stubs.inc
@@ -129,35 +129,16 @@ Java_org_mozilla_gecko_GeckoAppShell_inv
#endif
#ifdef JNI_BINDINGS
xul_dlsym("Java_org_mozilla_gecko_GeckoAppShell_invalidateAndScheduleComposite", &f_Java_org_mozilla_gecko_GeckoAppShell_invalidateAndScheduleComposite);
#endif
#ifdef JNI_STUBS
-typedef jfloat (*Java_org_mozilla_gecko_GeckoAppShell_computeRenderIntegrity_t)(JNIEnv *, jclass);
-static Java_org_mozilla_gecko_GeckoAppShell_computeRenderIntegrity_t f_Java_org_mozilla_gecko_GeckoAppShell_computeRenderIntegrity;
-extern "C" NS_EXPORT jfloat MOZ_JNICALL
-Java_org_mozilla_gecko_GeckoAppShell_computeRenderIntegrity(JNIEnv * arg0, jclass arg1) {
- if (!f_Java_org_mozilla_gecko_GeckoAppShell_computeRenderIntegrity) {
- arg0->ThrowNew(arg0->FindClass("java/lang/UnsupportedOperationException"),
- "JNI Function called before it was loaded");
- return 0;
- }
- return f_Java_org_mozilla_gecko_GeckoAppShell_computeRenderIntegrity(arg0, arg1);
-}
-#endif
-
-#ifdef JNI_BINDINGS
- xul_dlsym("Java_org_mozilla_gecko_GeckoAppShell_computeRenderIntegrity", &f_Java_org_mozilla_gecko_GeckoAppShell_computeRenderIntegrity);
-#endif
-
-#ifdef JNI_STUBS
-
typedef void (*Java_org_mozilla_gecko_GeckoAppShell_addPresentationSurface_t)(JNIEnv *, jclass, jobject);
static Java_org_mozilla_gecko_GeckoAppShell_addPresentationSurface_t f_Java_org_mozilla_gecko_GeckoAppShell_addPresentationSurface;
extern "C" NS_EXPORT void MOZ_JNICALL
Java_org_mozilla_gecko_GeckoAppShell_addPresentationSurface(JNIEnv * arg0, jclass arg1, jobject arg2) {
if (!f_Java_org_mozilla_gecko_GeckoAppShell_addPresentationSurface) {
arg0->ThrowNew(arg0->FindClass("java/lang/UnsupportedOperationException"),
"JNI Function called before it was loaded");
return ;
--- a/widget/android/AndroidJNI.cpp
+++ b/widget/android/AndroidJNI.cpp
@@ -118,22 +118,16 @@ Java_org_mozilla_gecko_GeckoAppShell_not
}
NS_EXPORT void JNICALL
Java_org_mozilla_gecko_GeckoAppShell_invalidateAndScheduleComposite(JNIEnv*, jclass)
{
nsWindow::InvalidateAndScheduleComposite();
}
-NS_EXPORT float JNICALL
-Java_org_mozilla_gecko_GeckoAppShell_computeRenderIntegrity(JNIEnv*, jclass)
-{
- return nsWindow::ComputeRenderIntegrity();
-}
-
NS_EXPORT void JNICALL
Java_org_mozilla_gecko_GeckoAppShell_addPresentationSurface(JNIEnv* jenv, jclass, jobject surface)
{
if (surface != NULL) {
void* window = AndroidBridge::Bridge()->AcquireNativeWindow(jenv, surface);
if (window) {
AndroidBridge::Bridge()->SetPresentationWindow(window);
}
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -3638,28 +3638,16 @@ nsWindow::SchedulePauseComposition()
void
nsWindow::ScheduleResumeComposition()
{
if (gGeckoViewWindow && gGeckoViewWindow->mLayerViewSupport) {
return gGeckoViewWindow->mLayerViewSupport->SyncResumeCompositor();
}
}
-float
-nsWindow::ComputeRenderIntegrity()
-{
- if (gGeckoViewWindow) {
- if (RefPtr<CompositorBridgeParent> bridge = gGeckoViewWindow->GetCompositorBridgeParent()) {
- return bridge->ComputeRenderIntegrity();
- }
- }
-
- return 1.f;
-}
-
bool
nsWindow::WidgetPaintsBackground()
{
static bool sWidgetPaintsBackground = true;
static bool sWidgetPaintsBackgroundPrefCached = false;
if (!sWidgetPaintsBackgroundPrefCached) {
sWidgetPaintsBackgroundPrefCached = true;
--- a/widget/android/nsWindow.h
+++ b/widget/android/nsWindow.h
@@ -174,17 +174,16 @@ public:
virtual bool NeedsPaint() override;
virtual void DrawWindowUnderlay(LayerManagerComposite* aManager, LayoutDeviceIntRect aRect) override;
virtual void DrawWindowOverlay(LayerManagerComposite* aManager, LayoutDeviceIntRect aRect) override;
static bool IsCompositionPaused();
static void InvalidateAndScheduleComposite();
static void SchedulePauseComposition();
static void ScheduleResumeComposition();
- static float ComputeRenderIntegrity();
virtual bool WidgetPaintsBackground() override;
virtual uint32_t GetMaxTouchPoints() const override;
void UpdateZoomConstraints(const uint32_t& aPresShellId,
const FrameMetrics::ViewID& aViewId,
const mozilla::Maybe<ZoomConstraints>& aConstraints) override;