| OLD | NEW |
| 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 #include "SampleCode.h" | 7 #include "SampleCode.h" |
| 8 #include "SkBlurMask.h" | 8 #include "SkBlurMask.h" |
| 9 #include "SkBlurMaskFilter.h" | 9 #include "SkBlurMaskFilter.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 paint.setColor(SK_ColorWHITE); | 158 paint.setColor(SK_ColorWHITE); |
| 159 canvas->translate(10, 30); | 159 canvas->translate(10, 30); |
| 160 | 160 |
| 161 static const SkBlurStyle gStyle[] = { | 161 static const SkBlurStyle gStyle[] = { |
| 162 kNormal_SkBlurStyle, | 162 kNormal_SkBlurStyle, |
| 163 kInner_SkBlurStyle, | 163 kInner_SkBlurStyle, |
| 164 kOuter_SkBlurStyle, | 164 kOuter_SkBlurStyle, |
| 165 kSolid_SkBlurStyle, | 165 kSolid_SkBlurStyle, |
| 166 }; | 166 }; |
| 167 for (int x = 0; x < 5; x++) { | 167 for (int x = 0; x < 5; x++) { |
| 168 SkMaskFilter* mf; | |
| 169 SkScalar sigma = SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(
4)); | 168 SkScalar sigma = SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(
4)); |
| 170 for (int y = 0; y < 10; y++) { | 169 for (int y = 0; y < 10; y++) { |
| 171 if (x) { | 170 if (x) { |
| 172 mf = SkBlurMaskFilter::Create(gStyle[x - 1], sigma); | 171 paint.setMaskFilter(SkBlurMaskFilter::Make(gStyle[x - 1]
, sigma)); |
| 173 paint.setMaskFilter(mf)->unref(); | |
| 174 } | 172 } |
| 175 canvas->drawText("Title Bar", 9, x*SkIntToScalar(100), y*SkI
ntToScalar(30), paint); | 173 canvas->drawText("Title Bar", 9, x*SkIntToScalar(100), y*SkI
ntToScalar(30), paint); |
| 176 sigma *= 0.75f; | 174 sigma *= 0.75f; |
| 177 } | 175 } |
| 178 | 176 |
| 179 } | 177 } |
| 180 return; | 178 return; |
| 181 } | 179 } |
| 182 | 180 |
| 183 paint.setColor(SK_ColorBLUE); | 181 paint.setColor(SK_ColorBLUE); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 213 return this->INHERITED::onFindClickHandler(x, y, modi); | 211 return this->INHERITED::onFindClickHandler(x, y, modi); |
| 214 } | 212 } |
| 215 private: | 213 private: |
| 216 typedef SampleView INHERITED; | 214 typedef SampleView INHERITED; |
| 217 }; | 215 }; |
| 218 | 216 |
| 219 ////////////////////////////////////////////////////////////////////////////// | 217 ////////////////////////////////////////////////////////////////////////////// |
| 220 | 218 |
| 221 static SkView* MyFactory() { return new StrokePathView; } | 219 static SkView* MyFactory() { return new StrokePathView; } |
| 222 static SkViewRegister reg(MyFactory); | 220 static SkViewRegister reg(MyFactory); |
| OLD | NEW |