Index: src/core/SkDevice.cpp |
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp |
index 6be9178f2386d785e5467f0b46d0aa86c343cf8a..37fafd8dfb19f8dd285b610cb7f5442409ee0348 100644 |
--- a/src/core/SkDevice.cpp |
+++ b/src/core/SkDevice.cpp |
@@ -9,6 +9,7 @@ |
#include "SkDeviceProperties.h" |
#include "SkDraw.h" |
#include "SkDrawFilter.h" |
+#include "SkImage_Base.h" |
#include "SkMetaData.h" |
#include "SkPatchUtils.h" |
#include "SkPathMeasure.h" |
@@ -165,6 +166,24 @@ void SkBaseDevice::drawTextBlob(const SkDraw& draw, const SkTextBlob* blob, SkSc |
} |
} |
+void SkBaseDevice::drawImage(const SkDraw& draw, const SkImage* image, SkScalar x, SkScalar y, |
+ const SkPaint& paint) { |
+ // Default impl : turns everything into raster bitmap |
+ SkBitmap bm; |
+ if (as_IB(image)->getROPixels(&bm)) { |
+ this->drawBitmap(draw, bm, SkMatrix::MakeTrans(x, y), paint); |
+ } |
+} |
+ |
+void SkBaseDevice::drawImageRect(const SkDraw& draw, const SkImage* image, const SkRect* src, |
+ const SkRect& dst, const SkPaint& paint) { |
+ // Default impl : turns everything into raster bitmap |
+ SkBitmap bm; |
+ if (as_IB(image)->getROPixels(&bm)) { |
+ this->drawBitmapRect(draw, bm, src, dst, paint, SkCanvas::kNone_DrawBitmapRectFlag); |
+ } |
+} |
+ |
bool SkBaseDevice::readPixels(const SkImageInfo& info, void* dstP, size_t rowBytes, int x, int y) { |
#ifdef SK_DEBUG |
SkASSERT(info.width() > 0 && info.height() > 0); |