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

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

Issue 1829303002: move setshader to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: addressing comments from #8 Created 4 years, 9 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
« no previous file with comments | « samplecode/SampleLighting.cpp ('k') | src/c/sk_paint.cpp » ('j') | 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 * 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 paint->setMaskFilter(nullptr); 230 paint->setMaskFilter(nullptr);
231 else if (maskFilter != (SkDrawMaskFilter*) -1) 231 else if (maskFilter != (SkDrawMaskFilter*) -1)
232 SkSafeUnref(paint->setMaskFilter(maskFilter->getMaskFilter())); 232 SkSafeUnref(paint->setMaskFilter(maskFilter->getMaskFilter()));
233 if (pathEffect == nullptr) 233 if (pathEffect == nullptr)
234 paint->setPathEffect(nullptr); 234 paint->setPathEffect(nullptr);
235 else if (pathEffect != (SkDrawPathEffect*) -1) 235 else if (pathEffect != (SkDrawPathEffect*) -1)
236 paint->setPathEffect(sk_ref_sp(pathEffect->getPathEffect())); 236 paint->setPathEffect(sk_ref_sp(pathEffect->getPathEffect()));
237 if (shader == nullptr) 237 if (shader == nullptr)
238 paint->setShader(nullptr); 238 paint->setShader(nullptr);
239 else if (shader != (SkDrawShader*) -1) 239 else if (shader != (SkDrawShader*) -1)
240 SkSafeUnref(paint->setShader(shader->getShader())); 240 paint->setShader(sk_ref_sp(shader->getShader()));
241 if (strikeThru != -1) 241 if (strikeThru != -1)
242 paint->setStrikeThruText(SkToBool(strikeThru)); 242 paint->setStrikeThruText(SkToBool(strikeThru));
243 if (strokeCap != -1) 243 if (strokeCap != -1)
244 paint->setStrokeCap((SkPaint::Cap) strokeCap); 244 paint->setStrokeCap((SkPaint::Cap) strokeCap);
245 if (strokeJoin != -1) 245 if (strokeJoin != -1)
246 paint->setStrokeJoin((SkPaint::Join) strokeJoin); 246 paint->setStrokeJoin((SkPaint::Join) strokeJoin);
247 if (SkScalarIsNaN(strokeMiter) == false) 247 if (SkScalarIsNaN(strokeMiter) == false)
248 paint->setStrokeMiter(strokeMiter); 248 paint->setStrokeMiter(strokeMiter);
249 if (SkScalarIsNaN(strokeWidth) == false) 249 if (SkScalarIsNaN(strokeWidth) == false)
250 paint->setStrokeWidth(strokeWidth); 250 paint->setStrokeWidth(strokeWidth);
251 if (textAlign != -1) 251 if (textAlign != -1)
252 paint->setTextAlign((SkPaint::Align) textAlign); 252 paint->setTextAlign((SkPaint::Align) textAlign);
253 if (SkScalarIsNaN(textScaleX) == false) 253 if (SkScalarIsNaN(textScaleX) == false)
254 paint->setTextScaleX(textScaleX); 254 paint->setTextScaleX(textScaleX);
255 if (SkScalarIsNaN(textSize) == false) 255 if (SkScalarIsNaN(textSize) == false)
256 paint->setTextSize(textSize); 256 paint->setTextSize(textSize);
257 if (SkScalarIsNaN(textSkewX) == false) 257 if (SkScalarIsNaN(textSkewX) == false)
258 paint->setTextSkewX(textSkewX); 258 paint->setTextSkewX(textSkewX);
259 if (typeface == nullptr) 259 if (typeface == nullptr)
260 paint->setTypeface(nullptr); 260 paint->setTypeface(nullptr);
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 }
OLDNEW
« no previous file with comments | « samplecode/SampleLighting.cpp ('k') | src/c/sk_paint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698