///////////////////////////////////////////////////////////////////////////////
-void Image::drawPattern(GraphicsContext* ctxt, const FloatRect& tileRect,
+void Image::drawPattern(GraphicsContext* ctxt, const FloatRect& srcRect,
const TransformationMatrix& patternTransform,
const FloatPoint& phase, CompositeOperator compositeOp,
const FloatRect& destRect)
}
// in case we get called with an incomplete bitmap
- const SkBitmap& bitmap = image->bitmap();
- if (bitmap.getPixels() == NULL && bitmap.pixelRef() == NULL) {
+ const SkBitmap& origBitmap = image->bitmap();
+ if (origBitmap.getPixels() == NULL && origBitmap.pixelRef() == NULL) {
return;
}
if (dstR.isEmpty()) {
return;
}
-
+
+ // now extract the proper subset of the src image
+ SkBitmap bitmap;
+ SkIRect srcR;
+ if (!origBitmap.extractSubset(&bitmap, *android_setrect(&srcR, srcRect))) {
+ SkDebugf("--- Image::drawPattern calling extractSubset failed\n");
+ return;
+ }
+
SkCanvas* canvas = ctxt->platformContext()->mCanvas;
SkPaint paint;