Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 SkCanvas_DEFINED | 8 #ifndef SkCanvas_DEFINED |
| 9 #define SkCanvas_DEFINED | 9 #define SkCanvas_DEFINED |
| 10 | 10 |
| (...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 957 /** | 957 /** |
| 958 * Specifies coordinates to divide a bitmap into (xCount*yCount) rects. | 958 * Specifies coordinates to divide a bitmap into (xCount*yCount) rects. |
| 959 */ | 959 */ |
| 960 struct Lattice { | 960 struct Lattice { |
| 961 enum Flags : uint8_t { | 961 enum Flags : uint8_t { |
| 962 // If set, indicates that we should not draw corresponding rect. | 962 // If set, indicates that we should not draw corresponding rect. |
| 963 kTransparent_Flags = 1 << 0, | 963 kTransparent_Flags = 1 << 0, |
| 964 }; | 964 }; |
| 965 | 965 |
| 966 // An array of x-coordinates that divide the bitmap vertically. | 966 // An array of x-coordinates that divide the bitmap vertically. |
| 967 // These must be unique, increasing, and in the set [0, width). | 967 // These must be unique, increasing, and in the set [fBounds.fLeft, fBou nds.fRight). |
| 968 // Does not have ownership. | 968 // Does not have ownership. |
| 969 const int* fXDivs; | 969 const int* fXDivs; |
| 970 | 970 |
| 971 // An array of y-coordinates that divide the bitmap horizontally. | 971 // An array of y-coordinates that divide the bitmap horizontally. |
| 972 // These must be unique, increasing, and in the set [0, height). | 972 // These must be unique, increasing, and in the set [fBounds.fTop, fBoun ds.fBottom). |
| 973 // Does not have ownership. | 973 // Does not have ownership. |
| 974 const int* fYDivs; | 974 const int* fYDivs; |
| 975 | 975 |
| 976 // If non-null, the length of this array must be equal to | 976 // If non-null, the length of this array must be equal to |
| 977 // (fXCount + 1) * (fYCount + 1). Note that we allow the first rect | 977 // (fXCount + 1) * (fYCount + 1). Note that we allow the first rect |
| 978 // in each direction to empty (divs[0] = 0). In this case, the | 978 // in each direction to be empty (ex: fXDivs[0] = fBounds.fLeft). |
| 979 // caller still must specify a flag (as a placeholder) for these | 979 // In this case, the caller still must specify a flag (as a placeholder) |
| 980 // empty rects. | 980 // for these empty rects. |
| 981 // The flags correspond to the rects in the lattice, first moving | 981 // The flags correspond to the rects in the lattice, first moving |
| 982 // left to right and then top to bottom. | 982 // left to right and then top to bottom. |
| 983 const Flags* fFlags; | 983 const Flags* fFlags; |
| 984 | 984 |
| 985 // The number of fXDivs. | 985 // The number of fXDivs. |
| 986 int fXCount; | 986 int fXCount; |
| 987 | 987 |
| 988 // The number of fYDivs. | 988 // The number of fYDivs. |
| 989 int fYCount; | 989 int fYCount; |
| 990 | |
| 991 // The bound to draw from. Will ofetn be equal to the bounds of the | |
| 992 // input SkImage. | |
|
reed1
2016/09/29 21:11:38
1. could take a ptr to a rect, and null means the
| |
| 993 SkIRect fBounds; | |
| 990 }; | 994 }; |
| 991 | 995 |
| 992 /** | 996 /** |
| 993 * Draw the bitmap stretched or shrunk differentially to fit into dst. | 997 * Draw the bitmap stretched or shrunk differentially to fit into dst. |
| 994 * | 998 * |
| 995 * Moving horizontally across the bitmap, alternating rects will be "scalab le" | 999 * Moving horizontally across the bitmap, alternating rects will be "scalab le" |
| 996 * (in the x-dimension) to fit into dst or must be left "fixed". The first rect | 1000 * (in the x-dimension) to fit into dst or must be left "fixed". The first rect |
| 997 * is treated as "fixed", but it's possible to specify an empty first rect by | 1001 * is treated as "fixed", but it's possible to specify an empty first rect by |
| 998 * making lattice.fXDivs[0] = 0. | 1002 * making lattice.fXDivs[0] = 0. |
| 999 * | 1003 * |
| (...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1755 | 1759 |
| 1756 class SkCanvasClipVisitor { | 1760 class SkCanvasClipVisitor { |
| 1757 public: | 1761 public: |
| 1758 virtual ~SkCanvasClipVisitor(); | 1762 virtual ~SkCanvasClipVisitor(); |
| 1759 virtual void clipRect(const SkRect&, SkCanvas::ClipOp, bool antialias) = 0; | 1763 virtual void clipRect(const SkRect&, SkCanvas::ClipOp, bool antialias) = 0; |
| 1760 virtual void clipRRect(const SkRRect&, SkCanvas::ClipOp, bool antialias) = 0 ; | 1764 virtual void clipRRect(const SkRRect&, SkCanvas::ClipOp, bool antialias) = 0 ; |
| 1761 virtual void clipPath(const SkPath&, SkCanvas::ClipOp, bool antialias) = 0; | 1765 virtual void clipPath(const SkPath&, SkCanvas::ClipOp, bool antialias) = 0; |
| 1762 }; | 1766 }; |
| 1763 | 1767 |
| 1764 #endif | 1768 #endif |
| OLD | NEW |