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

Side by Side Diff: ui/base/events/event.cc

Issue 23724024: Refactor TransformPoint{,Reverse}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and resolve conflicts. Created 7 years, 3 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
« no previous file with comments | « ui/aura/root_window.cc ('k') | ui/compositor/debug_utils.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 (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 #include "ui/base/events/event.h" 5 #include "ui/base/events/event.h"
6 6
7 #if defined(USE_X11) 7 #if defined(USE_X11)
8 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 #endif 9 #endif
10 10
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 int flags) 277 int flags)
278 : Event(type, time_stamp, flags), 278 : Event(type, time_stamp, flags),
279 location_(location), 279 location_(location),
280 root_location_(root_location) { 280 root_location_(root_location) {
281 } 281 }
282 282
283 void LocatedEvent::UpdateForRootTransform( 283 void LocatedEvent::UpdateForRootTransform(
284 const gfx::Transform& reversed_root_transform) { 284 const gfx::Transform& reversed_root_transform) {
285 // Transform has to be done at root level. 285 // Transform has to be done at root level.
286 gfx::Point3F p(location_); 286 gfx::Point3F p(location_);
287 reversed_root_transform.TransformPoint(p); 287 reversed_root_transform.TransformPoint(&p);
288 root_location_ = location_ = gfx::ToFlooredPoint(p.AsPointF()); 288 root_location_ = location_ = gfx::ToFlooredPoint(p.AsPointF());
289 } 289 }
290 290
291 //////////////////////////////////////////////////////////////////////////////// 291 ////////////////////////////////////////////////////////////////////////////////
292 // MouseEvent 292 // MouseEvent
293 293
294 MouseEvent::MouseEvent(const base::NativeEvent& native_event) 294 MouseEvent::MouseEvent(const base::NativeEvent& native_event)
295 : LocatedEvent(native_event), 295 : LocatedEvent(native_event),
296 changed_button_flags_( 296 changed_button_flags_(
297 GetChangedMouseButtonFlagsFromNative(native_event)) { 297 GetChangedMouseButtonFlagsFromNative(native_event)) {
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 int GestureEvent::GetLowestTouchId() const { 772 int GestureEvent::GetLowestTouchId() const {
773 if (touch_ids_bitfield_ == 0) 773 if (touch_ids_bitfield_ == 0)
774 return -1; 774 return -1;
775 int i = -1; 775 int i = -1;
776 // Find the index of the least significant 1 bit 776 // Find the index of the least significant 1 bit
777 while (!(1 << ++i & touch_ids_bitfield_)); 777 while (!(1 << ++i & touch_ids_bitfield_));
778 return i; 778 return i;
779 } 779 }
780 780
781 } // namespace ui 781 } // namespace ui
OLDNEW
« no previous file with comments | « ui/aura/root_window.cc ('k') | ui/compositor/debug_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698