| 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 } | 213 } |
| 214 | 214 |
| 215 void SkDrawPaint::setupPaint(SkPaint* paint) const { | 215 void SkDrawPaint::setupPaint(SkPaint* paint) const { |
| 216 if (antiAlias != -1) | 216 if (antiAlias != -1) |
| 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->setFilterLevel(filterBitmap ? SkPaint::kLow_FilterLevel : SkPaint
::kNone_FilterLevel); |
| 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 != -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) |
| (...skipping 26 matching lines...) Expand all Loading... |
| 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 != -1) | 267 if (xfermode != -1) |
| 268 paint->setXfermodeMode((SkXfermode::Mode) xfermode); | 268 paint->setXfermodeMode((SkXfermode::Mode) xfermode); |
| 269 } | 269 } |
| OLD | NEW |