summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorvollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-05 02:35:20 +0000
committervollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-05 02:35:20 +0000
commit4590cc0472b366be6023528f4925f7120beaa3d9 (patch)
tree9c97f621fd7bccc04a611d15ce242b8b8e098a47 /ui
parent61a035ae029d96f1fef27dbbdf2b7f91b414f0ea (diff)
downloadchromium_src-4590cc0472b366be6023528f4925f7120beaa3d9.zip
chromium_src-4590cc0472b366be6023528f4925f7120beaa3d9.tar.gz
chromium_src-4590cc0472b366be6023528f4925f7120beaa3d9.tar.bz2
Allow the computation of inflated bounds for non matrix transform operations.
This CL expands the list of transform operations for which we may compute inflated bounds for animation. R=hartmanng@chromium.org,ajuma@chromium.org BUG= Review URL: https://codereview.chromium.org/55763004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232889 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/gfx/box_f.cc7
-rw-r--r--ui/gfx/box_f.h5
2 files changed, 10 insertions, 2 deletions
diff --git a/ui/gfx/box_f.cc b/ui/gfx/box_f.cc
index b4191f3..62e755b 100644
--- a/ui/gfx/box_f.cc
+++ b/ui/gfx/box_f.cc
@@ -50,14 +50,17 @@ void BoxF::Union(const BoxF& box) {
}
if (box.IsEmpty())
return;
-
- ExpandTo(box.origin(), gfx::Point3F(box.right(), box.bottom(), box.front()));
+ ExpandTo(box);
}
void BoxF::ExpandTo(const Point3F& point) {
ExpandTo(point, point);
}
+void BoxF::ExpandTo(const BoxF& box) {
+ ExpandTo(box.origin(), gfx::Point3F(box.right(), box.bottom(), box.front()));
+}
+
BoxF UnionBoxes(const BoxF& a, const BoxF& b) {
BoxF result = a;
result.Union(b);
diff --git a/ui/gfx/box_f.h b/ui/gfx/box_f.h
index 11770ee..73e0972 100644
--- a/ui/gfx/box_f.h
+++ b/ui/gfx/box_f.h
@@ -99,6 +99,11 @@ class GFX_EXPORT BoxF {
// |origin_|.
void ExpandTo(const Point3F& point);
+ // Expands |this| to contain the given box, if necessary. Please note, even
+ // if |this| is empty, after the function |this| will continue to contain its
+ // |origin_|.
+ void ExpandTo(const BoxF& box);
+
private:
// Expands the box to contain the two given points. It is required that each
// component of |min| is less than or equal to the corresponding component in