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

Unified Diff: gm/lattice.cpp

Issue 2305433002: Add option to skip rects to drawImageLattice() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: numRectsToDraw() Created 4 years, 3 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
Index: gm/lattice.cpp
diff --git a/gm/lattice.cpp b/gm/lattice.cpp
index 63de2a66b407d6d2d2adbf6d549a24d06d1930ea..b3616fc66e9861503729b14fabc671dfb0a11691 100644
--- a/gm/lattice.cpp
+++ b/gm/lattice.cpp
@@ -113,6 +113,8 @@ protected:
lattice.fXDivs = xDivs + 1;
lattice.fYCount = 4;
lattice.fYDivs = yDivs + 1;
+ lattice.fFlags = nullptr;
+ lattice.fFlagCount = 0;
for (int iy = 0; iy < 2; ++iy) {
for (int ix = 0; ix < 2; ++ix) {
@@ -130,6 +132,15 @@ protected:
lattice.fYCount = 5;
lattice.fYDivs = yDivs;
+ // Let's skip a few rects.
+ SkCanvas::Lattice::Flags flags[25];
+ sk_bzero(flags, 25 * sizeof(SkCanvas::Lattice::Flags));
+ flags[4] = SkCanvas::Lattice::kSkip_Flags;
+ flags[9] = SkCanvas::Lattice::kSkip_Flags;
+ flags[12] = SkCanvas::Lattice::kSkip_Flags;
+ lattice.fFlags = flags;
+ lattice.fFlagCount = 25;
+
canvas->translate(400, 0);
for (int iy = 0; iy < 2; ++iy) {
for (int ix = 0; ix < 2; ++ix) {
« no previous file with comments | « bench/DrawLatticeBench.cpp ('k') | include/core/SkCanvas.h » ('j') | include/core/SkCanvas.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698