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

Side by Side Diff: ui/events/event.h

Issue 2648583003: Handle floating point coordinates from ozone to exosphere (Closed)
Patch Set: added F variant to screen position client. fixed exo tests. Created 3 years, 11 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_EVENT_H_ 5 #ifndef UI_EVENTS_EVENT_H_
6 #define UI_EVENTS_EVENT_H_ 6 #define UI_EVENTS_EVENT_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 } 361 }
362 362
363 // Transform the locations using |inverted_root_transform|. 363 // Transform the locations using |inverted_root_transform|.
364 // This is applied to both |location_| and |root_location_|. 364 // This is applied to both |location_| and |root_location_|.
365 virtual void UpdateForRootTransform( 365 virtual void UpdateForRootTransform(
366 const gfx::Transform& inverted_root_transform); 366 const gfx::Transform& inverted_root_transform);
367 367
368 template <class T> void ConvertLocationToTarget(T* source, T* target) { 368 template <class T> void ConvertLocationToTarget(T* source, T* target) {
369 if (!target || target == source) 369 if (!target || target == source)
370 return; 370 return;
371 gfx::Point offset = gfx::ToFlooredPoint(location_); 371 T::ConvertPointToTargetF(source, target, &location_);
372 T::ConvertPointToTarget(source, target, &offset);
373 gfx::Vector2d diff = gfx::ToFlooredPoint(location_) - offset;
374 location_= location_ - diff;
375 } 372 }
376 373
377 protected: 374 protected:
378 friend class LocatedEventTestApi; 375 friend class LocatedEventTestApi;
379 376
380 explicit LocatedEvent(const base::NativeEvent& native_event); 377 explicit LocatedEvent(const base::NativeEvent& native_event);
381 378
382 // Create a new LocatedEvent which is identical to the provided model. 379 // Create a new LocatedEvent which is identical to the provided model.
383 // If source / target windows are provided, the model location will be 380 // If source / target windows are provided, the model location will be
384 // converted from |source| coordinate system to |target| coordinate system. 381 // converted from |source| coordinate system to |target| coordinate system.
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
1038 // dispatched. This field gets a non-zero value only for gestures that are 1035 // dispatched. This field gets a non-zero value only for gestures that are
1039 // released through TouchDispositionGestureFilter::SendGesture. The gesture 1036 // released through TouchDispositionGestureFilter::SendGesture. The gesture
1040 // events that aren't fired directly in response to processing a touch-event 1037 // events that aren't fired directly in response to processing a touch-event
1041 // (e.g. timer fired ones), this id is zero. See crbug.com/618738. 1038 // (e.g. timer fired ones), this id is zero. See crbug.com/618738.
1042 uint32_t unique_touch_event_id_; 1039 uint32_t unique_touch_event_id_;
1043 }; 1040 };
1044 1041
1045 } // namespace ui 1042 } // namespace ui
1046 1043
1047 #endif // UI_EVENTS_EVENT_H_ 1044 #endif // UI_EVENTS_EVENT_H_
OLDNEW
« ui/compositor/layer.cc ('K') | « ui/events/cocoa/events_mac.mm ('k') | ui/events/event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698