| 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 "SkView.h" | 9 #include "SkView.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 static const SkColorType gColorTypes[] = { | 49 static const SkColorType gColorTypes[] = { |
| 50 kN32_SkColorType, | 50 kN32_SkColorType, |
| 51 kRGB_565_SkColorType, | 51 kRGB_565_SkColorType, |
| 52 }; | 52 }; |
| 53 static const int gWidth = 32; | 53 static const int gWidth = 32; |
| 54 static const int gHeight = 32; | 54 static const int gHeight = 32; |
| 55 | 55 |
| 56 class TilingView : public SampleView { | 56 class TilingView : public SampleView { |
| 57 sk_sp<SkPicture> fTextPicture; | 57 sk_sp<SkPicture> fTextPicture; |
| 58 SkAutoTUnref<SkDrawLooper> fLooper; | 58 sk_sp<SkDrawLooper> fLooper; |
| 59 public: | 59 public: |
| 60 TilingView() | 60 TilingView() |
| 61 : fLooper(SkBlurDrawLooper::Create(0x88000000, | 61 : fLooper(SkBlurDrawLooper::Make(0x88000000, |
| 62 SkBlurMask::ConvertRadiusToSigma(
SkIntToScalar(1)), | 62 SkBlurMask::ConvertRadiusToSigma(SkIntT
oScalar(1)), |
| 63 SkIntToScalar(2), SkIntToScalar(2
))) { | 63 SkIntToScalar(2), SkIntToScalar(2))) { |
| 64 for (size_t i = 0; i < SK_ARRAY_COUNT(gColorTypes); i++) { | 64 for (size_t i = 0; i < SK_ARRAY_COUNT(gColorTypes); i++) { |
| 65 makebm(&fTexture[i], gColorTypes[i], gWidth, gHeight); | 65 makebm(&fTexture[i], gColorTypes[i], gWidth, gHeight); |
| 66 } | 66 } |
| 67 } | 67 } |
| 68 | 68 |
| 69 virtual ~TilingView() { | 69 virtual ~TilingView() { |
| 70 } | 70 } |
| 71 | 71 |
| 72 SkBitmap fTexture[SK_ARRAY_COUNT(gColorTypes)]; | 72 SkBitmap fTexture[SK_ARRAY_COUNT(gColorTypes)]; |
| 73 | 73 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 } | 161 } |
| 162 | 162 |
| 163 private: | 163 private: |
| 164 typedef SampleView INHERITED; | 164 typedef SampleView INHERITED; |
| 165 }; | 165 }; |
| 166 | 166 |
| 167 ////////////////////////////////////////////////////////////////////////////// | 167 ////////////////////////////////////////////////////////////////////////////// |
| 168 | 168 |
| 169 static SkView* MyFactory() { return new TilingView; } | 169 static SkView* MyFactory() { return new TilingView; } |
| 170 static SkViewRegister reg(MyFactory); | 170 static SkViewRegister reg(MyFactory); |
| OLD | NEW |