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

Unified Diff: include/core/SkCanvas.h

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 | « gm/lattice.cpp ('k') | include/private/SkRecords.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkCanvas.h
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index acf0ad2a54febf4cb6bbdd14a9112e81a3c8573f..d28d0f18982292a0c4294cd032db3590ad4cad50 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -934,21 +934,35 @@ public:
* Specifies coordinates to divide a bitmap into (xCount*yCount) rects.
*/
struct Lattice {
+ enum Flags : uint8_t {
+ // If set, indicates that we should not draw corresponding rect.
+ kTransparent_Flags = 1 << 0,
+ };
+
// An array of x-coordinates that divide the bitmap vertically.
- // These must be unique, increasing, and in the set [0, width].
+ // These must be unique, increasing, and in the set [0, width).
// Does not have ownership.
- const int* fXDivs;
-
- // The number of fXDivs.
- int fXCount;
+ const int* fXDivs;
// An array of y-coordinates that divide the bitmap horizontally.
- // These must be unique, increasing, and in the set [0, height].
+ // These must be unique, increasing, and in the set [0, height).
// Does not have ownership.
- const int* fYDivs;
+ const int* fYDivs;
+
+ // If non-null, the length of this array must be equal to
+ // (fXCount + 1) * (fYCount + 1). Note that we allow the first rect
+ // in each direction to empty (divs[0] = 0). In this case, the
+ // caller still must specify a flag (as a placeholder) for these
+ // empty rects.
+ // The flags correspond to the rects in the lattice, first moving
+ // left to right and then top to bottom.
+ const Flags* fFlags;
+
+ // The number of fXDivs.
+ int fXCount;
// The number of fYDivs.
- int fYCount;
+ int fYCount;
};
/**
« no previous file with comments | « gm/lattice.cpp ('k') | include/private/SkRecords.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698