Index: src/core/SkLatticeIter.cpp |
diff --git a/src/core/SkLatticeIter.cpp b/src/core/SkLatticeIter.cpp |
index 24ab3f1cbc29a11af6ded16de3965c93ac76b292..ba6ac97a5b4395807a22c482b05e95ccc985eb0c 100644 |
--- a/src/core/SkLatticeIter.cpp |
+++ b/src/core/SkLatticeIter.cpp |
@@ -159,6 +159,7 @@ SkLatticeIter::SkLatticeIter(int srcWidth, int srcHeight, const SkCanvas::Lattic |
fCurrX = fCurrY = 0; |
fDone = false; |
+ fNumRects = (xCount + 1) * (yCount + 1); |
} |
bool SkLatticeIter::Valid(int width, int height, const SkIRect& center) { |
@@ -205,6 +206,7 @@ SkLatticeIter::SkLatticeIter(int w, int h, const SkIRect& c, const SkRect& dst) |
fCurrX = fCurrY = 0; |
fDone = false; |
+ fNumRects = 9; |
} |
bool SkLatticeIter::next(SkRect* src, SkRect* dst) { |
@@ -228,3 +230,18 @@ bool SkLatticeIter::next(SkRect* src, SkRect* dst) { |
} |
return true; |
} |
+ |
+void SkLatticeIter::mapDstScaleTranslate(const SkMatrix& matrix) { |
+ SkASSERT(matrix.isScaleTranslate()); |
+ SkScalar tx = matrix.getTranslateX(); |
+ SkScalar sx = matrix.getScaleX(); |
+ for (int i = 0; i < fDstX.count(); i++) { |
+ fDstX[i] = fDstX[i] * sx + tx; |
+ } |
+ |
+ SkScalar ty = matrix.getTranslateY(); |
+ SkScalar sy = matrix.getScaleY(); |
+ for (int i = 0; i < fDstY.count(); i++) { |
+ fDstY[i] = fDstY[i] * sy + ty; |
+ } |
+} |