Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(485)

Unified Diff: src/image/SkImagePriv.cpp

Issue 19729007: Add SkImage->draw() call with src and dst rects. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/image/SkImagePriv.cpp
diff --git a/src/image/SkImagePriv.cpp b/src/image/SkImagePriv.cpp
index c44e439b72c8b29eb82837b6dae19797d4b9569b..1f9778550584400757fb4050769d5cf36c9ab67a 100644
--- a/src/image/SkImagePriv.cpp
+++ b/src/image/SkImagePriv.cpp
@@ -141,3 +141,15 @@ void SkImagePrivDrawPicture(SkCanvas* canvas, SkPicture* picture,
canvas->drawPicture(*picture);
canvas->restoreToCount(saveCount);
}
+
+void SkImagePrivDrawPicture(SkCanvas* canvas, SkPicture* picture,
Justin Novosad 2013/07/18 21:54:37 You need to write a good test for this function.
+ SkRect src, SkRect dst, const SkPaint* paint) {
+ int saveCount = canvas->getSaveCount();
Justin Novosad 2013/07/18 21:54:37 No need for this call. This value is returned by s
+
+ canvas->clipRect(src);
Justin Novosad 2013/07/18 21:54:37 Bug: This clip does not get undone. Also I think
+ canvas->saveLayer(&dst, paint);
reed1 2013/07/19 14:03:45 Why saveLayer instead of just save?
+ canvas->translate(dst.x(), dst.y());
Justin Novosad 2013/07/18 21:54:37 This is not the right transform to map src to dst.
reed1 2013/07/19 14:03:45 SkMatrix has a mapRectToRect helper function you c
+
+ canvas->drawPicture(*picture);
+ canvas->restoreToCount(saveCount);
+}

Powered by Google App Engine
This is Rietveld 408576698