| 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 | 49 |
| 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->setFilterLevel(filter ? SkPaint::kLow_FilterLevel : SkPaint::kNone_Fi
lterLevel); | 54 paint->setFilterLevel(filter ? SkPaint::kLow_FilterLevel : SkPaint::kNone_Fi
lterLevel); |
| 55 } | 55 } |
| 56 | 56 |
| 57 static const SkColorType gColorTypes[] = { | 57 static const SkColorType gColorTypes[] = { |
| 58 kPMColor_SkColorType, | 58 kN32_SkColorType, |
| 59 kRGB_565_SkColorType, | 59 kRGB_565_SkColorType, |
| 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() |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 } | 164 } |
| 165 | 165 |
| 166 private: | 166 private: |
| 167 typedef SampleView INHERITED; | 167 typedef SampleView INHERITED; |
| 168 }; | 168 }; |
| 169 | 169 |
| 170 ////////////////////////////////////////////////////////////////////////////// | 170 ////////////////////////////////////////////////////////////////////////////// |
| 171 | 171 |
| 172 static SkView* MyFactory() { return new TilingView; } | 172 static SkView* MyFactory() { return new TilingView; } |
| 173 static SkViewRegister reg(MyFactory); | 173 static SkViewRegister reg(MyFactory); |
| OLD | NEW |