merge b2g-inbound to mozilla-central a=merge

This commit is contained in:
Carsten "Tomcat" Book 2015-01-12 14:59:45 +01:00
commit 830e9e7d40
33 changed files with 249 additions and 144 deletions

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e0c735ec89df011ea7dd435087a9045ecff9ff9e">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="f5e481d4caf9ffa561720a6fc9cf521a28bd8439"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b0254d13e67b0bd4c74c2f2c9b9ea1251949d9fe"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cd63c7ae655ee08ffac32ce36a188f8fefc4b272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="f5e481d4caf9ffa561720a6fc9cf521a28bd8439"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b0254d13e67b0bd4c74c2f2c9b9ea1251949d9fe"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cd63c7ae655ee08ffac32ce36a188f8fefc4b272"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d5d3f93914558b6f168447b805cd799c8233e300"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="f5e481d4caf9ffa561720a6fc9cf521a28bd8439"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b0254d13e67b0bd4c74c2f2c9b9ea1251949d9fe"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cd63c7ae655ee08ffac32ce36a188f8fefc4b272"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e0c735ec89df011ea7dd435087a9045ecff9ff9e">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="f5e481d4caf9ffa561720a6fc9cf521a28bd8439"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b0254d13e67b0bd4c74c2f2c9b9ea1251949d9fe"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cd63c7ae655ee08ffac32ce36a188f8fefc4b272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="f5e481d4caf9ffa561720a6fc9cf521a28bd8439"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b0254d13e67b0bd4c74c2f2c9b9ea1251949d9fe"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cd63c7ae655ee08ffac32ce36a188f8fefc4b272"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d5d3f93914558b6f168447b805cd799c8233e300"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e0c735ec89df011ea7dd435087a9045ecff9ff9e">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="f5e481d4caf9ffa561720a6fc9cf521a28bd8439"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b0254d13e67b0bd4c74c2f2c9b9ea1251949d9fe"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cd63c7ae655ee08ffac32ce36a188f8fefc4b272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="f5e481d4caf9ffa561720a6fc9cf521a28bd8439"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b0254d13e67b0bd4c74c2f2c9b9ea1251949d9fe"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cd63c7ae655ee08ffac32ce36a188f8fefc4b272"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>

View File

@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
"revision": "3bf54932bcae08eb6cab2453a2be007835423cbd",
"revision": "4f9b71ccf0770ad99ba7f802d951f569e10b1021",
"repo_path": "integration/gaia-central"
}

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="f5e481d4caf9ffa561720a6fc9cf521a28bd8439"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b0254d13e67b0bd4c74c2f2c9b9ea1251949d9fe"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cd63c7ae655ee08ffac32ce36a188f8fefc4b272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>

View File

@ -15,7 +15,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="f5e481d4caf9ffa561720a6fc9cf521a28bd8439"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b0254d13e67b0bd4c74c2f2c9b9ea1251949d9fe"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cd63c7ae655ee08ffac32ce36a188f8fefc4b272"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="f5e481d4caf9ffa561720a6fc9cf521a28bd8439"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b0254d13e67b0bd4c74c2f2c9b9ea1251949d9fe"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cd63c7ae655ee08ffac32ce36a188f8fefc4b272"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="f5e481d4caf9ffa561720a6fc9cf521a28bd8439"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b0254d13e67b0bd4c74c2f2c9b9ea1251949d9fe"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="cd63c7ae655ee08ffac32ce36a188f8fefc4b272"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -290,6 +290,7 @@ if test -n "$gonkdir" ; then
AC_SUBST(MOZ_AUDIO_OFFLOAD)
AC_DEFINE(MOZ_AUDIO_OFFLOAD)
MOZ_FMP4=
MOZ_B2G_CAMERA=1
MOZ_B2G_BT=1
MOZ_B2G_BT_BLUEDROID=1
if test -d "$gonkdir/system/bluetoothd"; then

View File

@ -40,6 +40,7 @@
#include "AutoRwLock.h"
#include "GonkCameraHwMgr.h"
#include "GonkRecorderProfiles.h"
#include "GrallocImages.h"
#include "CameraCommon.h"
#include "GonkCameraParameters.h"
#include "DeviceStorageFileDescriptor.h"

View File

@ -183,7 +183,13 @@ GonkCameraHardware::Init()
#if defined(MOZ_WIDGET_GONK)
#if ANDROID_VERSION >= 19
#if ANDROID_VERSION >= 21
sp<IGraphicBufferProducer> producer;
sp<IGonkGraphicBufferConsumer> consumer;
GonkBufferQueue::createBufferQueue(&producer, &consumer);
mNativeWindow = new GonkNativeWindow(consumer, GonkCameraHardware::MIN_UNDEQUEUED_BUFFERS);
mCamera->setPreviewTarget(producer);
#elif ANDROID_VERSION >= 19
mNativeWindow = new GonkNativeWindow(GonkCameraHardware::MIN_UNDEQUEUED_BUFFERS);
sp<GonkBufferQueue> bq = mNativeWindow->getBufferQueue();
bq->setSynchronousMode(false);

