author | Botond Ballo <botond@mozilla.com> |
Wed, 21 Jan 2015 19:47:05 -0500 | |
changeset 226947 | 0038cfaf847a5625e0b0309e1b3374e2a71fda4c |
parent 226946 | 7ee5dfb97ff602d09c5e72fd605a907684fddd5b |
child 226948 | 5903bcfa581cbcf1a94d9051da81f2aa32c334cf |
push id | 28212 |
push user | philringnalda@gmail.com |
push date | Sun, 01 Feb 2015 17:17:22 +0000 |
treeherder | mozilla-central@2ed663b8bc05 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | kats |
bugs | 1005815 |
milestone | 38.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
gfx/layers/apz/util/ChromeProcessController.cpp | file | annotate | diff | comparison | revisions | |
gfx/layers/apz/util/ChromeProcessController.h | file | annotate | diff | comparison | revisions |
--- a/gfx/layers/apz/util/ChromeProcessController.cpp +++ b/gfx/layers/apz/util/ChromeProcessController.cpp @@ -92,8 +92,36 @@ ChromeProcessController::Destroy() FROM_HERE, NewRunnableMethod(this, &ChromeProcessController::Destroy)); return; } MOZ_ASSERT(MessageLoop::current() == mUILoop); mWidget = nullptr; } + +float +ChromeProcessController::GetPresShellResolution() const +{ + // The document in the chrome process cannot be zoomed, so its pres shell + // resolution is 1. + return 1.0f; +} + +void +ChromeProcessController::HandleSingleTap(const CSSPoint& aPoint, + int32_t aModifiers, + const ScrollableLayerGuid& aGuid) +{ + if (MessageLoop::current() != mUILoop) { + mUILoop->PostTask( + FROM_HERE, + NewRunnableMethod(this, &ChromeProcessController::HandleSingleTap, + aPoint, aModifiers, aGuid)); + return; + } + + LayoutDevicePoint point = + APZCCallbackHelper::ApplyCallbackTransform(aPoint, aGuid, GetPresShellResolution()) + * mWidget->GetDefaultScale(); + + APZCCallbackHelper::FireSingleTapEvent(point, mWidget); +}
--- a/gfx/layers/apz/util/ChromeProcessController.h +++ b/gfx/layers/apz/util/ChromeProcessController.h @@ -33,28 +33,29 @@ public: virtual void RequestContentRepaint(const FrameMetrics& aFrameMetrics) MOZ_OVERRIDE; virtual void PostDelayedTask(Task* aTask, int aDelayMs) MOZ_OVERRIDE; virtual void AcknowledgeScrollUpdate(const FrameMetrics::ViewID& aScrollId, const uint32_t& aScrollGeneration) MOZ_OVERRIDE; virtual void HandleDoubleTap(const mozilla::CSSPoint& aPoint, int32_t aModifiers, const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE {} virtual void HandleSingleTap(const mozilla::CSSPoint& aPoint, int32_t aModifiers, - const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE {} + const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE; virtual void HandleLongTap(const mozilla::CSSPoint& aPoint, int32_t aModifiers, const ScrollableLayerGuid& aGuid, uint64_t aInputBlockId) MOZ_OVERRIDE {} virtual void HandleLongTapUp(const CSSPoint& aPoint, int32_t aModifiers, const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE {} virtual void SendAsyncScrollDOMEvent(bool aIsRoot, const mozilla::CSSRect &aContentRect, const mozilla::CSSSize &aScrollableSize) MOZ_OVERRIDE {} private: nsCOMPtr<nsIWidget> mWidget; MessageLoop* mUILoop; void InitializeRoot(); + float GetPresShellResolution() const; }; } // namespace layers } // namespace mozilla #endif /* mozilla_layers_ChromeProcessController_h */