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

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

Issue 55763004: Allow the computation of inflated bounds for non matrix transform operations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 1 month 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/box_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/box_f.h" 5 #include "ui/gfx/box_f.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 depth_ = max_z - min_z; 43 depth_ = max_z - min_z;
44 } 44 }
45 45
46 void BoxF::Union(const BoxF& box) { 46 void BoxF::Union(const BoxF& box) {
47 if (IsEmpty()) { 47 if (IsEmpty()) {
48 *this = box; 48 *this = box;
49 return; 49 return;
50 } 50 }
51 if (box.IsEmpty()) 51 if (box.IsEmpty())
52 return; 52 return;
53 53 ExpandTo(box);
54 ExpandTo(box.origin(), gfx::Point3F(box.right(), box.bottom(), box.front()));
55 } 54 }
56 55
57 void BoxF::ExpandTo(const Point3F& point) { 56 void BoxF::ExpandTo(const Point3F& point) {
58 ExpandTo(point, point); 57 ExpandTo(point, point);
59 } 58 }
60 59
60 void BoxF::ExpandTo(const BoxF& box) {
61 ExpandTo(box.origin(), gfx::Point3F(box.right(), box.bottom(), box.front()));
62 }
63
61 BoxF UnionBoxes(const BoxF& a, const BoxF& b) { 64 BoxF UnionBoxes(const BoxF& a, const BoxF& b) {
62 BoxF result = a; 65 BoxF result = a;
63 result.Union(b); 66 result.Union(b);
64 return result; 67 return result;
65 } 68 }
66 69
67 } // namespace gfx 70 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/box_f.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698