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

Side by Side Diff: src/core/SkLatticeIter.h

Issue 2382893002: Add a src rect to drawImageLattice() API (Closed)
Patch Set: Simplify impl Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « src/core/SkDevice.cpp ('k') | src/core/SkLatticeIter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkLatticeIter_DEFINED 8 #ifndef SkLatticeIter_DEFINED
9 #define SkLatticeIter_DEFINED 9 #define SkLatticeIter_DEFINED
10 10
11 #include "SkCanvas.h" 11 #include "SkCanvas.h"
12 #include "SkScalar.h" 12 #include "SkScalar.h"
13 #include "SkTArray.h" 13 #include "SkTArray.h"
14 14
15 struct SkIRect; 15 struct SkIRect;
16 struct SkRect; 16 struct SkRect;
17 17
18 /** 18 /**
19 * Disect a lattice request into an sequence of src-rect / dst-rect pairs 19 * Disect a lattice request into an sequence of src-rect / dst-rect pairs
20 */ 20 */
21 class SkLatticeIter { 21 class SkLatticeIter {
22 public: 22 public:
23 23
24 static bool Valid(int imageWidth, int imageHeight, const SkCanvas::Lattice& lattice); 24 static bool Valid(int imageWidth, int imageHeight, const SkCanvas::Lattice& lattice);
25 25
26 SkLatticeIter(int imageWidth, int imageHeight, const SkCanvas::Lattice& latt ice, 26 SkLatticeIter(const SkCanvas::Lattice& lattice, const SkRect& dst);
27 const SkRect& dst);
28 27
29 static bool Valid(int imageWidth, int imageHeight, const SkIRect& center); 28 static bool Valid(int imageWidth, int imageHeight, const SkIRect& center);
30 29
31 SkLatticeIter(int imageWidth, int imageHeight, const SkIRect& center, const SkRect& dst); 30 SkLatticeIter(int imageWidth, int imageHeight, const SkIRect& center, const SkRect& dst);
32 31
33 /** 32 /**
34 * While it returns true, use src/dst to draw the image/bitmap 33 * While it returns true, use src/dst to draw the image/bitmap
35 */ 34 */
36 bool next(SkRect* src, SkRect* dst); 35 bool next(SkRect* src, SkRect* dst);
37 36
(...skipping 16 matching lines...) Expand all
54 SkTArray<SkScalar> fDstY; 53 SkTArray<SkScalar> fDstY;
55 SkTArray<SkCanvas::Lattice::Flags> fFlags; 54 SkTArray<SkCanvas::Lattice::Flags> fFlags;
56 55
57 int fCurrX; 56 int fCurrX;
58 int fCurrY; 57 int fCurrY;
59 int fNumRectsInLattice; 58 int fNumRectsInLattice;
60 int fNumRectsToDraw; 59 int fNumRectsToDraw;
61 }; 60 };
62 61
63 #endif 62 #endif
OLDNEW
« no previous file with comments | « src/core/SkDevice.cpp ('k') | src/core/SkLatticeIter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698