ui: Remove implicit flooring in skia rect conversion methods.
The current SkRectToRect method implicitly floors all components of thre rect
and this is bad. Replace this method with SkRectToRectF which keeps everything
as floating point.
We also add a conversion method from RectF to SkRect.
Tests:
ui_unittests:RectTest.SkiaRectConversions
R=sky
BUG=147395
Moved From: https://codereview.chromium.org/11275089/
Review URL: https://chromiumcodereview.appspot.com/11359172
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167620 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ui/gfx/transform.h b/ui/gfx/transform.h
index 4385c1c..233df68 100644
--- a/ui/gfx/transform.h
+++ b/ui/gfx/transform.h
@@ -10,7 +10,7 @@
namespace gfx {
-class Rect;
+class RectF;
class Point;
class Point3F;
@@ -102,13 +102,13 @@
// 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.
- void TransformRect(Rect* rect) const;
+ 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.
- bool TransformRectReverse(Rect* rect) const;
+ bool TransformRectReverse(RectF* rect) const;
// Returns the underlying matrix.
const SkMatrix44& matrix() const { return matrix_; }