summaryrefslogtreecommitdiffstats
path: root/views/painter.cc
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-25 16:33:23 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-25 16:33:23 +0000
commit74db48eb22cd8bfe4d028418d99e7aee6c220930 (patch)
tree94b62cc97d669cb965d2073c5d9a72a4a3c3ee04 /views/painter.cc
parent2abd00dd89a5cbc9af4a88a59269fdf9f988cf12 (diff)
downloadchromium_src-74db48eb22cd8bfe4d028418d99e7aee6c220930.zip
chromium_src-74db48eb22cd8bfe4d028418d99e7aee6c220930.tar.gz
chromium_src-74db48eb22cd8bfe4d028418d99e7aee6c220930.tar.bz2
Canvas refactoring part 3.
- Replace Canvas instance users with CanvasSkia users. - Rename Canvas2 to Canvas. - Delete Canvas subclass of CanvasSkia. This has created some ugliness around the fact that people that used SkCanvas methods on Canvas now have to go through AsCanvasSkia first. This is temporary ugliness that will be eradicated as I incrementally build out the new Canvas API. BUG=none TEST=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50854 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/painter.cc')
-rw-r--r--views/painter.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/views/painter.cc b/views/painter.cc
index 1c354da..c368a0a 100644
--- a/views/painter.cc
+++ b/views/painter.cc
@@ -7,6 +7,7 @@
#include "app/resource_bundle.h"
#include "base/logging.h"
#include "gfx/canvas.h"
+#include "gfx/canvas_skia.h"
#include "gfx/insets.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/effects/SkGradientShader.h"
@@ -43,8 +44,9 @@ class GradientPainter : public Painter {
// Need to unref shader, otherwise never deleted.
s->unref();
- canvas->drawRectCoords(SkIntToScalar(0), SkIntToScalar(0),
- SkIntToScalar(w), SkIntToScalar(h), paint);
+ canvas->AsCanvasSkia()->drawRectCoords(
+ SkIntToScalar(0), SkIntToScalar(0), SkIntToScalar(w), SkIntToScalar(h),
+ paint);
}
private:
@@ -146,10 +148,10 @@ void Painter::PaintPainterAt(int x, int y, int w, int h,
DCHECK(canvas && painter);
if (w < 0 || h < 0)
return;
- canvas->save();
+ canvas->AsCanvasSkia()->save();
canvas->TranslateInt(x, y);
painter->Paint(w, h, canvas);
- canvas->restore();
+ canvas->AsCanvasSkia()->restore();
}
// static