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

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

Issue 249733002: Use default save() flags in SkBlurDrawLooper. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 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 | « no previous file | 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 2011 Google Inc. 3 * Copyright 2011 Google Inc.
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 #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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 blurColor = fLooper->fBlurColor; 113 blurColor = fLooper->fBlurColor;
114 if (SkColorGetA(blurColor) == 255) { 114 if (SkColorGetA(blurColor) == 255) {
115 blurColor = SkColorSetA(blurColor, paint->getAlpha()); 115 blurColor = SkColorSetA(blurColor, paint->getAlpha());
116 } 116 }
117 paint->setColor(blurColor); 117 paint->setColor(blurColor);
118 #else 118 #else
119 paint->setColor(fLooper->fBlurColor); 119 paint->setColor(fLooper->fBlurColor);
120 #endif 120 #endif
121 paint->setMaskFilter(fLooper->fBlur); 121 paint->setMaskFilter(fLooper->fBlur);
122 paint->setColorFilter(fLooper->fColorFilter); 122 paint->setColorFilter(fLooper->fColorFilter);
123 canvas->save(SkCanvas::kMatrix_SaveFlag); 123 canvas->save();
124 if (fLooper->fBlurFlags & kIgnoreTransform_BlurFlag) { 124 if (fLooper->fBlurFlags & kIgnoreTransform_BlurFlag) {
125 SkMatrix transform(canvas->getTotalMatrix()); 125 SkMatrix transform(canvas->getTotalMatrix());
126 transform.postTranslate(fLooper->fDx, fLooper->fDy); 126 transform.postTranslate(fLooper->fDx, fLooper->fDy);
127 canvas->setMatrix(transform); 127 canvas->setMatrix(transform);
128 } else { 128 } else {
129 canvas->translate(fLooper->fDx, fLooper->fDy); 129 canvas->translate(fLooper->fDx, fLooper->fDy);
130 } 130 }
131 fState = kAfterEdge; 131 fState = kAfterEdge;
132 return true; 132 return true;
133 case kAfterEdge: 133 case kAfterEdge:
(...skipping 30 matching lines...) Expand all
164 &needsSeparator); 164 &needsSeparator);
165 SkAddFlagToString(str, SkToBool(kHighQuality_BlurFlag & fBlurFlags), "Hi ghQuality", 165 SkAddFlagToString(str, SkToBool(kHighQuality_BlurFlag & fBlurFlags), "Hi ghQuality",
166 &needsSeparator); 166 &needsSeparator);
167 } 167 }
168 str->append(")"); 168 str->append(")");
169 169
170 // TODO: add optional "fBlurFilter->toString(str);" when SkMaskFilter::toStr ing is added 170 // TODO: add optional "fBlurFilter->toString(str);" when SkMaskFilter::toStr ing is added
171 // alternatively we could cache the radius in SkBlurDrawLooper and just add it here 171 // alternatively we could cache the radius in SkBlurDrawLooper and just add it here
172 } 172 }
173 #endif 173 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698