Index: src/image/SkImage_Raster.cpp |
diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp |
index 20ae62c9f75ff191db6620e3b3cdf212f9c6129b..acf805829d5d97579d97eb35e27976635fd711d4 100644 |
--- a/src/image/SkImage_Raster.cpp |
+++ b/src/image/SkImage_Raster.cpp |
@@ -53,6 +53,8 @@ |
SkImage_Raster(const SkImageInfo&, SkData*, size_t rb, const SkSurfaceProps*); |
virtual ~SkImage_Raster(); |
+ void onDraw(SkCanvas*, SkScalar, SkScalar, const SkPaint*) const override; |
+ void onDrawRect(SkCanvas*, const SkRect*, const SkRect&, const SkPaint*) const override; |
SkSurface* onNewSurface(const SkImageInfo&, const SkSurfaceProps&) const override; |
bool onReadPixels(const SkImageInfo&, void*, size_t, int srcX, int srcY) const override; |
const void* onPeekPixels(SkImageInfo*, size_t* /*rowBytes*/) const override; |
@@ -118,6 +120,17 @@ |
return SkShader::CreateBitmapShader(fBitmap, tileX, tileY, localMatrix); |
} |
+void SkImage_Raster::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPaint* paint) const { |
+ SkBitmap shallowCopy(fBitmap); |
+ canvas->drawBitmap(shallowCopy, x, y, paint); |
+} |
+ |
+void SkImage_Raster::onDrawRect(SkCanvas* canvas, const SkRect* src, const SkRect& dst, |
+ const SkPaint* paint) const { |
+ SkBitmap shallowCopy(fBitmap); |
+ canvas->drawBitmapRectToRect(shallowCopy, src, dst, paint); |
+} |
+ |
SkSurface* SkImage_Raster::onNewSurface(const SkImageInfo& info, const SkSurfaceProps& props) const { |
return SkSurface::NewRaster(info, &props); |
} |