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

Unified Diff: src/core/SkPicturePlayback.cpp

Issue 1199473002: change old picture serialization to really handle images (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix check in new_array function Created 5 years, 6 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
« no previous file with comments | « src/core/SkPictureFlat.h ('k') | src/core/SkPictureRecord.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPicturePlayback.cpp
diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp
index f4fdc8b83ade5926e2bfa8f9051d5ae4414d6a07..ac71c27d22dab629d09128b8e547676fd489c3eb 100644
--- a/src/core/SkPicturePlayback.cpp
+++ b/src/core/SkPicturePlayback.cpp
@@ -216,6 +216,19 @@ void SkPicturePlayback::handleOp(SkReader32* reader,
case END_COMMENT_GROUP:
// deprecated (M44)
break;
+ case DRAW_IMAGE: {
+ const SkPaint* paint = fPictureData->getPaint(reader);
+ const SkImage* image = fPictureData->getImage(reader);
+ const SkPoint& loc = reader->skipT<SkPoint>();
+ canvas->drawImage(image, loc.fX, loc.fY, paint);
+ } break;
+ case DRAW_IMAGE_RECT: {
+ const SkPaint* paint = fPictureData->getPaint(reader);
+ const SkImage* image = fPictureData->getImage(reader);
+ const SkRect* src = get_rect_ptr(reader); // may be null
+ const SkRect& dst = reader->skipT<SkRect>(); // required
+ canvas->drawImageRect(image, src, dst, paint);
+ } break;
case DRAW_OVAL: {
const SkPaint& paint = *fPictureData->getPaint(reader);
canvas->drawOval(reader->skipT<SkRect>(), paint);
« no previous file with comments | « src/core/SkPictureFlat.h ('k') | src/core/SkPictureRecord.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698