Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Unified Diff: src/core/SkLatticeIter.cpp

Issue 2255963002: Batched implementation of drawLattice() for GPU (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Speculative reland Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkLatticeIter.h ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
+ }
+}
« no previous file with comments | « src/core/SkLatticeIter.h ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698