| 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 | 7 |
| 8 #include "SampleCode.h" | 8 #include "SampleCode.h" |
| 9 #include "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
| 10 #include "SkView.h" | 10 #include "SkView.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 } | 46 } |
| 47 return this->INHERITED::onQuery(evt); | 47 return this->INHERITED::onQuery(evt); |
| 48 } | 48 } |
| 49 | 49 |
| 50 virtual void onDrawContent(SkCanvas* canvas) { | 50 virtual void onDrawContent(SkCanvas* canvas) { |
| 51 SkPaint paint; | 51 SkPaint paint; |
| 52 | 52 |
| 53 paint.setAntiAlias(true); | 53 paint.setAntiAlias(true); |
| 54 paint.setStyle(SkPaint::kStroke_Style); | 54 paint.setStyle(SkPaint::kStroke_Style); |
| 55 paint.setStrokeWidth(SkIntToScalar(10)); | 55 paint.setStrokeWidth(SkIntToScalar(10)); |
| 56 paint.setMaskFilter(new SkEmbossMaskFilter( | 56 paint.setMaskFilter(SkEmbossMaskFilter::Create( |
| 57 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(4)), fLight))->unref(
); | 57 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(4)), fLight))->unref(
); |
| 58 paint.setShader(new SkColorShader(SK_ColorBLUE))->unref(); | 58 paint.setShader(new SkColorShader(SK_ColorBLUE))->unref(); |
| 59 paint.setDither(true); | 59 paint.setDither(true); |
| 60 | 60 |
| 61 canvas->drawCircle(SkIntToScalar(50), SkIntToScalar(50), | 61 canvas->drawCircle(SkIntToScalar(50), SkIntToScalar(50), |
| 62 SkIntToScalar(30), paint); | 62 SkIntToScalar(30), paint); |
| 63 } | 63 } |
| 64 | 64 |
| 65 private: | 65 private: |
| 66 | 66 |
| 67 typedef SampleView INHERITED; | 67 typedef SampleView INHERITED; |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 ////////////////////////////////////////////////////////////////////////////// | 70 ////////////////////////////////////////////////////////////////////////////// |
| 71 | 71 |
| 72 static SkView* MyFactory() { return new EmbossView; } | 72 static SkView* MyFactory() { return new EmbossView; } |
| 73 static SkViewRegister reg(MyFactory); | 73 static SkViewRegister reg(MyFactory); |
| OLD | NEW |