Chromium Code Reviews| 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); |
| } |
|
robertphillips
2015/05/05 18:47:56
Why not use the default impl?
reed1
2015/05/05 19:45:15
Default impl in SkCanvas calls through to a device
|
| +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 |