| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 "SkDrawPaint.h" | 8 #include "SkDrawPaint.h" |
| 9 #include "SkAnimateMaker.h" | 9 #include "SkAnimateMaker.h" |
| 10 #include "SkDrawColor.h" | 10 #include "SkDrawColor.h" |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 } | 211 } |
| 212 | 212 |
| 213 void SkDrawPaint::setupPaint(SkPaint* paint) const { | 213 void SkDrawPaint::setupPaint(SkPaint* paint) const { |
| 214 if (antiAlias != -1) | 214 if (antiAlias != -1) |
| 215 paint->setAntiAlias(SkToBool(antiAlias)); | 215 paint->setAntiAlias(SkToBool(antiAlias)); |
| 216 if (color != NULL) | 216 if (color != NULL) |
| 217 paint->setColor(color->getColor()); | 217 paint->setColor(color->getColor()); |
| 218 if (fakeBold != -1) | 218 if (fakeBold != -1) |
| 219 paint->setFakeBoldText(SkToBool(fakeBold)); | 219 paint->setFakeBoldText(SkToBool(fakeBold)); |
| 220 if (filterBitmap != -1) | 220 if (filterBitmap != -1) |
| 221 paint->setFilterLevel(filterBitmap ? SkPaint::kLow_FilterLevel : SkPaint
::kNone_FilterLevel); | 221 paint->setFilterQuality(filterBitmap ? kLow_SkFilterQuality : kNone_SkFi
lterQuality); |
| 222 // stroke is legacy; style setting if present overrides stroke | 222 // stroke is legacy; style setting if present overrides stroke |
| 223 if (stroke != -1) | 223 if (stroke != -1) |
| 224 paint->setStyle(SkToBool(stroke) ? SkPaint::kStroke_Style : SkPaint::kFi
ll_Style); | 224 paint->setStyle(SkToBool(stroke) ? SkPaint::kStroke_Style : SkPaint::kFi
ll_Style); |
| 225 if (style != -1) | 225 if (style != -1) |
| 226 paint->setStyle((SkPaint::Style) style); | 226 paint->setStyle((SkPaint::Style) style); |
| 227 if (linearText != -1) | 227 if (linearText != -1) |
| 228 paint->setLinearText(SkToBool(linearText)); | 228 paint->setLinearText(SkToBool(linearText)); |
| 229 if (maskFilter == NULL) | 229 if (maskFilter == NULL) |
| 230 paint->setMaskFilter(NULL); | 230 paint->setMaskFilter(NULL); |
| 231 else if (maskFilter != (SkDrawMaskFilter*) -1) | 231 else if (maskFilter != (SkDrawMaskFilter*) -1) |
| (...skipping 26 matching lines...) Expand all Loading... |
| 258 paint->setTextSkewX(textSkewX); | 258 paint->setTextSkewX(textSkewX); |
| 259 if (typeface == NULL) | 259 if (typeface == NULL) |
| 260 paint->setTypeface(NULL); | 260 paint->setTypeface(NULL); |
| 261 else if (typeface != (SkDrawTypeface*) -1) | 261 else if (typeface != (SkDrawTypeface*) -1) |
| 262 SkSafeUnref(paint->setTypeface(typeface->getTypeface())); | 262 SkSafeUnref(paint->setTypeface(typeface->getTypeface())); |
| 263 if (underline != -1) | 263 if (underline != -1) |
| 264 paint->setUnderlineText(SkToBool(underline)); | 264 paint->setUnderlineText(SkToBool(underline)); |
| 265 if (xfermode != -1) | 265 if (xfermode != -1) |
| 266 paint->setXfermodeMode((SkXfermode::Mode) xfermode); | 266 paint->setXfermodeMode((SkXfermode::Mode) xfermode); |
| 267 } | 267 } |
| OLD | NEW |