Bug 1227706 - Remove unused GLController calls and events; r=snorp

Remove GLController calls and events in GeckoAppShell and GeckoEvent
that were made obsolete by the new native calls.
This commit is contained in:
Jim Chen 2015-12-23 22:03:34 -05:00
parent 5a099c186a
commit b605aa550c
9 changed files with 0 additions and 119 deletions

View File

@ -288,12 +288,6 @@ public class GeckoAppShell
public static native void invalidateAndScheduleComposite();
// Resuming the compositor is a synchronous request, so be
// careful of possible deadlock. Resuming the compositor will also cause
// a composition, so there is no need to schedule a composition after
// resuming.
public static native void scheduleResumeComposition(int width, int height);
public static native float computeRenderIntegrity();
public static native SurfaceBits getSurfaceBits(Surface surface);

View File

@ -84,9 +84,6 @@ public class GeckoEvent {
NETWORK_CHANGED(22),
THUMBNAIL(25),
SCREENORIENTATION_CHANGED(27),
COMPOSITOR_CREATE(28),
COMPOSITOR_PAUSE(29),
COMPOSITOR_RESUME(30),
NATIVE_GESTURE_EVENT(31),
CALL_OBSERVER(33),
REMOVE_OBSERVER(34),
@ -177,21 +174,6 @@ public class GeckoEvent {
return GeckoEvent.get(NativeGeckoEvent.NOOP);
}
public static GeckoEvent createCompositorCreateEvent(int width, int height) {
GeckoEvent event = GeckoEvent.get(NativeGeckoEvent.COMPOSITOR_CREATE);
event.mWidth = width;
event.mHeight = height;
return event;
}
public static GeckoEvent createCompositorPauseEvent() {
return GeckoEvent.get(NativeGeckoEvent.COMPOSITOR_PAUSE);
}
public static GeckoEvent createCompositorResumeEvent() {
return GeckoEvent.get(NativeGeckoEvent.COMPOSITOR_RESUME);
}
/**
* This method is a replacement for the the KeyEvent.isGamepadButton method to be
* compatible with Build.VERSION.SDK_INT < 12. This is an implementation of the

View File

@ -153,25 +153,6 @@ Java_org_mozilla_gecko_GeckoAppShell_invalidateAndScheduleComposite(JNIEnv * arg
#ifdef JNI_STUBS
typedef void (*Java_org_mozilla_gecko_GeckoAppShell_scheduleResumeComposition_t)(JNIEnv *, jclass, jint, jint);
static Java_org_mozilla_gecko_GeckoAppShell_scheduleResumeComposition_t f_Java_org_mozilla_gecko_GeckoAppShell_scheduleResumeComposition;
extern "C" NS_EXPORT void MOZ_JNICALL
Java_org_mozilla_gecko_GeckoAppShell_scheduleResumeComposition(JNIEnv * arg0, jclass arg1, jint arg2, jint arg3) {
if (!f_Java_org_mozilla_gecko_GeckoAppShell_scheduleResumeComposition) {
arg0->ThrowNew(arg0->FindClass("java/lang/UnsupportedOperationException"),
"JNI Function called before it was loaded");
return ;
}
f_Java_org_mozilla_gecko_GeckoAppShell_scheduleResumeComposition(arg0, arg1, arg2, arg3);
}
#endif
#ifdef JNI_BINDINGS
xul_dlsym("Java_org_mozilla_gecko_GeckoAppShell_scheduleResumeComposition", &f_Java_org_mozilla_gecko_GeckoAppShell_scheduleResumeComposition);
#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

View File

@ -163,12 +163,6 @@ Java_org_mozilla_gecko_GeckoAppShell_invalidateAndScheduleComposite(JNIEnv*, jcl
nsWindow::InvalidateAndScheduleComposite();
}
NS_EXPORT void JNICALL
Java_org_mozilla_gecko_GeckoAppShell_scheduleResumeComposition(JNIEnv*, jclass, jint width, jint height)
{
nsWindow::ScheduleResumeComposition(width, height);
}
NS_EXPORT float JNICALL
Java_org_mozilla_gecko_GeckoAppShell_computeRenderIntegrity(JNIEnv*, jclass)
{

View File

@ -434,12 +434,6 @@ AndroidGeckoEvent::Init(JNIEnv *jenv, jobject jobj)
break;
}
case COMPOSITOR_CREATE: {
mWidth = jenv->GetIntField(jobj, jWidthField);
mHeight = jenv->GetIntField(jobj, jHeightField);
break;
}
case CALL_OBSERVER: {
ReadCharactersField(jenv);
ReadCharactersExtraField(jenv);

View File

@ -656,9 +656,6 @@ public:
NETWORK_CHANGED = 22,
THUMBNAIL = 25,
SCREENORIENTATION_CHANGED = 27,
COMPOSITOR_CREATE = 28,
COMPOSITOR_PAUSE = 29,
COMPOSITOR_RESUME = 30,
NATIVE_GESTURE_EVENT = 31,
CALL_OBSERVER = 33,
REMOVE_OBSERVER = 34,

View File

@ -824,30 +824,6 @@ nsAppShell::LegacyGeckoEvent::PostTo(mozilla::LinkedList<Event>& queue)
{
EVLOG("nsAppShell::PostEvent %p %d", ae, ae->Type());
switch (ae->Type()) {
case AndroidGeckoEvent::COMPOSITOR_CREATE:
case AndroidGeckoEvent::COMPOSITOR_PAUSE:
case AndroidGeckoEvent::COMPOSITOR_RESUME:
// Give priority to these events, but maintain their order wrt each other.
{
Event* event = queue.getFirst();
while (event && event->HasSameTypeAs(this)) {
const auto& e = static_cast<LegacyGeckoEvent*>(event)->ae;
if (e->Type() != AndroidGeckoEvent::COMPOSITOR_CREATE
&& e->Type() != AndroidGeckoEvent::COMPOSITOR_PAUSE
&& e->Type() != AndroidGeckoEvent::COMPOSITOR_RESUME) {
break;
}
event = event->getNext();
}
if (event) {
event->setPrevious(this);
} else {
queue.insertBack(this);
}
EVLOG("nsAppShell: Inserting compositor event %d to maintain priority order", ae->Type());
}
break;
case AndroidGeckoEvent::VIEWPORT:
// Coalesce a previous viewport event with this one, while
// allowing coalescing to happen across native callback events.

View File

@ -1431,34 +1431,6 @@ nsWindow::OnGlobalAndroidEvent(AndroidGeckoEvent *ae)
win->OnNativeGestureEvent(ae);
break;
}
case AndroidGeckoEvent::COMPOSITOR_PAUSE:
// The compositor gets paused when the app is about to go into the
// background. While the compositor is paused, we need to ensure that
// no layer tree updates (from draw events) occur, since the compositor
// cannot make a GL context current in order to process updates.
if (sCompositorChild) {
sCompositorChild->SendPause();
}
sCompositorPaused = true;
break;
case AndroidGeckoEvent::COMPOSITOR_CREATE:
win->CreateLayerManager(ae->Width(), ae->Height());
// Fallthrough
case AndroidGeckoEvent::COMPOSITOR_RESUME:
// When we receive this, the compositor has already been told to
// resume. (It turns out that waiting till we reach here to tell
// the compositor to resume takes too long, resulting in a black
// flash.) This means it's now safe for layer updates to occur.
// Since we might have prevented one or more draw events from
// occurring while the compositor was paused, we need to schedule
// a draw event now.
if (!sCompositorPaused) {
win->RedrawAll();
}
break;
}
}
@ -2983,14 +2955,6 @@ nsWindow::ScheduleResumeComposition()
}
}
void
nsWindow::ScheduleResumeComposition(int width, int height)
{
if (sCompositorParent && sCompositorParent->ScheduleResumeOnCompositorThread(width, height)) {
sCompositorPaused = false;
}
}
float
nsWindow::ComputeRenderIntegrity()
{

View File

@ -167,7 +167,6 @@ public:
static void InvalidateAndScheduleComposite();
static void SchedulePauseComposition();
static void ScheduleResumeComposition();
static void ScheduleResumeComposition(int width, int height);
static float ComputeRenderIntegrity();
static mozilla::layers::APZCTreeManager* GetAPZCTreeManager();
/* RootLayerTreeId() can only be called when GetAPZCTreeManager() returns non-null */