| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #include "SkNinePatch.h" | 10 #include "SkNinePatch.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 *indices++ = n + 1; | 36 *indices++ = n + 1; |
| 37 | 37 |
| 38 *indices++ = n; | 38 *indices++ = n; |
| 39 *indices++ = n + xCount + 1; | 39 *indices++ = n + xCount + 1; |
| 40 *indices++ = n + xCount + 2; | 40 *indices++ = n + xCount + 2; |
| 41 | 41 |
| 42 n += 1; | 42 n += 1; |
| 43 } | 43 } |
| 44 n += 1; | 44 n += 1; |
| 45 } | 45 } |
| 46 return indices - startIndices; | 46 return static_cast<int>(indices - startIndices); |
| 47 } | 47 } |
| 48 | 48 |
| 49 // Computes the delta between vertices along a single axis | 49 // Computes the delta between vertices along a single axis |
| 50 static SkScalar computeVertexDelta(bool isStretchyVertex, | 50 static SkScalar computeVertexDelta(bool isStretchyVertex, |
| 51 SkScalar currentVertex, | 51 SkScalar currentVertex, |
| 52 SkScalar prevVertex, | 52 SkScalar prevVertex, |
| 53 SkScalar stretchFactor) { | 53 SkScalar stretchFactor) { |
| 54 // the standard delta between vertices if no stretching is required | 54 // the standard delta between vertices if no stretching is required |
| 55 SkScalar delta = currentVertex - prevVertex; | 55 SkScalar delta = currentVertex - prevVertex; |
| 56 | 56 |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 (margins.fTop + margins.fBottom); | 326 (margins.fTop + margins.fBottom); |
| 327 yDivs[1] = yDivs[0]; | 327 yDivs[1] = yDivs[0]; |
| 328 } | 328 } |
| 329 | 329 |
| 330 SkNinePatch::DrawMesh(canvas, bounds, bitmap, | 330 SkNinePatch::DrawMesh(canvas, bounds, bitmap, |
| 331 xDivs, 2, yDivs, 2, paint); | 331 xDivs, 2, yDivs, 2, paint); |
| 332 } else { | 332 } else { |
| 333 drawNineViaRects(canvas, bounds, bitmap, margins, paint); | 333 drawNineViaRects(canvas, bounds, bitmap, margins, paint); |
| 334 } | 334 } |
| 335 } | 335 } |
| OLD | NEW |