| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 SkBitmap::kRGB_565_Config, | 59 SkBitmap::kRGB_565_Config, |
| 60 }; | 60 }; |
| 61 static const int gWidth = 32; | 61 static const int gWidth = 32; |
| 62 static const int gHeight = 32; | 62 static const int gHeight = 32; |
| 63 | 63 |
| 64 class TilingView : public SampleView { | 64 class TilingView : public SampleView { |
| 65 SkPicture* fTextPicture; | 65 SkPicture* fTextPicture; |
| 66 SkBlurDrawLooper fLooper; | 66 SkBlurDrawLooper fLooper; |
| 67 public: | 67 public: |
| 68 TilingView() | 68 TilingView() |
| 69 : fLooper(SkIntToScalar(1), SkIntToScalar(2), SkIntToScalar(2), | 69 : fLooper(0x88000000, SkFloatToScalar(1.07735f), SkIntToScalar(2), S
kIntToScalar(2)) { |
| 70 0x88000000) { | |
| 71 fTextPicture = new SkPicture(); | 70 fTextPicture = new SkPicture(); |
| 72 for (size_t i = 0; i < SK_ARRAY_COUNT(gConfigs); i++) { | 71 for (size_t i = 0; i < SK_ARRAY_COUNT(gConfigs); i++) { |
| 73 makebm(&fTexture[i], gConfigs[i], gWidth, gHeight); | 72 makebm(&fTexture[i], gConfigs[i], gWidth, gHeight); |
| 74 } | 73 } |
| 75 } | 74 } |
| 76 | 75 |
| 77 ~TilingView() { | 76 ~TilingView() { |
| 78 fTextPicture->unref(); | 77 fTextPicture->unref(); |
| 79 } | 78 } |
| 80 | 79 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 } | 162 } |
| 164 | 163 |
| 165 private: | 164 private: |
| 166 typedef SampleView INHERITED; | 165 typedef SampleView INHERITED; |
| 167 }; | 166 }; |
| 168 | 167 |
| 169 ////////////////////////////////////////////////////////////////////////////// | 168 ////////////////////////////////////////////////////////////////////////////// |
| 170 | 169 |
| 171 static SkView* MyFactory() { return new TilingView; } | 170 static SkView* MyFactory() { return new TilingView; } |
| 172 static SkViewRegister reg(MyFactory); | 171 static SkViewRegister reg(MyFactory); |
| OLD | NEW |