aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image/SkSurface_Base.h
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-30 18:06:00 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-30 18:06:00 +0000
commitc9062047cea66575868270b4dcaeb1dab113c8a7 (patch)
treee7cee8e3828f23924a77d2a8a70f8ccb71ab82d0 /src/image/SkSurface_Base.h
parentb0fe4c59e8a7921983b587236e31b61448986d4a (diff)
expand private subclasses into separate files
git-svn-id: http://skia.googlecode.com/svn/trunk@4835 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/image/SkSurface_Base.h')
-rw-r--r--src/image/SkSurface_Base.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/image/SkSurface_Base.h b/src/image/SkSurface_Base.h
new file mode 100644
index 0000000000..bb6de961b0
--- /dev/null
+++ b/src/image/SkSurface_Base.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2012 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkSurface_Base_DEFINED
+#define SkSurface_Base_DEFINED
+
+#include "SkSurface.h"
+
+class SkSurface_Base : public SkSurface {
+public:
+ SkSurface_Base(int width, int height) : INHERITED(width, height) {}
+
+ virtual SkCanvas* onNewCanvas() = 0;
+ virtual SkSurface* onNewSurface(const SkImage::Info&, SkColorSpace*) = 0;
+ virtual SkImage* onNewImageShapshot() = 0;
+
+ /**
+ * Default implementation:
+ *
+ * image = this->newImageSnapshot();
+ * if (image) {
+ * image->draw(canvas, ...);
+ * image->unref();
+ * }
+ */
+ virtual void onDraw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*);
+
+private:
+ typedef SkSurface INHERITED;
+};
+
+#endif
+