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

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: 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
« 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..e1a1026c52ee7bf21863cf968f0f53e63c1f7a59 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -934,21 +934,37 @@ 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.
+ kSkip_Flags = 1 << 0,
+ };
+
// An array of x-coordinates that divide the bitmap vertically.
// These must be unique, increasing, and in the set [0, width].
// Does not have ownership.
- const int* fXDivs;
+ const int* fXDivs;
// The number of fXDivs.
- int fXCount;
+ int fXCount;
// An array of y-coordinates that divide the bitmap horizontally.
// These must be unique, increasing, and in the set [0, height].
// Does not have ownership.
- const int* fYDivs;
+ const int* fYDivs;
// The number of fYDivs.
- int fYCount;
+ int fYCount;
+
+ // If non-null, the length of this array must be equal to the total
+ // number of rects specified in the lattice. 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 fFlags. Must be equal to the total number of rects
+ // specified in the lattice, or flags will be ignored. If fFlags is
+ // null, this should be set to zero.
+ int fFlagCount;
reed1 2016/09/01 14:15:23 Lets try not having this, and just documenting tha
msarett 2016/09/01 16:27:24 SGTM
};
/**
« 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