Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: src/animator/SkDrawPaint.cpp

Issue 12906016: Fix more clang tautological-constant-out-of-range-compare errors. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: address review Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « samplecode/SampleStrokeText.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « samplecode/SampleStrokeText.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698