Index: src/core/SkCanvas.cpp |
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp |
index 33d1deee60783807bd8db88a54a2267a47226f0a..d78222d1c9e6e9e14977a2c3b0bc70d0cb86f11c 100644 |
--- a/src/core/SkCanvas.cpp |
+++ b/src/core/SkCanvas.cpp |
@@ -2010,8 +2010,16 @@ void SkCanvas::drawImageLattice(const SkImage* image, const Lattice& lattice, co |
if (dst.isEmpty()) { |
return; |
} |
- if (SkLatticeIter::Valid(image->width(), image->height(), lattice)) { |
- this->onDrawImageLattice(image, lattice, dst, paint); |
+ |
+ SkIRect bounds; |
+ Lattice latticePlusBounds = lattice; |
+ if (!latticePlusBounds.fBounds) { |
+ bounds = SkIRect::MakeWH(image->width(), image->height()); |
+ latticePlusBounds.fBounds = &bounds; |
+ } |
+ |
+ if (SkLatticeIter::Valid(image->width(), image->height(), latticePlusBounds)) { |
+ this->onDrawImageLattice(image, latticePlusBounds, dst, paint); |
} else { |
this->drawImageRect(image, dst, paint); |
} |
@@ -2060,8 +2068,16 @@ void SkCanvas::drawBitmapLattice(const SkBitmap& bitmap, const Lattice& lattice, |
if (bitmap.drawsNothing() || dst.isEmpty()) { |
return; |
} |
- if (SkLatticeIter::Valid(bitmap.width(), bitmap.height(), lattice)) { |
- this->onDrawBitmapLattice(bitmap, lattice, dst, paint); |
+ |
+ SkIRect bounds; |
+ Lattice latticePlusBounds = lattice; |
+ if (!latticePlusBounds.fBounds) { |
+ bounds = SkIRect::MakeWH(bitmap.width(), bitmap.height()); |
+ latticePlusBounds.fBounds = &bounds; |
+ } |
+ |
+ if (SkLatticeIter::Valid(bitmap.width(), bitmap.height(), latticePlusBounds)) { |
+ this->onDrawBitmapLattice(bitmap, latticePlusBounds, dst, paint); |
} else { |
this->drawBitmapRect(bitmap, dst, paint); |
} |