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

Unified Diff: ui/android/java/src/org/chromium/ui/base/TouchDevice.java

Issue 2604353002: Revert TouchDevice.hasAnySource optimization. (Closed)
Patch Set: Created 3 years, 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/android/java/src/org/chromium/ui/base/TouchDevice.java
diff --git a/ui/android/java/src/org/chromium/ui/base/TouchDevice.java b/ui/android/java/src/org/chromium/ui/base/TouchDevice.java
index 21b28c66d491461082c6fe0c69ef1aa51d2479d8..86d6a1358d82430501aaf8e4fdb57acb1e14dfec 100644
--- a/ui/android/java/src/org/chromium/ui/base/TouchDevice.java
+++ b/ui/android/java/src/org/chromium/ui/base/TouchDevice.java
@@ -65,18 +65,21 @@ public class TouchDevice {
int sources = inputDevice.getSources();
- if (hasAnySource(sources, InputDevice.SOURCE_MOUSE | InputDevice.SOURCE_STYLUS
- | InputDevice.SOURCE_TOUCHPAD | InputDevice.SOURCE_TRACKBALL)) {
+ if (hasSource(sources, InputDevice.SOURCE_MOUSE)
+ || hasSource(sources, InputDevice.SOURCE_STYLUS)
+ || hasSource(sources, InputDevice.SOURCE_TOUCHPAD)
+ || hasSource(sources, InputDevice.SOURCE_TRACKBALL)) {
result[0] |= PointerType.FINE;
} else if (hasSource(sources, InputDevice.SOURCE_TOUCHSCREEN)) {
result[0] |= PointerType.COARSE;
}
- if (hasAnySource(sources, InputDevice.SOURCE_MOUSE | InputDevice.SOURCE_TOUCHPAD
- | InputDevice.SOURCE_TRACKBALL)) {
+ if (hasSource(sources, InputDevice.SOURCE_MOUSE)
+ || hasSource(sources, InputDevice.SOURCE_TOUCHPAD)
+ || hasSource(sources, InputDevice.SOURCE_TRACKBALL)) {
result[1] |= HoverType.HOVER;
- } else if (hasAnySource(sources,
- InputDevice.SOURCE_STYLUS | InputDevice.SOURCE_TOUCHSCREEN)) {
+ } else if (hasSource(sources, InputDevice.SOURCE_STYLUS)
+ || hasSource(sources, InputDevice.SOURCE_TOUCHSCREEN)) {
result[1] |= HoverType.ON_DEMAND;
}
@@ -90,10 +93,6 @@ public class TouchDevice {
return result;
}
- private static boolean hasAnySource(int sources, int inputDeviceSources) {
- return (sources & inputDeviceSources) != 0;
- }
-
private static boolean hasSource(int sources, int inputDeviceSource) {
return (sources & inputDeviceSource) == inputDeviceSource;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698