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

Side by Side Diff: src/effects/SkBlurDrawLooper.cpp

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 years, 3 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 | « src/effects/SkBitmapSource.cpp ('k') | src/effects/SkBlurMask.h » ('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 2011 Google Inc. 2 * Copyright 2011 Google Inc.
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 "SkBlurDrawLooper.h" 8 #include "SkBlurDrawLooper.h"
9 #include "SkBlurMask.h" // just for SkBlurMask::ConvertRadiusToSigma 9 #include "SkBlurMask.h" // just for SkBlurMask::ConvertRadiusToSigma
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
(...skipping 18 matching lines...) Expand all
29 uint32_t flags = fBlurFlags & kIgnoreTransform_BlurFlag ? 29 uint32_t flags = fBlurFlags & kIgnoreTransform_BlurFlag ?
30 SkBlurMaskFilter::kIgnoreTransform_BlurFlag : 30 SkBlurMaskFilter::kIgnoreTransform_BlurFlag :
31 SkBlurMaskFilter::kNone_BlurFlag; 31 SkBlurMaskFilter::kNone_BlurFlag;
32 32
33 flags |= fBlurFlags & kHighQuality_BlurFlag ? 33 flags |= fBlurFlags & kHighQuality_BlurFlag ?
34 SkBlurMaskFilter::kHighQuality_BlurFlag : 34 SkBlurMaskFilter::kHighQuality_BlurFlag :
35 SkBlurMaskFilter::kNone_BlurFlag; 35 SkBlurMaskFilter::kNone_BlurFlag;
36 36
37 fBlur = SkBlurMaskFilter::Create(kNormal_SkBlurStyle, fSigma, flags); 37 fBlur = SkBlurMaskFilter::Create(kNormal_SkBlurStyle, fSigma, flags);
38 } else { 38 } else {
39 fBlur = NULL; 39 fBlur = nullptr;
40 } 40 }
41 41
42 if (fBlurFlags & kOverrideColor_BlurFlag) { 42 if (fBlurFlags & kOverrideColor_BlurFlag) {
43 // Set alpha to 1 for the override since transparency will already 43 // Set alpha to 1 for the override since transparency will already
44 // be baked into the blurred mask. 44 // be baked into the blurred mask.
45 SkColor opaqueColor = SkColorSetA(fBlurColor, 255); 45 SkColor opaqueColor = SkColorSetA(fBlurColor, 255);
46 //The SrcIn xfer mode will multiply 'color' by the incoming alpha 46 //The SrcIn xfer mode will multiply 'color' by the incoming alpha
47 fColorFilter = SkColorFilter::CreateModeFilter(opaqueColor, 47 fColorFilter = SkColorFilter::CreateModeFilter(opaqueColor,
48 SkXfermode::kSrcIn_Mode); 48 SkXfermode::kSrcIn_Mode);
49 } else { 49 } else {
50 fColorFilter = NULL; 50 fColorFilter = nullptr;
51 } 51 }
52 } 52 }
53 53
54 void SkBlurDrawLooper::init(SkScalar sigma, SkScalar dx, SkScalar dy, 54 void SkBlurDrawLooper::init(SkScalar sigma, SkScalar dx, SkScalar dy,
55 SkColor color, uint32_t flags) { 55 SkColor color, uint32_t flags) {
56 fSigma = sigma; 56 fSigma = sigma;
57 fDx = dx; 57 fDx = dx;
58 fDy = dy; 58 fDy = dy;
59 fBlurColor = color; 59 fBlurColor = color;
60 fBlurFlags = flags; 60 fBlurFlags = flags;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 &needsSeparator); 175 &needsSeparator);
176 SkAddFlagToString(str, SkToBool(kHighQuality_BlurFlag & fBlurFlags), "Hi ghQuality", 176 SkAddFlagToString(str, SkToBool(kHighQuality_BlurFlag & fBlurFlags), "Hi ghQuality",
177 &needsSeparator); 177 &needsSeparator);
178 } 178 }
179 str->append(")"); 179 str->append(")");
180 180
181 // TODO: add optional "fBlurFilter->toString(str);" when SkMaskFilter::toStr ing is added 181 // TODO: add optional "fBlurFilter->toString(str);" when SkMaskFilter::toStr ing is added
182 // alternatively we could cache the radius in SkBlurDrawLooper and just add it here 182 // alternatively we could cache the radius in SkBlurDrawLooper and just add it here
183 } 183 }
184 #endif 184 #endif
OLDNEW
« no previous file with comments | « src/effects/SkBitmapSource.cpp ('k') | src/effects/SkBlurMask.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698