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

Side by Side Diff: mojo/skia/type_converters.cc

Issue 1781993002: Mozart: Compute hits using 4x4 matrix. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-10
Patch Set: 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/skia/type_converters.h ('k') | services/gfx/compositor/BUILD.gn » ('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 #include "mojo/skia/type_converters.h" 5 #include "mojo/skia/type_converters.h"
6 6
7 namespace mojo { 7 namespace mojo {
8 8
9 SkIPoint TypeConverter<SkIPoint, mojo::Point>::Convert( 9 SkIPoint TypeConverter<SkIPoint, mojo::Point>::Convert(
10 const mojo::Point& input) { 10 const mojo::Point& input) {
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 output->matrix[9] = 0.f; 119 output->matrix[9] = 0.f;
120 output->matrix[10] = 1.f; 120 output->matrix[10] = 1.f;
121 output->matrix[11] = 0.f; 121 output->matrix[11] = 0.f;
122 output->matrix[12] = input[6]; 122 output->matrix[12] = input[6];
123 output->matrix[13] = input[7]; 123 output->matrix[13] = input[7];
124 output->matrix[14] = 0.f; 124 output->matrix[14] = 0.f;
125 output->matrix[15] = input[8]; 125 output->matrix[15] = input[8];
126 return output.Pass(); 126 return output.Pass();
127 } 127 }
128 128
129 SkMatrix44 TypeConverter<SkMatrix44, mojo::TransformPtr>::Convert(
130 const mojo::TransformPtr& input) {
131 if (!input)
132 return SkMatrix44::I();
133
134 SkMatrix44 output(SkMatrix44::kUninitialized_Constructor);
135 output.setRowMajorf(input->matrix.data());
136 return output;
137 }
138
139 mojo::TransformPtr TypeConverter<mojo::TransformPtr, SkMatrix44>::Convert(
140 const SkMatrix44& input) {
141 auto output = mojo::Transform::New();
142 output->matrix.resize(16u);
143 input.asRowMajorf(output->matrix.data());
144 return output.Pass();
145 }
146
129 } // namespace mojo 147 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/skia/type_converters.h ('k') | services/gfx/compositor/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698