From f76bacff7f66724072c67edb185abf9e3add11a0 Mon Sep 17 00:00:00 2001 From: "reed@android.com" Date: Wed, 13 May 2009 14:00:33 +0000 Subject: 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 --- src/core/SkCanvas.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/core/SkCanvas.cpp') diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index 199c1b0b97..57b4f7b340 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 @@ -1357,12 +1358,19 @@ void SkCanvas::drawTextOnPathHV(const void* text, size_t byteLength, 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); +} + /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3