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

Side by Side Diff: ui/aura/root_window.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 | « ash/wm/window_manager_unittest.cc ('k') | ui/base/events/event.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/aura/root_window.h" 5 #include "ui/aura/root_window.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 } 438 }
439 439
440 void RootWindow::ConvertPointFromNativeScreen(gfx::Point* point) const { 440 void RootWindow::ConvertPointFromNativeScreen(gfx::Point* point) const {
441 gfx::Point location = host_->GetLocationOnNativeScreen(); 441 gfx::Point location = host_->GetLocationOnNativeScreen();
442 point->Offset(-location.x(), -location.y()); 442 point->Offset(-location.x(), -location.y());
443 ConvertPointFromHost(point); 443 ConvertPointFromHost(point);
444 } 444 }
445 445
446 void RootWindow::ConvertPointToHost(gfx::Point* point) const { 446 void RootWindow::ConvertPointToHost(gfx::Point* point) const {
447 gfx::Point3F point_3f(*point); 447 gfx::Point3F point_3f(*point);
448 GetRootTransform().TransformPoint(point_3f); 448 GetRootTransform().TransformPoint(&point_3f);
449 *point = gfx::ToFlooredPoint(point_3f.AsPointF()); 449 *point = gfx::ToFlooredPoint(point_3f.AsPointF());
450 } 450 }
451 451
452 void RootWindow::ConvertPointFromHost(gfx::Point* point) const { 452 void RootWindow::ConvertPointFromHost(gfx::Point* point) const {
453 gfx::Point3F point_3f(*point); 453 gfx::Point3F point_3f(*point);
454 GetInverseRootTransform().TransformPoint(point_3f); 454 GetInverseRootTransform().TransformPoint(&point_3f);
455 *point = gfx::ToFlooredPoint(point_3f.AsPointF()); 455 *point = gfx::ToFlooredPoint(point_3f.AsPointF());
456 } 456 }
457 457
458 void RootWindow::ProcessedTouchEvent(ui::TouchEvent* event, 458 void RootWindow::ProcessedTouchEvent(ui::TouchEvent* event,
459 Window* window, 459 Window* window,
460 ui::EventResult result) { 460 ui::EventResult result) {
461 scoped_ptr<ui::GestureRecognizer::Gestures> gestures; 461 scoped_ptr<ui::GestureRecognizer::Gestures> gestures;
462 gestures.reset(gesture_recognizer_->ProcessTouchEventForGesture( 462 gestures.reset(gesture_recognizer_->ProcessTouchEventForGesture(
463 *event, result, window)); 463 *event, result, window));
464 ProcessGestures(gestures.get()); 464 ProcessGestures(gestures.get());
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after
1241 } 1241 }
1242 1242
1243 gfx::Transform RootWindow::GetInverseRootTransform() const { 1243 gfx::Transform RootWindow::GetInverseRootTransform() const {
1244 float scale = ui::GetDeviceScaleFactor(layer()); 1244 float scale = ui::GetDeviceScaleFactor(layer());
1245 gfx::Transform transform; 1245 gfx::Transform transform;
1246 transform.Scale(1.0f / scale, 1.0f / scale); 1246 transform.Scale(1.0f / scale, 1.0f / scale);
1247 return transformer_->GetInverseTransform() * transform; 1247 return transformer_->GetInverseTransform() * transform;
1248 } 1248 }
1249 1249
1250 } // namespace aura 1250 } // namespace aura
OLDNEW
« no previous file with comments | « ash/wm/window_manager_unittest.cc ('k') | ui/base/events/event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698