summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-27 12:29:21 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-27 12:29:21 +0000
commit80277112be3fb17ae6ad8e2aa41951a1e5d9098c (patch)
tree264e06468a0bd2080834ee8a3fabd673fc6fb298 /ui
parent8333b9b18f9b8758fd77319d184b182dd9d41f34 (diff)
downloadchromium_src-80277112be3fb17ae6ad8e2aa41951a1e5d9098c.zip
chromium_src-80277112be3fb17ae6ad8e2aa41951a1e5d9098c.tar.gz
chromium_src-80277112be3fb17ae6ad8e2aa41951a1e5d9098c.tar.bz2
ui/gfx: Change Canvas::ScaleInt() to just Canvas::Scale().
BUG=100898 R=pkasting@chromium.org Review URL: http://codereview.chromium.org/8363036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107559 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/gfx/canvas.h3
-rw-r--r--ui/gfx/canvas_direct2d.cc6
-rw-r--r--ui/gfx/canvas_direct2d.h2
-rw-r--r--ui/gfx/canvas_direct2d_unittest.cc2
-rw-r--r--ui/gfx/canvas_skia.cc4
-rw-r--r--ui/gfx/canvas_skia.h2
6 files changed, 9 insertions, 10 deletions
diff --git a/ui/gfx/canvas.h b/ui/gfx/canvas.h
index 189aeb4..2887b30 100644
--- a/ui/gfx/canvas.h
+++ b/ui/gfx/canvas.h
@@ -103,8 +103,7 @@ class UI_EXPORT Canvas {
virtual void Translate(const gfx::Point& point) = 0;
- // Wrapper function that takes integer arguments.
- virtual void ScaleInt(int x, int y) = 0;
+ virtual void Scale(int x_scale, int y_scale) = 0;
// Fills the specified region with the specified color using a transfer
// mode of SkXfermode::kSrcOver_Mode.
diff --git a/ui/gfx/canvas_direct2d.cc b/ui/gfx/canvas_direct2d.cc
index a1b3a9f..08005f4 100644
--- a/ui/gfx/canvas_direct2d.cc
+++ b/ui/gfx/canvas_direct2d.cc
@@ -192,13 +192,13 @@ void CanvasDirect2D::Translate(const gfx::Point& point) {
rt_->SetTransform(transform);
}
-void CanvasDirect2D::ScaleInt(int x, int y) {
+void CanvasDirect2D::Scale(int x_scale, int y_scale) {
D2D1_MATRIX_3X2_F raw;
rt_->GetTransform(&raw);
D2D1::Matrix3x2F transform(raw._11, raw._12, raw._21, raw._22, raw._31,
raw._32);
- transform = D2D1::Matrix3x2F::Scale(static_cast<float>(x),
- static_cast<float>(y)) * transform;
+ transform = D2D1::Matrix3x2F::Scale(static_cast<float>(x_scale),
+ static_cast<float>(y_scale)) * transform;
rt_->SetTransform(transform);
}
diff --git a/ui/gfx/canvas_direct2d.h b/ui/gfx/canvas_direct2d.h
index 75c424c..dc3cc8d 100644
--- a/ui/gfx/canvas_direct2d.h
+++ b/ui/gfx/canvas_direct2d.h
@@ -33,7 +33,7 @@ class UI_EXPORT CanvasDirect2D : public Canvas {
virtual void Restore() OVERRIDE;
virtual bool ClipRect(const gfx::Rect& rect) OVERRIDE;
virtual void Translate(const gfx::Point& point) OVERRIDE;
- virtual void ScaleInt(int x, int y) OVERRIDE;
+ virtual void Scale(int x_scale, int y_scale) OVERRIDE;
virtual void FillRectInt(const SkColor& color,
int x, int y, int w, int h) OVERRIDE;
virtual void FillRectInt(const SkColor& color,
diff --git a/ui/gfx/canvas_direct2d_unittest.cc b/ui/gfx/canvas_direct2d_unittest.cc
index db57990..8a6dcec 100644
--- a/ui/gfx/canvas_direct2d_unittest.cc
+++ b/ui/gfx/canvas_direct2d_unittest.cc
@@ -262,7 +262,7 @@ TEST(CanvasDirect2D, ClipRectWithScale) {
// origin.
canvas.Save();
canvas.Translate(gfx::Point(150, 150));
- canvas.ScaleInt(2, 2);
+ canvas.Scale(2, 2);
canvas.ClipRect(gfx::Rect(10, 10, 110, 110));
canvas.FillRectInt(SK_ColorRED, 0, 0, 500, 500);
canvas.Restore();
diff --git a/ui/gfx/canvas_skia.cc b/ui/gfx/canvas_skia.cc
index 6550073..2f822e5 100644
--- a/ui/gfx/canvas_skia.cc
+++ b/ui/gfx/canvas_skia.cc
@@ -118,8 +118,8 @@ void CanvasSkia::Translate(const gfx::Point& point) {
canvas_->translate(SkIntToScalar(point.x()), SkIntToScalar(point.y()));
}
-void CanvasSkia::ScaleInt(int x, int y) {
- canvas_->scale(SkIntToScalar(x), SkIntToScalar(y));
+void CanvasSkia::Scale(int x_scale, int y_scale) {
+ canvas_->scale(SkIntToScalar(x_scale), SkIntToScalar(y_scale));
}
void CanvasSkia::FillRectInt(const SkColor& color, int x, int y, int w, int h) {
diff --git a/ui/gfx/canvas_skia.h b/ui/gfx/canvas_skia.h
index 5bf2318..045192f 100644
--- a/ui/gfx/canvas_skia.h
+++ b/ui/gfx/canvas_skia.h
@@ -102,7 +102,7 @@ class UI_EXPORT CanvasSkia : public Canvas {
virtual void Restore() OVERRIDE;
virtual bool ClipRect(const gfx::Rect& rect) OVERRIDE;
virtual void Translate(const gfx::Point& point) OVERRIDE;
- virtual void ScaleInt(int x, int y) OVERRIDE;
+ virtual void Scale(int x_scale, int y_scale) OVERRIDE;
virtual void FillRectInt(const SkColor& color,
int x, int y, int w, int h) OVERRIDE;
virtual void FillRectInt(const SkColor& color,