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

Unified Diff: views/painter.cc

Issue 2825018: Canvas refactoring part 3.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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
« gfx/canvas.h ('K') | « views/drag_utils_win.cc ('k') | views/view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/painter.cc
===================================================================
--- views/painter.cc (revision 50661)
+++ views/painter.cc (working copy)
@@ -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 @@
// 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 @@
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
« gfx/canvas.h ('K') | « views/drag_utils_win.cc ('k') | views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698