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

Unified Diff: src/core/SkPictureRecord.cpp

Issue 1122813002: Make drawImage a virtual on SkDevice (patchset #3 id:40001 of https://codereview.chromium.org/11188… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: patch old picture to make serialize work Created 5 years, 8 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/SkPictureRecord.h ('k') | src/gpu/SkGpuDevice.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPictureRecord.cpp
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp
index 53ecdd0be68c08e332c93cc8598d92b32b76b264..c92ee02dbd1066e1a5f51d9b7c0e605b56f24e69 100644
--- a/src/core/SkPictureRecord.cpp
+++ b/src/core/SkPictureRecord.cpp
@@ -7,6 +7,7 @@
#include "SkPictureRecord.h"
#include "SkDevice.h"
+#include "SkImage_Base.h"
#include "SkPatchUtils.h"
#include "SkPixelRef.h"
#include "SkRRect.h"
@@ -563,6 +564,22 @@ void SkPictureRecord::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src
this->validate(initialOffset, size);
}
+void SkPictureRecord::onDrawImage(const SkImage* image, SkScalar x, SkScalar y,
+ const SkPaint* paint) {
+ SkBitmap bm;
+ if (as_IB(image)->getROPixels(&bm)) {
+ this->SkPictureRecord::onDrawBitmap(bm, x, y, paint);
+ }
+}
+
+void SkPictureRecord::onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst,
+ const SkPaint* paint) {
+ SkBitmap bm;
+ if (as_IB(image)->getROPixels(&bm)) {
+ this->SkPictureRecord::onDrawBitmapRect(bm, src, dst, paint, DrawBitmapRectFlags(0));
+ }
+}
+
void SkPictureRecord::onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
const SkRect& dst, const SkPaint* paint) {
// op + paint index + bitmap id + center + dst rect
« no previous file with comments | « src/core/SkPictureRecord.h ('k') | src/gpu/SkGpuDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698