add SkSize for dimensions
add SkShape baseclass, in the hopes of having SkPicture inherit from that, and
also using shapes as the extension mechanism for things like animated-gif
git-svn-id: http://skia.googlecode.com/svn/trunk@174 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 199c1b0..57b4f7b 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -22,6 +22,7 @@
#include "SkDrawLooper.h"
#include "SkPicture.h"
#include "SkScalarCompare.h"
+#include "SkShape.h"
#include "SkTemplates.h"
#include "SkUtils.h"
#include <new>
@@ -1357,12 +1358,19 @@
this->drawTextOnPath(text, byteLength, path, &matrix, paint);
}
+///////////////////////////////////////////////////////////////////////////////
+
void SkCanvas::drawPicture(SkPicture& picture) {
int saveCount = save();
picture.draw(this);
restoreToCount(saveCount);
}
+void SkCanvas::drawShape(SkShape* shape) {
+ // shape baseclass takes care of save/restore
+ shape->draw(this);
+}
+
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////