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

Side by Side Diff: ui/gfx/transform.cc

Issue 10803037: [WIP] ash/extensions: Add experimental extension support for window-management in ash. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-152100 Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/extensions/permissions/api_permission.cc ('k') | no next file » | 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/gfx/transform.h" 5 #include "ui/gfx/transform.h"
6 #include "ui/gfx/point3.h" 6 #include "ui/gfx/point3.h"
7 #include "ui/gfx/rect.h" 7 #include "ui/gfx/rect.h"
8 #include "ui/gfx/skia_util.h" 8 #include "ui/gfx/skia_util.h"
9 9
10 namespace { 10 namespace {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 void Transform::SetTranslate(float x, float y) { 70 void Transform::SetTranslate(float x, float y) {
71 matrix_.setTranslate(SkFloatToScalar(x), 71 matrix_.setTranslate(SkFloatToScalar(x),
72 SkFloatToScalar(y), 72 SkFloatToScalar(y),
73 matrix_.get(2, 3)); 73 matrix_.get(2, 3));
74 } 74 }
75 75
76 void Transform::SetPerspectiveDepth(float depth) { 76 void Transform::SetPerspectiveDepth(float depth) {
77 SkMatrix44 m; 77 SkMatrix44 m;
78 m.set(3, 2, -1 / depth); 78 m.set(3, 2, -1 / depth);
79 matrix_ = m; 79 matrix_.postConcat(m);
80 } 80 }
81 81
82 void Transform::ConcatRotate(float degree) { 82 void Transform::ConcatRotate(float degree) {
83 SkMatrix44 rot; 83 SkMatrix44 rot;
84 rot.setRotateDegreesAbout(0, 0, 1, SkFloatToScalar(degree)); 84 rot.setRotateDegreesAbout(0, 0, 1, SkFloatToScalar(degree));
85 matrix_.postConcat(rot); 85 matrix_.postConcat(rot);
86 } 86 }
87 87
88 void Transform::ConcatRotateAbout(const gfx::Point3f& axis, float degree) { 88 void Transform::ConcatRotateAbout(const gfx::Point3f& axis, float degree) {
89 SkMatrix44 rot; 89 SkMatrix44 rot;
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 0, 197 0,
198 1 }; 198 1 };
199 199
200 xform.map(p); 200 xform.map(p);
201 201
202 point.SetPoint(SymmetricRound(p[0]), 202 point.SetPoint(SymmetricRound(p[0]),
203 SymmetricRound(p[1])); 203 SymmetricRound(p[1]));
204 } 204 }
205 205
206 } // namespace ui 206 } // namespace ui
OLDNEW
« no previous file with comments | « chrome/common/extensions/permissions/api_permission.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698