| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CC_INPUT_TOUCH_ACTION_H_ |
| 6 #define CC_INPUT_TOUCH_ACTION_H_ |
| 7 |
| 8 namespace cc { |
| 9 |
| 10 // The current touch action specifies what accelerated browser operations |
| 11 // (panning and zooming) are currently permitted via touch input. |
| 12 // See http://www.w3.org/TR/pointerevents/#the-touch-action-css-property. |
| 13 const size_t kTouchActionBits = 6; |
| 14 enum TouchAction { |
| 15 // No scrolling or zooming allowed. |
| 16 kTouchActionNone = 0x0, |
| 17 kTouchActionPanLeft = 0x1, |
| 18 kTouchActionPanRight = 0x2, |
| 19 kTouchActionPanX = kTouchActionPanLeft | kTouchActionPanRight, |
| 20 kTouchActionPanUp = 0x4, |
| 21 kTouchActionPanDown = 0x8, |
| 22 kTouchActionPanY = kTouchActionPanUp | kTouchActionPanDown, |
| 23 kTouchActionPan = kTouchActionPanX | kTouchActionPanY, |
| 24 kTouchActionPinchZoom = 0x10, |
| 25 kTouchActionManipulation = kTouchActionPan | kTouchActionPinchZoom, |
| 26 kTouchActionDoubleTapZoom = 0x20, |
| 27 kTouchActionAuto = kTouchActionManipulation | kTouchActionDoubleTapZoom, |
| 28 kTouchActionMax = (1 << 6) - 1 |
| 29 }; |
| 30 inline TouchAction operator|(TouchAction a, TouchAction b) { |
| 31 return static_cast<TouchAction>(int(a) | int(b)); |
| 32 } |
| 33 inline TouchAction& operator|=(TouchAction& a, TouchAction b) { |
| 34 return a = a | b; |
| 35 } |
| 36 inline TouchAction operator&(TouchAction a, TouchAction b) { |
| 37 return static_cast<TouchAction>(int(a) & int(b)); |
| 38 } |
| 39 inline TouchAction& operator&=(TouchAction& a, TouchAction b) { |
| 40 return a = a & b; |
| 41 } |
| 42 |
| 43 } // namespace cc |
| 44 |
| 45 #endif // CC_INPUT_TOUCH_ACTION_H_ |
| OLD | NEW |