| OLD | NEW |
| 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 "SampleCode.h" | 8 #include "SampleCode.h" |
| 9 #include "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
| 10 #include "SkBlurMaskFilter.h" | 10 #include "SkBlurMaskFilter.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 virtual void onDrawContent(SkCanvas* canvas) { | 63 virtual void onDrawContent(SkCanvas* canvas) { |
| 64 const char* str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | 64 const char* str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; |
| 65 SkPaint paint; | 65 SkPaint paint; |
| 66 SkScalar x = SkIntToScalar(10); | 66 SkScalar x = SkIntToScalar(10); |
| 67 SkScalar y = SkIntToScalar(20); | 67 SkScalar y = SkIntToScalar(20); |
| 68 | 68 |
| 69 paint.setFlags(0x105); | 69 paint.setFlags(0x105); |
| 70 | 70 |
| 71 paint.setARGB(fByte, 0xFF, 0xFF, 0xFF); | 71 paint.setARGB(fByte, 0xFF, 0xFF, 0xFF); |
| 72 | 72 |
| 73 paint.setMaskFilter(SkBlurMaskFilter::Create(SkBlurMaskFilter::kNormal_B
lurStyle, | 73 paint.setMaskFilter(SkBlurMaskFilter::Create(kNormal_SkBlurStyle, |
| 74 SkBlurMask::ConvertRadiusToSigma(SkIntToScal
ar(3)))); | 74 SkBlurMask::ConvertRadiusToSigma(SkIntToScal
ar(3)))); |
| 75 paint.getMaskFilter()->unref(); | 75 paint.getMaskFilter()->unref(); |
| 76 | 76 |
| 77 SkRandom rand; | 77 SkRandom rand; |
| 78 | 78 |
| 79 for (int ps = 6; ps <= 35; ps++) { | 79 for (int ps = 6; ps <= 35; ps++) { |
| 80 paint.setColor(rand.nextU() | (0xFF << 24)); | 80 paint.setColor(rand.nextU() | (0xFF << 24)); |
| 81 paint.setTextSize(SkIntToScalar(ps)); | 81 paint.setTextSize(SkIntToScalar(ps)); |
| 82 paint.setTextSize(SkIntToScalar(24)); | 82 paint.setTextSize(SkIntToScalar(24)); |
| 83 canvas->drawText(str, strlen(str), x, y, paint); | 83 canvas->drawText(str, strlen(str), x, y, paint); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 114 private: | 114 private: |
| 115 int fByte; | 115 int fByte; |
| 116 | 116 |
| 117 typedef SampleView INHERITED; | 117 typedef SampleView INHERITED; |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 ////////////////////////////////////////////////////////////////////////////// | 120 ////////////////////////////////////////////////////////////////////////////// |
| 121 | 121 |
| 122 static SkView* MyFactory() { return new TextAlphaView; } | 122 static SkView* MyFactory() { return new TextAlphaView; } |
| 123 static SkViewRegister reg(MyFactory); | 123 static SkViewRegister reg(MyFactory); |
| OLD | NEW |