| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 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 "gm.h" | 8 #include "gm.h" |
| 9 | 9 |
| 10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 class BitmapShaderGM : public GM { | 43 class BitmapShaderGM : public GM { |
| 44 | 44 |
| 45 protected: | 45 protected: |
| 46 void onOnceBeforeDraw() override { | 46 void onOnceBeforeDraw() override { |
| 47 this->setBGColor(SK_ColorGRAY); | 47 this->setBGColor(SK_ColorGRAY); |
| 48 draw_bm(&fBitmap); | 48 draw_bm(&fBitmap); |
| 49 draw_mask(&fMask); | 49 draw_mask(&fMask); |
| 50 } | 50 } |
| 51 | 51 |
| 52 virtual SkString onShortName() { | 52 SkString onShortName() override { |
| 53 return SkString("bitmapshaders"); | 53 return SkString("bitmapshaders"); |
| 54 } | 54 } |
| 55 | 55 |
| 56 virtual SkISize onISize() { | 56 SkISize onISize() override { |
| 57 return SkISize::Make(150, 100); | 57 return SkISize::Make(150, 100); |
| 58 } | 58 } |
| 59 | 59 |
| 60 virtual void onDraw(SkCanvas* canvas) { | 60 void onDraw(SkCanvas* canvas) override { |
| 61 SkPaint paint; | 61 SkPaint paint; |
| 62 | 62 |
| 63 for (int i = 0; i < 2; i++) { | 63 for (int i = 0; i < 2; i++) { |
| 64 SkMatrix s; | 64 SkMatrix s; |
| 65 s.reset(); | 65 s.reset(); |
| 66 if (1 == i) { | 66 if (1 == i) { |
| 67 s.setScale(1.5f, 1.5f); | 67 s.setScale(1.5f, 1.5f); |
| 68 s.postTranslate(2, 2); | 68 s.postTranslate(2, 2); |
| 69 } | 69 } |
| 70 | 70 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 typedef GM INHERITED; | 110 typedef GM INHERITED; |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 ////////////////////////////////////////////////////////////////////////////// | 113 ////////////////////////////////////////////////////////////////////////////// |
| 114 | 114 |
| 115 static GM* MyFactory(void*) { return new BitmapShaderGM; } | 115 static GM* MyFactory(void*) { return new BitmapShaderGM; } |
| 116 static GMRegistry reg(MyFactory); | 116 static GMRegistry reg(MyFactory); |
| 117 | 117 |
| 118 } | 118 } |
| OLD | NEW |