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

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

Issue 12250019: Removed gfx::QuadF::operator =(const gfx::QuadF&) and let the compiler generate one (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | « ui/gfx/quad_f.h ('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/quad_f.h" 5 #include "ui/gfx/quad_f.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
11 11
12 namespace gfx { 12 namespace gfx {
13 13
14 void QuadF::operator=(const QuadF& quad) {
15 p1_ = quad.p1_;
16 p2_ = quad.p2_;
17 p3_ = quad.p3_;
18 p4_ = quad.p4_;
19 }
20
21 void QuadF::operator=(const RectF& rect) { 14 void QuadF::operator=(const RectF& rect) {
22 p1_ = PointF(rect.x(), rect.y()); 15 p1_ = PointF(rect.x(), rect.y());
23 p2_ = PointF(rect.right(), rect.y()); 16 p2_ = PointF(rect.right(), rect.y());
24 p3_ = PointF(rect.right(), rect.bottom()); 17 p3_ = PointF(rect.right(), rect.bottom());
25 p4_ = PointF(rect.x(), rect.bottom()); 18 p4_ = PointF(rect.x(), rect.bottom());
26 } 19 }
27 20
28 std::string QuadF::ToString() const { 21 std::string QuadF::ToString() const {
29 return base::StringPrintf("%s;%s;%s;%s", 22 return base::StringPrintf("%s;%s;%s;%s",
30 p1_.ToString().c_str(), 23 p1_.ToString().c_str(),
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 return result; 127 return result;
135 } 128 }
136 129
137 QuadF operator-(const QuadF& lhs, const Vector2dF& rhs) { 130 QuadF operator-(const QuadF& lhs, const Vector2dF& rhs) {
138 QuadF result = lhs; 131 QuadF result = lhs;
139 result -= rhs; 132 result -= rhs;
140 return result; 133 return result;
141 } 134 }
142 135
143 } // namespace gfx 136 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/quad_f.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698