View File

@ -1154,7 +1154,11 @@ status_t GonkRecorder::setupMediaSource(
return err;
}
*mediaSource = cameraSource;
#if ANDROID_VERSION >= 21
} else if (mVideoSource == VIDEO_SOURCE_SURFACE) {
#else
} else if (mVideoSource == VIDEO_SOURCE_GRALLOC_BUFFER) {
#endif
return BAD_VALUE;
} else {
return INVALID_OPERATION;

View File

@ -29,6 +29,7 @@ DEFINE_KEYNAME_WITH_SAME_NAME(Unidentified)
* Our Internal Key Values (must have "Moz" prefix)
*****************************************************************************/
DEFINE_KEYNAME_INTERNAL(PrintableKey, "MozPrintableKey")
DEFINE_KEYNAME_INTERNAL(HomeScreen, "MozHomeScreen")
/******************************************************************************
* Modifier Keys

View File

@ -2195,7 +2195,11 @@ TabParent::MaybeForwardEventToRenderFrame(WidgetInputEvent& aEvent,
ScrollableLayerGuid* aOutTargetGuid,
uint64_t* aOutInputBlockId)
{
if (aEvent.mClass == eWheelEventClass) {
if (aEvent.mClass == eWheelEventClass
#ifdef MOZ_WIDGET_GONK
|| aEvent.mClass == eTouchEventClass
#endif
) {
// Wheel events must be sent to APZ directly from the widget. New APZ-
// aware events should follow suit and move there as well. However, we
// do need to inform the child process of the correct target and block

View File

@ -1059,15 +1059,16 @@ AutoMounter::UpdateState()
vol->StartUnmount(mResponseCallback);
return; // UpdateState will be called again when the Unmount command completes
}
case nsIVolume::STATE_IDLE: {
LOG("UpdateState: Volume %s is nsIVolume::STATE_IDLE", vol->NameStr());
case nsIVolume::STATE_IDLE:
case nsIVolume::STATE_MOUNT_FAIL: {
LOG("UpdateState: Volume %s is %s", vol->NameStr(), vol->StateStr());
if (vol->IsFormatting() && !vol->IsFormatRequested()) {
vol->SetFormatRequested(false);
LOG("UpdateState: Mounting %s", vol->NameStr());
vol->StartMount(mResponseCallback);
break;
}
if (tryToShare && vol->IsSharingEnabled()) {
if (tryToShare && vol->IsSharingEnabled() && volState == nsIVolume::STATE_IDLE) {
// Volume is unmounted. We can go ahead and share.
LOG("UpdateState: Sharing %s", vol->NameStr());
vol->StartShare(mResponseCallback);

View File

@ -337,11 +337,13 @@ Volume::SetState(Volume::STATE aNewState)
break;
case nsIVolume::STATE_MOUNTED:
case nsIVolume::STATE_MOUNT_FAIL:
mMountRequested = false;
mIsFormatting = false;
mIsSharing = false;
mIsUnmounting = false;
break;
case nsIVolume::STATE_FORMATTING:
mFormatRequested = false;
mIsFormatting = true;
@ -541,7 +543,12 @@ Volume::HandleVoldResponse(int aResponseCode, nsCWhitespaceTokenizer& aTokenizer
// then the AutoMounter will set the volume as STATE_MOUNTED.
SetState(nsIVolume::STATE_CHECKMNT);
} else {
SetState(newState);
if (State() == nsIVolume::STATE_CHECKING && newState == nsIVolume::STATE_IDLE) {
LOG("Mount of volume '%s' failed", NameStr());
SetState(nsIVolume::STATE_MOUNT_FAIL);
} else {
SetState(newState);
}
}
break;
}

View File

@ -5,10 +5,12 @@
#include "nsISupports.idl"
#include "nsIVolumeStat.idl"
[scriptable, uuid(946B5334-6EC9-11E4-8689-F3061E5D46B0)]
[scriptable, uuid(EE752CB8-8FD7-11E4-A602-70221D5D46B0)]
interface nsIVolume : nsISupports
{
// These MUST match the states from android's system/vold/Volume.h header
// Note: Changes made to the STATE_xxx names should also be reflected in the
// NS_VolumeStateStr function found in Volume.cpp
const long STATE_INIT = -1;
const long STATE_NOMEDIA = 0;
const long STATE_IDLE = 1;
@ -20,6 +22,7 @@ interface nsIVolume : nsISupports
const long STATE_SHARED = 7;
const long STATE_SHAREDMNT = 8;
const long STATE_CHECKMNT = 100;
const long STATE_MOUNT_FAIL = 101;
// The name of the volume. Often there is only one volume, called sdcard.
// But some phones support multiple volumes.

View File

@ -38,6 +38,7 @@ NS_VolumeStateStr(int32_t aState)
case nsIVolume::STATE_SHARED: return "Shared";
case nsIVolume::STATE_SHAREDMNT: return "Shared-Mounted";
case nsIVolume::STATE_CHECKMNT: return "Check-Mounted";
case nsIVolume::STATE_MOUNT_FAIL: return "Mount-Fail";
}
return "???";
}

View File

@ -89,7 +89,7 @@ APZCTreeManager::CalculatePendingDisplayPort(
APZCTreeManager::APZCTreeManager()
: mInputQueue(new InputQueue()),
mTreeLock("APZCTreeLock"),
mHitResultForInputBlock(NoApzcHit),
mHitResultForInputBlock(HitNothing),
mRetainedTouchIdentifier(-1),
mTouchCount(0),
mApzcTreeLog("apzctree")
@ -561,7 +561,7 @@ APZCTreeManager::ReceiveInputEvent(InputData& aEvent,
}
nsEventStatus result = nsEventStatus_eIgnore;
Matrix4x4 transformToApzc;
HitTestResult hitResult = NoApzcHit;
HitTestResult hitResult = HitNothing;
switch (aEvent.mInputType) {
case MULTITOUCH_INPUT: {
MultiTouchInput& touchInput = aEvent.AsMultiTouchInput();
@ -572,7 +572,7 @@ APZCTreeManager::ReceiveInputEvent(InputData& aEvent,
nsRefPtr<AsyncPanZoomController> apzc = GetTargetAPZC(wheelInput.mOrigin,
&hitResult);
if (apzc) {
MOZ_ASSERT(hitResult == ApzcHitRegion || hitResult == ApzcContentRegion);
MOZ_ASSERT(hitResult == HitLayer || hitResult == HitDispatchToContentRegion);
transformToApzc = GetScreenToApzcTransform(apzc);
wheelInput.mLocalOrigin =
@ -580,7 +580,7 @@ APZCTreeManager::ReceiveInputEvent(InputData& aEvent,
result = mInputQueue->ReceiveInputEvent(
apzc,
/* aTargetConfirmed = */ hitResult == ApzcHitRegion,
/* aTargetConfirmed = */ hitResult == HitLayer,
wheelInput, aOutInputBlockId);
// Update the out-parameters so they are what the caller expects.
@ -595,7 +595,7 @@ APZCTreeManager::ReceiveInputEvent(InputData& aEvent,
nsRefPtr<AsyncPanZoomController> apzc = GetTargetAPZC(panInput.mPanStartPoint,
&hitResult);
if (apzc) {
MOZ_ASSERT(hitResult == ApzcHitRegion || hitResult == ApzcContentRegion);
MOZ_ASSERT(hitResult == HitLayer || hitResult == HitDispatchToContentRegion);
transformToApzc = GetScreenToApzcTransform(apzc);
panInput.mLocalPanStartPoint = TransformTo<ParentLayerPixel>(
transformToApzc, panInput.mPanStartPoint);
@ -603,7 +603,7 @@ APZCTreeManager::ReceiveInputEvent(InputData& aEvent,
transformToApzc, panInput.mPanDisplacement, panInput.mPanStartPoint);
result = mInputQueue->ReceiveInputEvent(
apzc,
/* aTargetConfirmed = */ hitResult == ApzcHitRegion,
/* aTargetConfirmed = */ hitResult == HitLayer,
panInput, aOutInputBlockId);
// Update the out-parameters so they are what the caller expects.
@ -620,13 +620,13 @@ APZCTreeManager::ReceiveInputEvent(InputData& aEvent,
nsRefPtr<AsyncPanZoomController> apzc = GetTargetAPZC(pinchInput.mFocusPoint,
&hitResult);
if (apzc) {
MOZ_ASSERT(hitResult == ApzcHitRegion || hitResult == ApzcContentRegion);
MOZ_ASSERT(hitResult == HitLayer || hitResult == HitDispatchToContentRegion);
transformToApzc = GetScreenToApzcTransform(apzc);
pinchInput.mLocalFocusPoint = TransformTo<ParentLayerPixel>(
transformToApzc, pinchInput.mFocusPoint);
result = mInputQueue->ReceiveInputEvent(
apzc,
/* aTargetConfirmed = */ hitResult == ApzcHitRegion,
/* aTargetConfirmed = */ hitResult == HitLayer,
pinchInput, aOutInputBlockId);
// Update the out-parameters so they are what the caller expects.
@ -641,13 +641,13 @@ APZCTreeManager::ReceiveInputEvent(InputData& aEvent,
nsRefPtr<AsyncPanZoomController> apzc = GetTargetAPZC(tapInput.mPoint,
&hitResult);
if (apzc) {
MOZ_ASSERT(hitResult == ApzcHitRegion || hitResult == ApzcContentRegion);
MOZ_ASSERT(hitResult == HitLayer || hitResult == HitDispatchToContentRegion);
transformToApzc = GetScreenToApzcTransform(apzc);
tapInput.mLocalPoint = TransformTo<ParentLayerPixel>(
transformToApzc, tapInput.mPoint);
result = mInputQueue->ReceiveInputEvent(
apzc,
/* aTargetConfirmed = */ hitResult == ApzcHitRegion,
/* aTargetConfirmed = */ hitResult == HitLayer,
tapInput, aOutInputBlockId);
// Update the out-parameters so they are what the caller expects.
@ -658,7 +658,7 @@ APZCTreeManager::ReceiveInputEvent(InputData& aEvent,
break;
}
}
if (hitResult == OverscrolledApzc) {
if (hitResult == HitOverscrolledApzc) {
result = nsEventStatus_eConsumeNoDefault;
}
return result;
@ -715,9 +715,9 @@ APZCTreeManager::ProcessTouchInput(MultiTouchInput& aInput,
// NS_TOUCH_START event contains all active touches of the current
// session thus resetting mTouchCount.
mTouchCount = aInput.mTouches.Length();
mHitResultForInputBlock = NoApzcHit;
mHitResultForInputBlock = HitNothing;
nsRefPtr<AsyncPanZoomController> apzc = GetTouchInputBlockAPZC(aInput, &mHitResultForInputBlock);
// XXX the following check assumes mHitResultForInputBlock == ApzcHitRegion
// XXX the following check assumes mHitResultForInputBlock == HitLayer
// (and that mApzcForInputBlock was the confirmed target of the previous
// input block). Eventually it would be better to move this into InputQueue
// and have it auto-generated when we start processing events in a new
@ -769,7 +769,7 @@ APZCTreeManager::ProcessTouchInput(MultiTouchInput& aInput,
nsEventStatus result = nsEventStatus_eIgnore;
if (mApzcForInputBlock) {
MOZ_ASSERT(mHitResultForInputBlock == ApzcHitRegion || mHitResultForInputBlock == ApzcContentRegion);
MOZ_ASSERT(mHitResultForInputBlock == HitLayer || mHitResultForInputBlock == HitDispatchToContentRegion);
mApzcForInputBlock->GetGuid(aOutTargetGuid);
// For computing the input for the APZC, used the cached transform.
@ -782,7 +782,7 @@ APZCTreeManager::ProcessTouchInput(MultiTouchInput& aInput,
transformToApzc, ScreenPoint(touchData.mScreenPoint));
}
result = mInputQueue->ReceiveInputEvent(mApzcForInputBlock,
/* aTargetConfirmed = */ mHitResultForInputBlock == ApzcHitRegion,
/* aTargetConfirmed = */ mHitResultForInputBlock == HitLayer,
aInput, aOutInputBlockId);
// For computing the event to pass back to Gecko, use the up-to-date transforms.
@ -797,7 +797,7 @@ APZCTreeManager::ProcessTouchInput(MultiTouchInput& aInput,
outTransform, touchData.mScreenPoint);
}
}
if (mHitResultForInputBlock == OverscrolledApzc) {
if (mHitResultForInputBlock == HitOverscrolledApzc) {
result = nsEventStatus_eConsumeNoDefault;
}
@ -817,7 +817,7 @@ APZCTreeManager::ProcessTouchInput(MultiTouchInput& aInput,
// don't keep dangling references and leak things.
if (mTouchCount == 0) {
mApzcForInputBlock = nullptr;
mHitResultForInputBlock = NoApzcHit;
mHitResultForInputBlock = HitNothing;
mRetainedTouchIdentifier = -1;
}
@ -848,18 +848,18 @@ APZCTreeManager::ProcessEvent(WidgetInputEvent& aEvent,
// Transform the refPoint.
// If the event hits an overscrolled APZC, instruct the caller to ignore it.
HitTestResult hitResult = NoApzcHit;
HitTestResult hitResult = HitNothing;
nsRefPtr<AsyncPanZoomController> apzc = GetTargetAPZC(ScreenPoint(aEvent.refPoint.x, aEvent.refPoint.y),
&hitResult);
if (apzc) {
MOZ_ASSERT(hitResult == ApzcHitRegion || hitResult == ApzcContentRegion);
MOZ_ASSERT(hitResult == HitLayer || hitResult == HitDispatchToContentRegion);
apzc->GetGuid(aOutTargetGuid);
Matrix4x4 transformToApzc = GetScreenToApzcTransform(apzc);
Matrix4x4 transformToGecko = GetApzcToGeckoTransform(apzc);
Matrix4x4 outTransform = transformToApzc * transformToGecko;
aEvent.refPoint = TransformTo<LayoutDevicePixel>(outTransform, aEvent.refPoint);
}
if (hitResult == OverscrolledApzc) {
if (hitResult == HitOverscrolledApzc) {
result = nsEventStatus_eConsumeNoDefault;
}
return result;
@ -1215,13 +1215,13 @@ already_AddRefed<AsyncPanZoomController>
APZCTreeManager::GetTargetAPZC(const ScreenPoint& aPoint, HitTestResult* aOutHitResult)
{
MonitorAutoLock lock(mTreeLock);
HitTestResult hitResult = NoApzcHit;
HitTestResult hitResult = HitNothing;
ParentLayerPoint point = ViewAs<ParentLayerPixel>(aPoint,
PixelCastJustification::ScreenIsParentLayerForRoot);
nsRefPtr<AsyncPanZoomController> target = GetAPZCAtPoint(mRootNode, point, &hitResult);
// If we are in an overscrolled APZC, we should be returning nullptr.
MOZ_ASSERT(!(target && (hitResult == OverscrolledApzc)));
MOZ_ASSERT(!(target && (hitResult == HitOverscrolledApzc)));
if (aOutHitResult) {
*aOutHitResult = hitResult;
}
@ -1366,25 +1366,25 @@ APZCTreeManager::GetAPZCAtPoint(HitTestingTreeNode* aNode,
ParentLayerPoint childPoint = ViewAs<ParentLayerPixel>(hitTestPointForChildLayers.ref(),
PixelCastJustification::MovingDownToChildren);
result = GetAPZCAtPoint(node->GetLastChild(), childPoint, aOutHitResult);
if (*aOutHitResult == OverscrolledApzc) {
if (*aOutHitResult == HitOverscrolledApzc) {
// We matched an overscrolled APZC, abort.
return nullptr;
}
}
// If we didn't match anything in the subtree, check |node|.
if (!result) {
if (*aOutHitResult == HitNothing) {
APZCTM_LOG("Testing ParentLayer point %s (Layer %s) against node %p\n",
Stringify(aHitTestPoint).c_str(),
hitTestPointForChildLayers ? Stringify(hitTestPointForChildLayers.ref()).c_str() : "nil",
node);
HitTestResult hitResult = node->HitTest(aHitTestPoint);
if (hitResult != HitTestResult::NoApzcHit) {
if (hitResult != HitTestResult::HitNothing) {
result = node->GetNearestContainingApzc();
APZCTM_LOG("Successfully matched APZC %p via node %p (hit result %d)\n",
result, node, hitResult);
MOZ_ASSERT(hitResult == ApzcHitRegion || hitResult == ApzcContentRegion);
// If event regions are disabled, *aOutHitResult will be ApzcHitRegion
MOZ_ASSERT(hitResult == HitLayer || hitResult == HitDispatchToContentRegion);
// If event regions are disabled, *aOutHitResult will be HitLayer
*aOutHitResult = hitResult;
}
}
@ -1392,14 +1392,14 @@ APZCTreeManager::GetAPZCAtPoint(HitTestingTreeNode* aNode,
// If we are overscrolled, and the point matches us or one of our children,
// the result is inside an overscrolled APZC, inform our caller of this
// (callers typically ignore events targeted at overscrolled APZCs).
if (result && apzc && apzc->IsOverscrolled()) {
if (*aOutHitResult != HitNothing && apzc && apzc->IsOverscrolled()) {
APZCTM_LOG("Result is inside overscrolled APZC %p\n", apzc);
*aOutHitResult = OverscrolledApzc;
*aOutHitResult = HitOverscrolledApzc;
return nullptr;
}
if (result) {
if (!gfxPrefs::LayoutEventRegionsEnabled()) {
if (*aOutHitResult != HitNothing) {
if (result && !gfxPrefs::LayoutEventRegionsEnabled()) {
// When event-regions are disabled, we treat scrollinfo layers as
// regular scrollable layers. Unfortunately, their "hit region" (which
// we create from the composition bounds) is their full area, and they

View File

@ -11,10 +11,10 @@ namespace mozilla {
namespace layers {
enum HitTestResult {
NoApzcHit,
ApzcHitRegion,
ApzcContentRegion,
OverscrolledApzc,
HitNothing,
HitLayer,
HitDispatchToContentRegion,
HitOverscrolledApzc,
};
}

View File

@ -195,24 +195,24 @@ HitTestingTreeNode::HitTest(const ParentLayerPoint& aPoint) const
// If there's no APZC, then we do need to check against the mEventRegions
// (which contains the layer's visible region) for obscuration purposes.
if (!gfxPrefs::LayoutEventRegionsEnabled() && GetApzc()) {
return HitTestResult::ApzcHitRegion;
return HitTestResult::HitLayer;
}
// convert into Layer coordinate space
Maybe<LayerPoint> pointInLayerPixels = Untransform(aPoint);
if (!pointInLayerPixels) {
return HitTestResult::NoApzcHit;
return HitTestResult::HitNothing;
}
LayerIntPoint point = RoundedToInt(pointInLayerPixels.ref());
// test against event regions in Layer coordinate space
if (!mEventRegions.mHitRegion.Contains(point.x, point.y)) {
return HitTestResult::NoApzcHit;
return HitTestResult::HitNothing;
}
if (mEventRegions.mDispatchToContentHitRegion.Contains(point.x, point.y)) {
return HitTestResult::ApzcContentRegion;
return HitTestResult::HitDispatchToContentRegion;
}
return HitTestResult::ApzcHitRegion;
return HitTestResult::HitLayer;
}
void

View File

@ -2551,6 +2551,25 @@ protected:
manager->UpdateHitTestingTree(nullptr, root, false, 0, 0);
rootApzc = ApzcOf(root);
}
void CreateBug1119497LayerTree() {
const char* layerTreeSyntax = "c(tt)";
// LayerID 0 12
// 0 is the root and doesn't have an APZC
// 1 is behind 2 and does have an APZC
// 2 entirely covers 1 and should take all the input events
nsIntRegion layerVisibleRegions[] = {
nsIntRegion(nsIntRect(0, 0, 100, 100)),
nsIntRegion(nsIntRect(0, 0, 100, 100)),
nsIntRegion(nsIntRect(0, 0, 100, 100)),
};
root = CreateLayerTree(layerTreeSyntax, layerVisibleRegions, nullptr, lm, layers);
SetScrollableFrameMetrics(layers[1], FrameMetrics::START_SCROLL_ID + 1);
registration = MakeUnique<ScopedLayerTreeRegistration>(0, root, mcc);
manager->UpdateHitTestingTree(nullptr, root, false, 0, 0);
}
};
TEST_F(APZEventRegionsTester, HitRegionImmediateResponse) {
@ -2640,7 +2659,20 @@ TEST_F(APZEventRegionsTester, Obscuration) {
HitTestResult result;
nsRefPtr<AsyncPanZoomController> hit = manager->GetTargetAPZC(ScreenPoint(50, 75), &result);
EXPECT_EQ(child, hit.get());
EXPECT_EQ(HitTestResult::ApzcHitRegion, result);
EXPECT_EQ(HitTestResult::HitLayer, result);
}
TEST_F(APZEventRegionsTester, Bug1119497) {
SCOPED_GFX_PREF(LayoutEventRegionsEnabled, bool, true);
CreateBug1119497LayerTree();
HitTestResult result;
nsRefPtr<AsyncPanZoomController> hit = manager->GetTargetAPZC(ScreenPoint(50, 50), &result);
// We should hit layers[2], so |result| will be HitLayer but there's no
// actual APZC in that parent chain, so |hit| should be nullptr.
EXPECT_EQ(nullptr, hit.get());
EXPECT_EQ(HitTestResult::HitLayer, result);
}
class TaskRunMetrics {

View File

@ -115,6 +115,48 @@ MultiTouchInput::ToWidgetTouchEvent(nsIWidget* aWidget) const
return event;
}
WidgetMouseEvent
MultiTouchInput::ToWidgetMouseEvent(nsIWidget* aWidget) const
{
NS_ABORT_IF_FALSE(NS_IsMainThread(),
"Can only convert To WidgetMouseEvent on main thread");
uint32_t mouseEventType = NS_EVENT_NULL;
switch (mType) {
case MultiTouchInput::MULTITOUCH_START:
mouseEventType = NS_MOUSE_BUTTON_DOWN;
break;
case MultiTouchInput::MULTITOUCH_MOVE:
mouseEventType = NS_MOUSE_MOVE;
break;
case MultiTouchInput::MULTITOUCH_CANCEL:
case MultiTouchInput::MULTITOUCH_END:
mouseEventType = NS_MOUSE_BUTTON_UP;
break;
default:
MOZ_ASSERT_UNREACHABLE("Did not assign a type to WidgetMouseEvent");
break;
}
WidgetMouseEvent event(true, mouseEventType, aWidget,
WidgetMouseEvent::eReal, WidgetMouseEvent::eNormal);
const SingleTouchData& firstTouch = mTouches[0];
event.refPoint.x = firstTouch.mScreenPoint.x;
event.refPoint.y = firstTouch.mScreenPoint.y;
event.time = mTime;
event.button = WidgetMouseEvent::eLeftButton;
event.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_TOUCH;
event.modifiers = modifiers;
if (mouseEventType != NS_MOUSE_MOVE) {
event.clickCount = 1;
}
return event;
}
// This conversion from WidgetMouseEvent to MultiTouchInput is needed because on
// the B2G emulator we can only receive mouse events, but we need to be able
// to pan correctly. To do this, we convert the events into a format that the

View File

@ -216,6 +216,7 @@ public:
explicit MultiTouchInput(const WidgetTouchEvent& aTouchEvent);
WidgetTouchEvent ToWidgetTouchEvent(nsIWidget* aWidget) const;
WidgetMouseEvent ToWidgetMouseEvent(nsIWidget* aWidget) const;
// This conversion from WidgetMouseEvent to MultiTouchInput is needed because
// on the B2G emulator we can only receive mouse events, but we need to be

View File

@ -1289,6 +1289,13 @@ KEY_MAP_GTK (VideoModeNext, GDK_Next_VMode)
KEY_MAP_WIN (ZoomToggle, VK_ZOOM)
KEY_MAP_QT (ZoomToggle, Qt::Key_Zoom)
/******************************************************************************
* Keys not defined by any standards
******************************************************************************/
// HomeScreen
KEY_MAP_ANDROID (HomeScreen, AKEYCODE_HOME)
#undef KEY_MAP_WIN
#undef KEY_MAP_WIN_JPN
#undef KEY_MAP_WIN_KOR

View File

@ -24,7 +24,6 @@
#include "gfxPrefs.h"
#include "libui/Input.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/Mutex.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/TouchEvents.h"
@ -333,21 +332,6 @@ GeckoTouchDispatcher::ResampleTouchMoves(MultiTouchInput& aOutTouch, TimeStamp a
aOutTouch.mTimeStamp = sampleTime;
}
// Some touch events get sent as mouse events. If APZ doesn't capture the event
// and if a touch only has 1 touch input, we can send a mouse event.
void
GeckoTouchDispatcher::DispatchMouseEvent(MultiTouchInput& aMultiTouch,
bool aForwardToChildren)
{
WidgetMouseEvent mouseEvent = ToWidgetMouseEvent(aMultiTouch, nullptr);
if (mouseEvent.message == NS_EVENT_NULL) {
return;
}
mouseEvent.mFlags.mNoCrossProcessBoundaryForwarding = !aForwardToChildren;
nsWindow::DispatchInputEvent(mouseEvent);
}
static bool
IsExpired(const MultiTouchInput& aTouch)
{
@ -372,9 +356,7 @@ GeckoTouchDispatcher::DispatchTouchEvent(MultiTouchInput& aMultiTouch)
return;
}
bool captured = false;
WidgetTouchEvent event = aMultiTouch.ToWidgetTouchEvent(nullptr);
nsEventStatus status = nsWindow::DispatchInputEvent(event, &captured);
nsWindow::DispatchTouchInput(aMultiTouch);
if (mEnabledUniformityInfo && profiler_is_active()) {
const char* touchAction = "Invalid";
@ -395,54 +377,6 @@ GeckoTouchDispatcher::DispatchTouchEvent(MultiTouchInput& aMultiTouch)
TouchDataPayload* payload = new TouchDataPayload(touchPoint);
PROFILER_MARKER_PAYLOAD(touchAction, payload);
}
if (!captured && (aMultiTouch.mTouches.Length() == 1)) {
bool forwardToChildren = status != nsEventStatus_eConsumeNoDefault;
DispatchMouseEvent(aMultiTouch, forwardToChildren);
}
}
WidgetMouseEvent
GeckoTouchDispatcher::ToWidgetMouseEvent(const MultiTouchInput& aMultiTouch,
nsIWidget* aWidget) const
{
NS_ABORT_IF_FALSE(NS_IsMainThread(),
"Can only convert To WidgetMouseEvent on main thread");
uint32_t mouseEventType = NS_EVENT_NULL;
switch (aMultiTouch.mType) {
case MultiTouchInput::MULTITOUCH_START:
mouseEventType = NS_MOUSE_BUTTON_DOWN;
break;
case MultiTouchInput::MULTITOUCH_MOVE:
mouseEventType = NS_MOUSE_MOVE;
break;
case MultiTouchInput::MULTITOUCH_CANCEL:
case MultiTouchInput::MULTITOUCH_END:
mouseEventType = NS_MOUSE_BUTTON_UP;
break;
default:
MOZ_ASSERT_UNREACHABLE("Did not assign a type to WidgetMouseEvent");
break;
}
WidgetMouseEvent event(true, mouseEventType, aWidget,
WidgetMouseEvent::eReal, WidgetMouseEvent::eNormal);
const SingleTouchData& firstTouch = aMultiTouch.mTouches[0];
event.refPoint.x = firstTouch.mScreenPoint.x;
event.refPoint.y = firstTouch.mScreenPoint.y;
event.time = aMultiTouch.mTime;
event.button = WidgetMouseEvent::eLeftButton;
event.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_TOUCH;
event.modifiers = aMultiTouch.modifiers;
if (mouseEventType != NS_MOUSE_MOVE) {
event.clickCount = 1;
}
return event;
}
} // namespace mozilla

View File

@ -60,7 +60,6 @@ private:
void SendTouchEvent(MultiTouchInput& aData);
void DispatchMouseEvent(MultiTouchInput& aMultiTouch,
bool aForwardToChildren);
WidgetMouseEvent ToWidgetMouseEvent(const MultiTouchInput& aData, nsIWidget* aWidget) const;
// mTouchQueueLock are used to protect the vector below
// as it is accessed on the vsync thread and main thread

View File

@ -47,6 +47,9 @@
#include "mozilla/gfx/2D.h"
#include "mozilla/layers/APZCTreeManager.h"
#include "mozilla/layers/CompositorParent.h"
#include "mozilla/layers/InputAPZContext.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/TouchEvents.h"
#include "nsThreadUtils.h"
#include "HwcComposer2D.h"
@ -227,33 +230,89 @@ nsWindow::NotifyVsync(TimeStamp aVsyncTimestamp)
}
}
nsEventStatus
nsWindow::DispatchInputEvent(WidgetGUIEvent& aEvent, bool* aWasCaptured)
/*static*/ nsEventStatus
nsWindow::DispatchInputEvent(WidgetGUIEvent& aEvent)
{
if (aWasCaptured) {
*aWasCaptured = false;
}
if (!gFocusedWindow) {
return nsEventStatus_eIgnore;
}
gFocusedWindow->UserActivity();
nsEventStatus status;
aEvent.widget = gFocusedWindow;
gFocusedWindow->DispatchEvent(&aEvent, status);
return status;
}
/*static*/ void
nsWindow::DispatchTouchInput(MultiTouchInput& aInput)
{
if (!gFocusedWindow) {
return;
}
gFocusedWindow->UserActivity();
gFocusedWindow->DispatchTouchInputViaAPZ(aInput);
}
void
nsWindow::DispatchTouchInputViaAPZ(MultiTouchInput& aInput)
{
if (!mAPZC) {
// In general mAPZC should not be null, but during initial setup
// it might be, so we handle that case by ignoring touch input there.
return;
}
// First send it through the APZ code
mozilla::layers::ScrollableLayerGuid guid;
uint64_t inputBlockId;
nsEventStatus rv = mAPZC->ReceiveInputEvent(aInput, &guid, &inputBlockId);
// If the APZ says to drop it, then we drop it
if (rv == nsEventStatus_eConsumeNoDefault) {
return;
}
// Convert it to an event we can send to Gecko
WidgetTouchEvent event = aInput.ToWidgetTouchEvent(this);
// If there is an event capturing child process, send it directly there.
// This happens if we already sent a touchstart event through the root
// process hit test and it ended up going to a child process. The event
// capturing process should get all subsequent touch events in the same
// event block. In this case the TryCapture call below will return true,
// and the child process will take care of responding to the event as needed
// so we don't need to do anything else here.
if (TabParent* capturer = TabParent::GetEventCapturer()) {
bool captured = capturer->TryCapture(aEvent);
if (aWasCaptured) {
*aWasCaptured = captured;
}
if (captured) {
return nsEventStatus_eConsumeNoDefault;
InputAPZContext context(guid, inputBlockId);
if (capturer->TryCapture(event)) {
return;
}
}
nsEventStatus status;
gFocusedWindow->DispatchEvent(&aEvent, status);
return status;
// If it didn't get captured, dispatch the event into the gecko root process
// for "normal" flow. The event might get sent to the child process still,
// but if it doesn't we need to notify the APZ of various things. All of
// that happens in DispatchEventForAPZ
rv = DispatchEventForAPZ(&event, guid, inputBlockId);
// Finally, if the touch event had only one touch point, generate a mouse
// event for it and send it through the gecko root process.
// Technically we should not need to do this if the touch event was routed
// to the child process, but that seems to expose a bug in B2G where the
// keyboard doesn't go away in some cases.
// Also for now we're dispatching mouse events from all touch events because
// we need this for click events to work in the chrome process. Once we have
// APZ and ChromeProcessController::HandleSingleTap working for the chrome
// process we shouldn't need to do this at all.
if (event.touches.Length() == 1) {
WidgetMouseEvent mouseEvent = aInput.ToWidgetMouseEvent(this);
if (mouseEvent.message != NS_EVENT_NULL) {
mouseEvent.mFlags.mNoCrossProcessBoundaryForwarding = (rv == nsEventStatus_eConsumeNoDefault);
DispatchEvent(&mouseEvent, rv);
}
}
}
NS_IMETHODIMP

View File

@ -16,6 +16,7 @@
#ifndef nsWindow_h
#define nsWindow_h
#include "InputData.h"
#include "nsBaseWidget.h"
#include "nsRegion.h"
#include "nsIIdleServiceInternal.h"
@ -51,8 +52,8 @@ public:
static void NotifyVsync(mozilla::TimeStamp aVsyncTimestamp);
static void DoDraw(void);
static nsEventStatus DispatchInputEvent(mozilla::WidgetGUIEvent& aEvent,
bool* aWasCaptured = nullptr);
static nsEventStatus DispatchInputEvent(mozilla::WidgetGUIEvent& aEvent);
static void DispatchTouchInput(mozilla::MultiTouchInput& aInput);
NS_IMETHOD Create(nsIWidget *aParent,
void *aNativeParent,
@ -87,6 +88,7 @@ public:
return NS_OK;
}
virtual nsIntPoint WidgetToScreenOffset();
void DispatchTouchInputViaAPZ(mozilla::MultiTouchInput& aInput);
NS_IMETHOD DispatchEvent(mozilla::WidgetGUIEvent* aEvent,
nsEventStatus& aStatus);
NS_IMETHOD CaptureRollupEvents(nsIRollupListener *aListener,