summaryrefslogtreecommitdiffstats
path: root/ui/views/painter.cc
diff options
context:
space:
mode:
authorkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-24 01:10:27 +0000
committerkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-24 01:10:27 +0000
commita9d2b8ff6ad9886baf661f428e662af7e992a0f8 (patch)
treed664a957bbb84bef117b46a036e743c30b455034 /ui/views/painter.cc
parent4751845cc2bc65a217a64d80cd515f0dd492f2de (diff)
downloadchromium_src-a9d2b8ff6ad9886baf661f428e662af7e992a0f8.zip
chromium_src-a9d2b8ff6ad9886baf661f428e662af7e992a0f8.tar.gz
chromium_src-a9d2b8ff6ad9886baf661f428e662af7e992a0f8.tar.bz2
Revert 195908 "Stretch ImagePainter edge images instead of tiling."
Probably causing content_browsertest failures: http://build.chromium.org/p/chromium.win/builders/Win%20Aura%20Tests%20%281%29/builds/3398 > Stretch ImagePainter edge images instead of tiling. > > BUG=218968,161374 > TEST=Infobar buttons look correct (no broken gradient); no button appearance regressions. > R=sky@chromium.org > > Review URL: https://chromiumcodereview.appspot.com/13986008 TBR=msw@chromium.org Review URL: https://codereview.chromium.org/13825011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195969 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/painter.cc')
-rw-r--r--ui/views/painter.cc17
1 files changed, 7 insertions, 10 deletions
diff --git a/ui/views/painter.cc b/ui/views/painter.cc
index 62026ac..e461185 100644
--- a/ui/views/painter.cc
+++ b/ui/views/painter.cc
@@ -73,11 +73,6 @@ class GradientPainter : public Painter {
DISALLOW_COPY_AND_ASSIGN(GradientPainter);
};
-// A helper fuction to stretch the given image over the specified canvas area.
-void Fill(gfx::Canvas* c, const gfx::ImageSkia& i, int x, int y, int w, int h) {
- c->DrawImageInt(i, 0, 0, i.width(), i.height(), x, y, w, h, false);
-}
-
// ImagePainter stores and paints nine images as a scalable grid.
class VIEWS_EXPORT ImagePainter : public Painter {
public:
@@ -152,13 +147,15 @@ void ImagePainter::Paint(gfx::Canvas* canvas, const gfx::Size& size) {
rect.bottom() - images_[6].height(), rect.bottom() };
canvas->DrawImageInt(images_[0], x[0], y[0]);
- Fill(canvas, images_[1], x[1], y[0], x[2] - x[1], y[1] - y[0]);
+ canvas->TileImageInt(images_[1], x[1], y[0], x[2] - x[1], y[1] - y[0]);
canvas->DrawImageInt(images_[2], x[2], y[0]);
- Fill(canvas, images_[3], x[0], y[1], x[1] - x[0], y[2] - y[1]);
- Fill(canvas, images_[4], x[1], y[1], x[2] - x[1], y[2] - y[1]);
- Fill(canvas, images_[5], x[2], y[1], x[3] - x[2], y[2] - y[1]);
+ canvas->TileImageInt(images_[3], x[0], y[1], x[1] - x[0], y[2] - y[1]);
+ canvas->DrawImageInt(
+ images_[4], 0, 0, images_[4].width(), images_[4].height(),
+ x[1], y[1], x[2] - x[1], y[2] - y[1], false);
+ canvas->TileImageInt(images_[5], x[2], y[1], x[3] - x[2], y[2] - y[1]);
canvas->DrawImageInt(images_[6], 0, y[2]);
- Fill(canvas, images_[7], x[1], y[2], x[2] - x[1], y[3] - y[2]);
+ canvas->TileImageInt(images_[7], x[1], y[2], x[2] - x[1], y[3] - y[2]);
canvas->DrawImageInt(images_[8], x[2], y[2]);
}