| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 static void setup(SkPaint* paint, const SkBitmap& bm, bool filter, | 50 static void setup(SkPaint* paint, const SkBitmap& bm, bool filter, |
| 51 SkShader::TileMode tmx, SkShader::TileMode tmy) { | 51 SkShader::TileMode tmx, SkShader::TileMode tmy) { |
| 52 SkShader* shader = SkShader::CreateBitmapShader(bm, tmx, tmy); | 52 SkShader* shader = SkShader::CreateBitmapShader(bm, tmx, tmy); |
| 53 paint->setShader(shader)->unref(); | 53 paint->setShader(shader)->unref(); |
| 54 paint->setFilterBitmap(filter); | 54 paint->setFilterBitmap(filter); |
| 55 } | 55 } |
| 56 | 56 |
| 57 static const SkBitmap::Config gConfigs[] = { | 57 static const SkBitmap::Config gConfigs[] = { |
| 58 SkBitmap::kARGB_8888_Config, | 58 SkBitmap::kARGB_8888_Config, |
| 59 SkBitmap::kRGB_565_Config, | 59 SkBitmap::kRGB_565_Config, |
| 60 SkBitmap::kARGB_4444_Config | |
| 61 }; | 60 }; |
| 62 static const int gWidth = 32; | 61 static const int gWidth = 32; |
| 63 static const int gHeight = 32; | 62 static const int gHeight = 32; |
| 64 | 63 |
| 65 class TilingView : public SampleView { | 64 class TilingView : public SampleView { |
| 66 SkPicture* fTextPicture; | 65 SkPicture* fTextPicture; |
| 67 SkBlurDrawLooper fLooper; | 66 SkBlurDrawLooper fLooper; |
| 68 public: | 67 public: |
| 69 TilingView() | 68 TilingView() |
| 70 : fLooper(SkIntToScalar(1), SkIntToScalar(2), SkIntToScalar(2), | 69 : fLooper(SkIntToScalar(1), SkIntToScalar(2), SkIntToScalar(2), |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 } | 163 } |
| 165 | 164 |
| 166 private: | 165 private: |
| 167 typedef SampleView INHERITED; | 166 typedef SampleView INHERITED; |
| 168 }; | 167 }; |
| 169 | 168 |
| 170 ////////////////////////////////////////////////////////////////////////////// | 169 ////////////////////////////////////////////////////////////////////////////// |
| 171 | 170 |
| 172 static SkView* MyFactory() { return new TilingView; } | 171 static SkView* MyFactory() { return new TilingView; } |
| 173 static SkViewRegister reg(MyFactory); | 172 static SkViewRegister reg(MyFactory); |
| OLD | NEW |