Bug 895417 - Fix refpoint coordinates sent to child processes, r=kats
authorMichael Wu <mwu@mozilla.com>
Wed, 24 Jul 2013 21:49:49 -0400
changeset 140104 c6eaf5f8e72161c5c0fdd04539c4fb141c270287
parent 140103 42cf476a66e2846cab9937ef6fadd5afa133c670
child 140105 46d73e889cb47c1497c9a967d055ab5123e05514
push id31595
push userryanvm@gmail.com
push dateFri, 26 Jul 2013 05:29:22 +0000
treeherdermozilla-inbound@52f9e8ffe111 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs895417
milestone25.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
Bug 895417 - Fix refpoint coordinates sent to child processes, r=kats
gfx/layers/ipc/AsyncPanZoomController.cpp
--- a/gfx/layers/ipc/AsyncPanZoomController.cpp
+++ b/gfx/layers/ipc/AsyncPanZoomController.cpp
@@ -267,30 +267,32 @@ AsyncPanZoomController::ReceiveInputEven
 
   switch (aEvent.eventStructType) {
   case NS_TOUCH_EVENT: {
     nsTouchEvent* touchEvent = static_cast<nsTouchEvent*>(aOutEvent);
     const nsTArray< nsRefPtr<dom::Touch> >& touches = touchEvent->touches;
     for (uint32_t i = 0; i < touches.Length(); ++i) {
       nsIDOMTouch* touch = touches[i];
       if (touch) {
-        CSSPoint refPoint = WidgetSpaceToCompensatedViewportSpace(
+        CSSPoint refCSSPoint = WidgetSpaceToCompensatedViewportSpace(
           ScreenPoint::FromUnknownPoint(gfx::Point(
             touch->mRefPoint.x, touch->mRefPoint.y)),
           currentResolution);
+        LayoutDevicePoint refPoint = refCSSPoint * mFrameMetrics.mDevPixelsPerCSSPixel;
         touch->mRefPoint = nsIntPoint(refPoint.x, refPoint.y);
       }
     }
     break;
   }
   default: {
-    CSSPoint refPoint = WidgetSpaceToCompensatedViewportSpace(
+    CSSPoint refCSSPoint = WidgetSpaceToCompensatedViewportSpace(
       ScreenPoint::FromUnknownPoint(gfx::Point(
         aOutEvent->refPoint.x, aOutEvent->refPoint.y)),
       currentResolution);
+    LayoutDevicePoint refPoint = refCSSPoint * mFrameMetrics.mDevPixelsPerCSSPixel;
     aOutEvent->refPoint = nsIntPoint(refPoint.x, refPoint.y);
     break;
   }
   }
 
   return status;
 }