[Webkit-unassigned] [Bug 54417] [chromium] Add a basic gesture recognizer to the Chromium platform

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri May 27 07:15:46 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=54417





--- Comment #18 from Benjamin Poulain <benjamin at webkit.org>  2011-05-27 07:15:46 PST ---
(From update of attachment 94995)
View in context: https://bugs.webkit.org/attachment.cgi?id=94995&action=review

> Source/WebCore/platform/chromium/GestureRecognizerChromium.cpp:55
> +    : m_firstTouchTime(0.0)
> +    , m_state(GestureRecognizerChromium::NoGesture)
> +    , m_lastTouchTime(0.0)
> +    , m_eventHandler(0)

To avoid duplicating this kind of code, you could not initialize anything and just call resetState().
I don't mind the current code, just do as you prefer for this.

> Source/WebCore/platform/chromium/GestureRecognizerChromium.cpp:93
> +    PlatformMouseEvent fakeMouseMove(point.pos(), point.screenPos(), NoButton, MouseEventMoved, /* clickCount */ 1, /* shift */ false, /* ctrl */ false, /* alt */ false, /* meta */ false, m_lastTouchTime);
> +    PlatformMouseEvent fakeMouseDown(point.pos(), point.screenPos(), LeftButton, MouseEventPressed, /* clickCount */ 1, /* shift */ false, /* ctrl */ false, /* alt */ false, /* meta */ false, m_lastTouchTime);
> +    // TODO: add a fake motion here.
> +    PlatformMouseEvent fakeMouseUp(point.pos(), point.screenPos(), LeftButton, MouseEventReleased, /* clickCount */ 1, /* shift */ false, /* ctrl */ false, /* alt */ false, /* meta */ false, m_lastTouchTime);

You actually don't have to use false for all the modifiers. The PlatformTouchEvent has the value of shift, ctrl, alt, etc.

> Source/WebCore/platform/chromium/GestureRecognizerChromium.cpp:152
> +        m_lastTouchTime = touchTime;

You could set this above the if() since it is updated in both cases... just to make things simpler :)

> Source/WebCore/platform/chromium/GestureRecognizerChromium.cpp:163
> +    return 1 + ((touchType & 0x7) | (handled ? 1 << 3 : 0) | ((id & 0xfff) << 4 ) | (gestureState << 16));

The +1 is suspicious as discussed on IRC :)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list