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

Side by Side Diff: ui/events/gesture_detection/bitset_32.h

Issue 502993004: Remove abstract Clone and Cancel methods from MotionEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nasty bug fix Created 6 years, 1 month 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
« no previous file with comments | « ui/events/events.gyp ('k') | ui/events/gesture_detection/gesture_event_data_packet_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_EVENTS_GESTURE_DETECTION_BITSET_32_H_ 5 #ifndef UI_EVENTS_GESTURE_DETECTION_BITSET_32_H_
6 #define UI_EVENTS_GESTURE_DETECTION_BITSET_32_H_ 6 #define UI_EVENTS_GESTURE_DETECTION_BITSET_32_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 80 }
81 81
82 // Finds the last marked bit in the set and clears it. Returns the bit index. 82 // Finds the last marked bit in the set and clears it. Returns the bit index.
83 // Result is undefined if all bits are unmarked. 83 // Result is undefined if all bits are unmarked.
84 inline uint32_t clear_last_marked_bit() { 84 inline uint32_t clear_last_marked_bit() {
85 uint32_t n = last_marked_bit(); 85 uint32_t n = last_marked_bit();
86 clear_bit(n); 86 clear_bit(n);
87 return n; 87 return n;
88 } 88 }
89 89
90 // Gets the inde of the specified bit in the set, which is the number of 90 // Gets the index of the specified bit in the set, which is the number of
91 // marked bits that appear before the specified bit. 91 // marked bits that appear before the specified bit.
92 inline uint32_t get_index_of_bit(uint32_t n) const { 92 inline uint32_t get_index_of_bit(uint32_t n) const {
93 DCHECK_LE(n, 31U); 93 DCHECK_LE(n, 31U);
94 return popcnt(value & ~(0xffffffffUL >> n)); 94 return popcnt(value & ~(0xffffffffUL >> n));
95 } 95 }
96 96
97 inline bool operator==(const BitSet32& other) const { 97 inline bool operator==(const BitSet32& other) const {
98 return value == other.value; 98 return value == other.value;
99 } 99 }
100 inline bool operator!=(const BitSet32& other) const { 100 inline bool operator!=(const BitSet32& other) const {
(...skipping 23 matching lines...) Expand all
124 } 124 }
125 static inline uint32_t ctz(uint32_t v) { 125 static inline uint32_t ctz(uint32_t v) {
126 return popcnt((v & static_cast<uint32_t>(-static_cast<int>(v))) - 1); 126 return popcnt((v & static_cast<uint32_t>(-static_cast<int>(v))) - 1);
127 } 127 }
128 #endif 128 #endif
129 }; 129 };
130 130
131 } // namespace ui 131 } // namespace ui
132 132
133 #endif // UI_EVENTS_GESTURE_DETECTION_BITSET_32_H_ 133 #endif // UI_EVENTS_GESTURE_DETECTION_BITSET_32_H_
OLDNEW
« no previous file with comments | « ui/events/events.gyp ('k') | ui/events/gesture_detection/gesture_event_data_packet_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698