diff options
author | 2009-05-13 14:00:33 +0000 | |
---|---|---|
committer | 2009-05-13 14:00:33 +0000 | |
commit | f76bacff7f66724072c67edb185abf9e3add11a0 (patch) | |
tree | 122df275ab6ffea666b3bb8ebbefaeba1cbe64ef /src/core/SkCanvas.cpp | |
parent | 25e9834c03a050afbf339f457b8c401aecb26c0b (diff) |
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
Diffstat (limited to 'src/core/SkCanvas.cpp')
-rw-r--r-- | src/core/SkCanvas.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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 <new> @@ -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); +} + /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// |