| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| 11 * notice, this list of conditions and the following disclaimer in the | 11 * notice, this list of conditions and the following disclaimer in the |
| 12 * documentation and/or other materials provided with the distribution. | 12 * documentation and/or other materials provided with the distribution. |
| 13 * | 13 * |
| 14 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY | 14 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY |
| 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 17 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY | 17 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY |
| 18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef WebCompositorInputHandlerImpl_h | 26 #ifndef WebCompositorInputHandlerImpl_h |
| 27 #define WebCompositorInputHandlerImpl_h | 27 #define WebCompositorInputHandlerImpl_h |
| 28 | 28 |
| 29 #include "IntPoint.h" | 29 #include "WebActiveWheelFlingParameters.h" |
| 30 #include "WebCompositor.h" | 30 #include "WebCompositor.h" |
| 31 #include "WebCompositorInputHandler.h" | 31 #include "WebCompositorInputHandler.h" |
| 32 #include "WebInputEvent.h" | 32 #include "WebInputEvent.h" |
| 33 #include "cc/CCGestureCurve.h" | 33 #include "cc/CCGestureCurve.h" |
| 34 #include "cc/CCInputHandler.h" | 34 #include "cc/CCInputHandler.h" |
| 35 #include <wtf/HashSet.h> | 35 #include <wtf/HashSet.h> |
| 36 #include <wtf/Noncopyable.h> | 36 #include <wtf/Noncopyable.h> |
| 37 #include <wtf/OwnPtr.h> | 37 #include <wtf/OwnPtr.h> |
| 38 | 38 |
| 39 namespace WTF { | 39 namespace WTF { |
| 40 class Mutex; | 40 class Mutex; |
| 41 } | 41 } |
| 42 | 42 |
| 43 namespace WebCore { | 43 namespace WebCore { |
| 44 class IntPoint; |
| 44 class CCGestureCurveTarget; | 45 class CCGestureCurveTarget; |
| 45 class CCInputHandlerClient; | 46 class CCInputHandlerClient; |
| 46 class CCThread; | 47 class CCThread; |
| 47 } | 48 } |
| 48 | 49 |
| 49 namespace WebKit { | 50 namespace WebKit { |
| 50 | 51 |
| 51 class WebCompositorInputHandlerClient; | 52 class WebCompositorInputHandlerClient; |
| 52 | 53 |
| 53 class WebCompositorInputHandlerImpl : public WebCompositorInputHandler, public W
ebCore::CCInputHandler, public WebCore::CCGestureCurveTarget { | 54 class WebCompositorInputHandlerImpl : public WebCompositorInputHandler, public W
ebCore::CCInputHandler, public WebCore::CCGestureCurveTarget { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 76 // This function processes the input event and determines the disposition, b
ut does not make | 77 // This function processes the input event and determines the disposition, b
ut does not make |
| 77 // any calls out to the WebCompositorInputHandlerClient. Some input types de
fer to helpers. | 78 // any calls out to the WebCompositorInputHandlerClient. Some input types de
fer to helpers. |
| 78 EventDisposition handleInputEventInternal(const WebInputEvent&); | 79 EventDisposition handleInputEventInternal(const WebInputEvent&); |
| 79 | 80 |
| 80 EventDisposition handleGestureFling(const WebGestureEvent&); | 81 EventDisposition handleGestureFling(const WebGestureEvent&); |
| 81 | 82 |
| 82 // Returns true if we actually had an active fling to cancel. | 83 // Returns true if we actually had an active fling to cancel. |
| 83 bool cancelCurrentFling(); | 84 bool cancelCurrentFling(); |
| 84 | 85 |
| 85 OwnPtr<WebCore::CCActiveGestureAnimation> m_wheelFlingAnimation; | 86 OwnPtr<WebCore::CCActiveGestureAnimation> m_wheelFlingAnimation; |
| 86 WebCore::IntPoint m_wheelFlingPoint; // Pointer position for the current fli
ng. | 87 // Parameters for the active fling animation, stored in case we need to tran
sfer it out later. |
| 88 WebActiveWheelFlingParameters m_wheelFlingParameters; |
| 87 | 89 |
| 88 WebCompositorInputHandlerClient* m_client; | 90 WebCompositorInputHandlerClient* m_client; |
| 89 int m_identifier; | 91 int m_identifier; |
| 90 WebCore::CCInputHandlerClient* m_inputHandlerClient; | 92 WebCore::CCInputHandlerClient* m_inputHandlerClient; |
| 91 | 93 |
| 92 #ifndef NDEBUG | 94 #ifndef NDEBUG |
| 93 bool m_expectScrollUpdateEnd; | 95 bool m_expectScrollUpdateEnd; |
| 94 bool m_expectPinchUpdateEnd; | 96 bool m_expectPinchUpdateEnd; |
| 95 #endif | 97 #endif |
| 96 bool m_gestureScrollStarted; | 98 bool m_gestureScrollStarted; |
| 97 | 99 |
| 98 static int s_nextAvailableIdentifier; | 100 static int s_nextAvailableIdentifier; |
| 99 static HashSet<WebCompositorInputHandlerImpl*>* s_compositors; | 101 static HashSet<WebCompositorInputHandlerImpl*>* s_compositors; |
| 100 }; | 102 }; |
| 101 | 103 |
| 102 } | 104 } |
| 103 | 105 |
| 104 #endif // WebCompositorImpl_h | 106 #endif // WebCompositorImpl_h |
| OLD | NEW |