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

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: Better detection for zero divs 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
« no previous file with comments | « bench/DrawLatticeBench.cpp ('k') | include/core/SkCanvas.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/lattice.cpp
diff --git a/gm/lattice.cpp b/gm/lattice.cpp
index 63de2a66b407d6d2d2adbf6d549a24d06d1930ea..919fb3588e7dde16ec073b487ec0a5e66abcc8ee 100644
--- a/gm/lattice.cpp
+++ b/gm/lattice.cpp
@@ -113,6 +113,7 @@ protected:
lattice.fXDivs = xDivs + 1;
lattice.fYCount = 4;
lattice.fYDivs = yDivs + 1;
+ lattice.fFlags = nullptr;
for (int iy = 0; iy < 2; ++iy) {
for (int ix = 0; ix < 2; ++ix) {
@@ -130,6 +131,15 @@ protected:
lattice.fYCount = 5;
lattice.fYDivs = yDivs;
+ // Let's skip a few rects.
+ SkCanvas::Lattice::Flags flags[36];
+ sk_bzero(flags, 36 * sizeof(SkCanvas::Lattice::Flags));
+ flags[4] = SkCanvas::Lattice::kTransparent_Flags;
+ flags[9] = SkCanvas::Lattice::kTransparent_Flags;
+ flags[12] = SkCanvas::Lattice::kTransparent_Flags;
+ flags[19] = SkCanvas::Lattice::kTransparent_Flags;
+ lattice.fFlags = flags;
+
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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698