mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1238761 - Remove obsolete APZ code; r=rbarker
With APZC supporting multiple nsWindows, this patch removes some obsolete APZ code, including the previous implementation of NativePanZoomController native methods in AndroidJNI.cpp, and the various static members of nsWindow.
This commit is contained in:
parent
04e56b3de0
commit
37091dff4e
@ -42,7 +42,6 @@ using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
using namespace mozilla::layers;
|
||||
using namespace mozilla::widget;
|
||||
using namespace mozilla::widget::android;
|
||||
|
||||
/* Forward declare all the JNI methods as extern "C" */
|
||||
|
||||
@ -305,85 +304,4 @@ Java_org_mozilla_gecko_GeckoAppShell_dispatchMemoryPressure(JNIEnv* jenv, jclass
|
||||
NS_DispatchMemoryPressure(MemPressure_New);
|
||||
}
|
||||
|
||||
NS_EXPORT void JNICALL
|
||||
Java_org_mozilla_gecko_gfx_NativePanZoomController_abortAnimation(JNIEnv* env, jobject instance)
|
||||
{
|
||||
APZCTreeManager *controller = nsWindow::GetAPZCTreeManager();
|
||||
if (controller) {
|
||||
// TODO: Pass in correct values for presShellId and viewId.
|
||||
controller->CancelAnimation(ScrollableLayerGuid(nsWindow::RootLayerTreeId(), 0, 0));
|
||||
}
|
||||
}
|
||||
|
||||
NS_EXPORT void JNICALL
|
||||
Java_org_mozilla_gecko_gfx_NativePanZoomController_init(JNIEnv* env, jobject instance)
|
||||
{
|
||||
if (!AndroidBridge::Bridge()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& newRef = NativePanZoomController::Ref::From(instance);
|
||||
NativePanZoomController::LocalRef oldRef =
|
||||
AndroidContentController::SetNativePanZoomController(newRef);
|
||||
|
||||
// MOZ_ASSERT(!oldRef, "Registering a new NPZC when we already have one");
|
||||
}
|
||||
|
||||
NS_EXPORT jboolean JNICALL
|
||||
Java_org_mozilla_gecko_gfx_NativePanZoomController_handleTouchEvent(JNIEnv* env, jobject instance, jobject event)
|
||||
{
|
||||
APZCTreeManager *controller = nsWindow::GetAPZCTreeManager();
|
||||
if (!controller) {
|
||||
return false;
|
||||
}
|
||||
|
||||
AndroidGeckoEvent* wrapper = AndroidGeckoEvent::MakeFromJavaObject(env, event);
|
||||
MultiTouchInput input = wrapper->MakeMultiTouchInput(nsWindow::TopWindow());
|
||||
delete wrapper;
|
||||
|
||||
if (input.mType < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ScrollableLayerGuid guid;
|
||||
uint64_t blockId;
|
||||
nsEventStatus status = controller->ReceiveInputEvent(input, &guid, &blockId);
|
||||
if (status != nsEventStatus_eConsumeNoDefault) {
|
||||
nsAppShell::PostEvent(AndroidGeckoEvent::MakeApzInputEvent(input, guid, blockId, status));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
NS_EXPORT void JNICALL
|
||||
Java_org_mozilla_gecko_gfx_NativePanZoomController_handleMotionEvent(JNIEnv* env, jobject instance, jobject event)
|
||||
{
|
||||
// FIXME implement this
|
||||
}
|
||||
|
||||
NS_EXPORT void JNICALL
|
||||
Java_org_mozilla_gecko_gfx_NativePanZoomController_destroy(JNIEnv* env, jobject instance)
|
||||
{
|
||||
if (!AndroidBridge::Bridge()) {
|
||||
return;
|
||||
}
|
||||
|
||||
NativePanZoomController::LocalRef oldRef =
|
||||
AndroidContentController::SetNativePanZoomController(nullptr);
|
||||
|
||||
MOZ_ASSERT(oldRef, "Clearing a non-existent NPZC");
|
||||
}
|
||||
|
||||
NS_EXPORT jboolean JNICALL
|
||||
Java_org_mozilla_gecko_gfx_NativePanZoomController_getRedrawHint(JNIEnv* env, jobject instance)
|
||||
{
|
||||
// FIXME implement this
|
||||
return true;
|
||||
}
|
||||
|
||||
NS_EXPORT void JNICALL
|
||||
Java_org_mozilla_gecko_gfx_NativePanZoomController_setIsLongpressEnabled(JNIEnv* env, jobject instance, jboolean isLongpressEnabled)
|
||||
{
|
||||
APZCTreeManager::SetLongTapEnabled(isLongpressEnabled);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3230,8 +3230,6 @@ nsWindow::DrawWindowOverlay(LayerManagerComposite* aManager,
|
||||
|
||||
// off-main-thread compositor fields and functions
|
||||
|
||||
StaticRefPtr<mozilla::layers::APZCTreeManager> nsWindow::sApzcTreeManager;
|
||||
|
||||
void
|
||||
nsWindow::InvalidateAndScheduleComposite()
|
||||
{
|
||||
@ -3309,21 +3307,6 @@ nsWindow::NewCompositorParent(int aSurfaceWidth, int aSurfaceHeight)
|
||||
return new CompositorParent(this, true, aSurfaceWidth, aSurfaceHeight);
|
||||
}
|
||||
|
||||
mozilla::layers::APZCTreeManager*
|
||||
nsWindow::GetAPZCTreeManager()
|
||||
{
|
||||
return sApzcTreeManager;
|
||||
}
|
||||
|
||||
void
|
||||
nsWindow::ConfigureAPZCTreeManager()
|
||||
{
|
||||
nsBaseWidget::ConfigureAPZCTreeManager();
|
||||
if (!sApzcTreeManager) {
|
||||
sApzcTreeManager = mAPZC;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsWindow::ConfigureAPZControllerThread()
|
||||
{
|
||||
@ -3337,13 +3320,6 @@ nsWindow::CreateRootContentController()
|
||||
return controller.forget();
|
||||
}
|
||||
|
||||
uint64_t
|
||||
nsWindow::RootLayerTreeId()
|
||||
{
|
||||
MOZ_ASSERT(gGeckoViewWindow && gGeckoViewWindow->mCompositorParent);
|
||||
return gGeckoViewWindow->mCompositorParent->RootLayerTreeId();
|
||||
}
|
||||
|
||||
uint32_t
|
||||
nsWindow::GetMaxTouchPoints() const
|
||||
{
|
||||
|
@ -174,9 +174,6 @@ public:
|
||||
static void SchedulePauseComposition();
|
||||
static void ScheduleResumeComposition();
|
||||
static float ComputeRenderIntegrity();
|
||||
static mozilla::layers::APZCTreeManager* GetAPZCTreeManager();
|
||||
/* RootLayerTreeId() can only be called when GetAPZCTreeManager() returns non-null */
|
||||
static uint64_t RootLayerTreeId();
|
||||
|
||||
virtual bool WidgetPaintsBackground() override;
|
||||
|
||||
@ -194,7 +191,6 @@ protected:
|
||||
RefPtr<mozilla::TextComposition> GetIMEComposition();
|
||||
void RemoveIMEComposition();
|
||||
|
||||
void ConfigureAPZCTreeManager() override;
|
||||
void ConfigureAPZControllerThread() override;
|
||||
void DispatchHitTest(const mozilla::WidgetTouchEvent& aEvent);
|
||||
|
||||
@ -228,8 +224,6 @@ private:
|
||||
void RedrawAll();
|
||||
|
||||
mozilla::widget::LayerRenderer::Frame::GlobalRef mLayerRendererFrame;
|
||||
|
||||
static mozilla::StaticRefPtr<mozilla::layers::APZCTreeManager> sApzcTreeManager;
|
||||
};
|
||||
|
||||
#endif /* NSWINDOW_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user