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 "SkDrawPaint.h" | 10 #include "SkDrawPaint.h" |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 paint->setAntiAlias(SkToBool(antiAlias)); | 217 paint->setAntiAlias(SkToBool(antiAlias)); |
218 if (color != NULL) | 218 if (color != NULL) |
219 paint->setColor(color->getColor()); | 219 paint->setColor(color->getColor()); |
220 if (fakeBold != -1) | 220 if (fakeBold != -1) |
221 paint->setFakeBoldText(SkToBool(fakeBold)); | 221 paint->setFakeBoldText(SkToBool(fakeBold)); |
222 if (filterBitmap != -1) | 222 if (filterBitmap != -1) |
223 paint->setFilterBitmap(SkToBool(filterBitmap)); | 223 paint->setFilterBitmap(SkToBool(filterBitmap)); |
224 // stroke is legacy; style setting if present overrides stroke | 224 // stroke is legacy; style setting if present overrides stroke |
225 if (stroke != -1) | 225 if (stroke != -1) |
226 paint->setStyle(SkToBool(stroke) ? SkPaint::kStroke_Style : SkPaint::kFi
ll_Style); | 226 paint->setStyle(SkToBool(stroke) ? SkPaint::kStroke_Style : SkPaint::kFi
ll_Style); |
227 if (style != (SkPaint::Style) -1) | 227 if (style != -1) |
228 paint->setStyle((SkPaint::Style) style); | 228 paint->setStyle((SkPaint::Style) style); |
229 if (linearText != -1) | 229 if (linearText != -1) |
230 paint->setLinearText(SkToBool(linearText)); | 230 paint->setLinearText(SkToBool(linearText)); |
231 if (maskFilter == NULL) | 231 if (maskFilter == NULL) |
232 paint->setMaskFilter(NULL); | 232 paint->setMaskFilter(NULL); |
233 else if (maskFilter != (SkDrawMaskFilter*) -1) | 233 else if (maskFilter != (SkDrawMaskFilter*) -1) |
234 SkSafeUnref(paint->setMaskFilter(maskFilter->getMaskFilter())); | 234 SkSafeUnref(paint->setMaskFilter(maskFilter->getMaskFilter())); |
235 if (pathEffect == NULL) | 235 if (pathEffect == NULL) |
236 paint->setPathEffect(NULL); | 236 paint->setPathEffect(NULL); |
237 else if (pathEffect != (SkDrawPathEffect*) -1) | 237 else if (pathEffect != (SkDrawPathEffect*) -1) |
238 SkSafeUnref(paint->setPathEffect(pathEffect->getPathEffect())); | 238 SkSafeUnref(paint->setPathEffect(pathEffect->getPathEffect())); |
239 if (shader == NULL) | 239 if (shader == NULL) |
240 paint->setShader(NULL); | 240 paint->setShader(NULL); |
241 else if (shader != (SkDrawShader*) -1) | 241 else if (shader != (SkDrawShader*) -1) |
242 SkSafeUnref(paint->setShader(shader->getShader())); | 242 SkSafeUnref(paint->setShader(shader->getShader())); |
243 if (strikeThru != -1) | 243 if (strikeThru != -1) |
244 paint->setStrikeThruText(SkToBool(strikeThru)); | 244 paint->setStrikeThruText(SkToBool(strikeThru)); |
245 if (strokeCap != (SkPaint::Cap) -1) | 245 if (strokeCap != -1) |
246 paint->setStrokeCap((SkPaint::Cap) strokeCap); | 246 paint->setStrokeCap((SkPaint::Cap) strokeCap); |
247 if (strokeJoin != (SkPaint::Join) -1) | 247 if (strokeJoin != -1) |
248 paint->setStrokeJoin((SkPaint::Join) strokeJoin); | 248 paint->setStrokeJoin((SkPaint::Join) strokeJoin); |
249 if (SkScalarIsNaN(strokeMiter) == false) | 249 if (SkScalarIsNaN(strokeMiter) == false) |
250 paint->setStrokeMiter(strokeMiter); | 250 paint->setStrokeMiter(strokeMiter); |
251 if (SkScalarIsNaN(strokeWidth) == false) | 251 if (SkScalarIsNaN(strokeWidth) == false) |
252 paint->setStrokeWidth(strokeWidth); | 252 paint->setStrokeWidth(strokeWidth); |
253 if (textAlign != (SkPaint::Align) -1) | 253 if (textAlign != -1) |
254 paint->setTextAlign((SkPaint::Align) textAlign); | 254 paint->setTextAlign((SkPaint::Align) textAlign); |
255 if (SkScalarIsNaN(textScaleX) == false) | 255 if (SkScalarIsNaN(textScaleX) == false) |
256 paint->setTextScaleX(textScaleX); | 256 paint->setTextScaleX(textScaleX); |
257 if (SkScalarIsNaN(textSize) == false) | 257 if (SkScalarIsNaN(textSize) == false) |
258 paint->setTextSize(textSize); | 258 paint->setTextSize(textSize); |
259 if (SkScalarIsNaN(textSkewX) == false) | 259 if (SkScalarIsNaN(textSkewX) == false) |
260 paint->setTextSkewX(textSkewX); | 260 paint->setTextSkewX(textSkewX); |
261 if (typeface == NULL) | 261 if (typeface == NULL) |
262 paint->setTypeface(NULL); | 262 paint->setTypeface(NULL); |
263 else if (typeface != (SkDrawTypeface*) -1) | 263 else if (typeface != (SkDrawTypeface*) -1) |
264 SkSafeUnref(paint->setTypeface(typeface->getTypeface())); | 264 SkSafeUnref(paint->setTypeface(typeface->getTypeface())); |
265 if (underline != -1) | 265 if (underline != -1) |
266 paint->setUnderlineText(SkToBool(underline)); | 266 paint->setUnderlineText(SkToBool(underline)); |
267 if (xfermode != (SkXfermode::Mode) -1) | 267 if (xfermode != -1) |
268 paint->setXfermodeMode((SkXfermode::Mode) xfermode); | 268 paint->setXfermodeMode((SkXfermode::Mode) xfermode); |
269 } | 269 } |
OLD | NEW |