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

Side by Side Diff: mojo/ui/associates/test_helpers.h

Issue 1782733002: Mozart: The great RectF-ication. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-9
Patch Set: rebase Created 4 years, 9 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 | « mojo/ui/associates/mock_hit_tester.cc ('k') | mojo/ui/associates/view_tree_hit_tester_client.h » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 MOJO_UI_ASSOCIATES_TEST_HELPERS_H_ 5 #ifndef MOJO_UI_ASSOCIATES_TEST_HELPERS_H_
6 #define MOJO_UI_ASSOCIATES_TEST_HELPERS_H_ 6 #define MOJO_UI_ASSOCIATES_TEST_HELPERS_H_
7 7
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "mojo/services/ui/views/interfaces/view_associates.mojom.h" 11 #include "mojo/services/ui/views/interfaces/view_associates.mojom.h"
12 12
13 namespace test { 13 namespace test {
14 14
15 template <typename T> 15 template <typename T>
16 void Capture(const base::Closure& quit, T* out, T value) { 16 void Capture(const base::Closure& quit, T* out, T value) {
17 *out = std::move(value); 17 *out = std::move(value);
18 quit.Run(); 18 quit.Run();
19 } 19 }
20 20
21 inline mojo::PointPtr MakePoint(int32_t x, int32_t y) { 21 inline mojo::PointFPtr MakePointF(float x, float y) {
22 auto result = mojo::Point::New(); 22 auto result = mojo::PointF::New();
23 result->x = x; 23 result->x = x;
24 result->y = y; 24 result->y = y;
25 return result.Pass(); 25 return result.Pass();
26 } 26 }
27 27
28 inline mojo::TransformPtr MakeDummyTransform(float x) { 28 inline mojo::TransformPtr MakeDummyTransform(float x) {
29 auto result = mojo::Transform::New(); 29 auto result = mojo::Transform::New();
30 result->matrix.resize(16u); 30 result->matrix.resize(16u);
31 result->matrix[0] = x; 31 result->matrix[0] = x;
32 return result.Pass(); 32 return result.Pass();
(...skipping 25 matching lines...) Expand all
58 } 58 }
59 59
60 inline mojo::gfx::composition::HitTestResultPtr MakeSimpleHitTestResult( 60 inline mojo::gfx::composition::HitTestResultPtr MakeSimpleHitTestResult(
61 mojo::gfx::composition::SceneTokenPtr scene_token) { 61 mojo::gfx::composition::SceneTokenPtr scene_token) {
62 return MakeSimpleHitTestResult(scene_token.Pass(), MakeDummyTransform(0.f)); 62 return MakeSimpleHitTestResult(scene_token.Pass(), MakeDummyTransform(0.f));
63 } 63 }
64 64
65 } // namespace test 65 } // namespace test
66 66
67 #endif // MOJO_UI_ASSOCIATES_TEST_HELPERS_H_ 67 #endif // MOJO_UI_ASSOCIATES_TEST_HELPERS_H_
OLDNEW
« no previous file with comments | « mojo/ui/associates/mock_hit_tester.cc ('k') | mojo/ui/associates/view_tree_hit_tester_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698