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

Unified Diff: ui/gfx/transform.h

Issue 26116004: Add gfx::Transform::TransformBox and TransformBoxReverse (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/gfx/transform.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/transform.h
diff --git a/ui/gfx/transform.h b/ui/gfx/transform.h
index 9f4db734419d0420eafafbb9a7b6cb4ecbceb7d1..60c3d5c3fa3acc0444d422c689c29538b487506c 100644
--- a/ui/gfx/transform.h
+++ b/ui/gfx/transform.h
@@ -14,6 +14,7 @@
namespace gfx {
+class BoxF;
class RectF;
class Point;
class Point3F;
@@ -194,17 +195,28 @@ class GFX_EXPORT Transform {
// transformation can be inverted. Rounds the result to the nearest point.
bool TransformPointReverse(Point* point) const;
- // Applies transformation on the rectangle. Returns true if the transformed
- // rectangle was axis aligned. If it returns false, rect will be the
- // smallest axis aligned bounding box containing the transformed rect.
+ // Applies transformation on the given rect. After the function completes,
+ // |rect| will be the smallest axis aligned bounding rect containing the
+ // transformed rect.
void TransformRect(RectF* rect) const;
- // Applies the reverse transformation on the rectangle. Returns true if
- // the transformed rectangle was axis aligned. If it returns false,
- // rect will be the smallest axis aligned bounding box containing the
- // transformed rect.
+ // Applies the reverse transformation on the given rect. After the function
+ // completes, |rect| will be the smallest axis aligned bounding rect
+ // containing the transformed rect. Returns false if the matrix cannot be
+ // inverted.
bool TransformRectReverse(RectF* rect) const;
+ // Applies transformation on the given box. After the function completes,
+ // |box| will be the smallest axis aligned bounding box containing the
+ // transformed box.
+ void TransformBox(BoxF* box) const;
+
+ // Applies the reverse transformation on the given box. After the function
+ // completes, |box| will be the smallest axis aligned bounding box
+ // containing the transformed box. Returns false if the matrix cannot be
+ // inverted.
+ bool TransformBoxReverse(BoxF* box) const;
+
// Decomposes |this| and |from|, interpolates the decomposed values, and
// sets |this| to the reconstituted result. Returns false if either matrix
// can't be decomposed. Uses routines described in this spec:
« no previous file with comments | « no previous file | ui/gfx/transform.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698