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 "SkDrawGradient.h" | 10 #include "SkDrawGradient.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 120 |
121 #ifdef SK_DUMP_ENABLED | 121 #ifdef SK_DUMP_ENABLED |
122 void SkDrawLinearGradient::dump(SkAnimateMaker* maker) { | 122 void SkDrawLinearGradient::dump(SkAnimateMaker* maker) { |
123 dumpBase(maker); | 123 dumpBase(maker); |
124 dumpRest(maker); | 124 dumpRest(maker); |
125 } | 125 } |
126 #endif | 126 #endif |
127 | 127 |
128 SkShader* SkDrawLinearGradient::getShader() { | 128 SkShader* SkDrawLinearGradient::getShader() { |
129 if (addPrelude() == 0 || points.count() != 4) | 129 if (addPrelude() == 0 || points.count() != 4) |
130 return NULL; | 130 return nullptr; |
131 SkShader* shader = SkGradientShader::CreateLinear((SkPoint*)points.begin(), | 131 SkShader* shader = SkGradientShader::CreateLinear((SkPoint*)points.begin(), |
132 fColors.begin(), offsets.begin(), fColors.count(), (SkShader::TileMode)
tileMode, | 132 fColors.begin(), offsets.begin(), fColors.count(), (SkShader::TileMode)
tileMode, |
133 0, getMatrix()); | 133 0, getMatrix()); |
134 SkAutoTDelete<SkShader> autoDel(shader); | 134 SkAutoTDelete<SkShader> autoDel(shader); |
135 (void)autoDel.detach(); | 135 (void)autoDel.detach(); |
136 return shader; | 136 return shader; |
137 } | 137 } |
138 | 138 |
139 | 139 |
140 #if SK_USE_CONDENSED_INFO == 0 | 140 #if SK_USE_CONDENSED_INFO == 0 |
(...skipping 14 matching lines...) Expand all Loading... |
155 | 155 |
156 #ifdef SK_DUMP_ENABLED | 156 #ifdef SK_DUMP_ENABLED |
157 void SkDrawRadialGradient::dump(SkAnimateMaker* maker) { | 157 void SkDrawRadialGradient::dump(SkAnimateMaker* maker) { |
158 dumpBase(maker); | 158 dumpBase(maker); |
159 dumpRest(maker); | 159 dumpRest(maker); |
160 } | 160 } |
161 #endif | 161 #endif |
162 | 162 |
163 SkShader* SkDrawRadialGradient::getShader() { | 163 SkShader* SkDrawRadialGradient::getShader() { |
164 if (addPrelude() == 0) | 164 if (addPrelude() == 0) |
165 return NULL; | 165 return nullptr; |
166 SkShader* shader = SkGradientShader::CreateRadial(center, | 166 SkShader* shader = SkGradientShader::CreateRadial(center, |
167 radius, fColors.begin(), offsets.begin(), fColors.count(), (SkShader::Ti
leMode) tileMode, | 167 radius, fColors.begin(), offsets.begin(), fColors.count(), (SkShader::Ti
leMode) tileMode, |
168 0, getMatrix()); | 168 0, getMatrix()); |
169 SkAutoTDelete<SkShader> autoDel(shader); | 169 SkAutoTDelete<SkShader> autoDel(shader); |
170 (void)autoDel.detach(); | 170 (void)autoDel.detach(); |
171 return shader; | 171 return shader; |
172 } | 172 } |
OLD | NEW |