Index: src/core/SkDrawable.cpp |
diff --git a/src/core/SkDrawable.cpp b/src/core/SkDrawable.cpp |
index 64fefd2f1c6bba9a771c8882f071b9ad01f2c577..41547ee697612522a4c315734175eff93ce13a45 100644 |
--- a/src/core/SkDrawable.cpp |
+++ b/src/core/SkDrawable.cpp |
@@ -32,8 +32,11 @@ static void draw_bbox(SkCanvas* canvas, const SkRect& r) { |
canvas->drawLine(r.left(), r.bottom(), r.right(), r.top(), paint); |
} |
-void SkDrawable::draw(SkCanvas* canvas) { |
+void SkDrawable::draw(SkCanvas* canvas, const SkMatrix* matrix) { |
SkAutoCanvasRestore acr(canvas, true); |
+ if (matrix) { |
+ canvas->concat(*matrix); |
+ } |
this->onDraw(canvas); |
if (false) { |
@@ -41,6 +44,11 @@ void SkDrawable::draw(SkCanvas* canvas) { |
} |
} |
+void SkDrawable::draw(SkCanvas* canvas, SkScalar x, SkScalar y) { |
+ SkMatrix matrix = SkMatrix::MakeTrans(x, y); |
+ this->draw(canvas, &matrix); |
+} |
+ |
SkPicture* SkDrawable::newPictureSnapshot() { |
return this->onNewPictureSnapshot(); |
} |