Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Side by Side Diff: cc/input/touch_action.h

Issue 2863693003: Unify TouchAction classes (Closed)
Patch Set: more tests Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
wkorman 2017/05/08 19:03:01 Could enhance comments here to add: - this is int
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;
danakj 2017/05/09 14:29:46 whitespace before enum defn
14 enum TouchAction {
jbroman 2017/05/09 14:40:26 nit: You might consider enum class, so that you ge
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) {
danakj 2017/05/09 14:29:46 whitespace before/after functions
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698