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

Unified Diff: gfx/canvas_skia.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
Index: gfx/canvas_skia.cc
===================================================================
--- gfx/canvas_skia.cc (revision 50664)
+++ gfx/canvas_skia.cc (working copy)
@@ -2,13 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "gfx/canvas.h"
+#include "gfx/canvas_skia.h"
#include <limits>
#include "base/i18n/rtl.h"
#include "base/logging.h"
-#include "gfx/canvas.h"
#include "gfx/font.h"
#include "gfx/rect.h"
#include "third_party/skia/include/core/SkShader.h"
@@ -274,6 +273,14 @@
return result;
}
+CanvasSkia* CanvasSkia::AsCanvasSkia() {
+ return this;
+}
+
+const CanvasSkia* CanvasSkia::AsCanvasSkia() const {
+ return this;
+}
+
// static
int CanvasSkia::DefaultCanvasTextAlignment() {
if (!base::i18n::IsRTL())
@@ -282,19 +289,19 @@
}
////////////////////////////////////////////////////////////////////////////////
-// Canvas2, public:
+// Canvas, public:
-Canvas2* Canvas2::CreateCanvas() {
- return new Canvas;
+Canvas* Canvas::CreateCanvas() {
+ return new CanvasSkia;
}
-Canvas2* Canvas2::CreateCanvas(int width, int height, bool is_opaque) {
- return new Canvas(width, height, is_opaque);
+Canvas* Canvas::CreateCanvas(int width, int height, bool is_opaque) {
+ return new CanvasSkia(width, height, is_opaque);
}
#if defined(OS_WIN)
// TODO(beng): move to canvas_win.cc, etc.
-class CanvasPaintWin : public CanvasSkiaPaint, public CanvasPaint2 {
+class CanvasPaintWin : public CanvasSkiaPaint, public CanvasPaint {
public:
CanvasPaintWin(gfx::NativeView view) : CanvasSkiaPaint(view) {}
@@ -307,13 +314,13 @@
return gfx::Rect(paintStruct().rcPaint);
}
- virtual Canvas2* AsCanvas2() {
+ virtual Canvas* AsCanvas() {
return this;
}
};
#endif
-CanvasPaint2* CanvasPaint2::CreateCanvasPaint(gfx::NativeView view) {
+CanvasPaint* CanvasPaint::CreateCanvasPaint(gfx::NativeView view) {
#if defined(OS_WIN)
return new CanvasPaintWin(view);
#else
« gfx/canvas.h ('K') | « gfx/canvas_skia.h ('k') | gfx/canvas_skia_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698