OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 #include "SkScaleToSides.h" | 8 #include "SkScaleToSides.h" |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 30 matching lines...) Expand all Loading... |
41 for (int k = 0; k < numInterestingValues; k++) { | 41 for (int k = 0; k < numInterestingValues; k++) { |
42 float radius1 = (float)interestingValues[i]; | 42 float radius1 = (float)interestingValues[i]; |
43 float radius2 = (float)interestingValues[j]; | 43 float radius2 = (float)interestingValues[j]; |
44 double width = interestingValues[k]; | 44 double width = interestingValues[k]; |
45 double scale = width / ((double)radius1 + (double)radius2); | 45 double scale = width / ((double)radius1 + (double)radius2); |
46 if (width > 0.0) { | 46 if (width > 0.0) { |
47 if (s != 0) { | 47 if (s != 0) { |
48 scale = std::min(scale, interestingValues[s-1]); | 48 scale = std::min(scale, interestingValues[s-1]); |
49 } | 49 } |
50 if (scale < 1.0 && scale > 0.0) { | 50 if (scale < 1.0 && scale > 0.0) { |
51 ScaleToSides::AdjustRadii(width, scale, &radius1, &r
adius2); | 51 SkScaleToSides::AdjustRadii(width, scale, &radius1,
&radius2); |
52 } | 52 } |
53 } | 53 } |
54 } | 54 } |
55 } | 55 } |
56 } | 56 } |
57 } | 57 } |
58 } | 58 } |
OLD | NEW |