| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "gm.h" | 8 #include "gm.h" |
| 9 | 9 |
| 10 static void make_bitmap(SkBitmap* bitmap, SkIRect* center) { | 10 static void make_bitmap(SkBitmap* bitmap, SkIRect* center) { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 namespace skiagm { | 38 namespace skiagm { |
| 39 | 39 |
| 40 class NinePatchStretchGM : public GM { | 40 class NinePatchStretchGM : public GM { |
| 41 public: | 41 public: |
| 42 SkBitmap fBM; | 42 SkBitmap fBM; |
| 43 | 43 |
| 44 NinePatchStretchGM() {} | 44 NinePatchStretchGM() {} |
| 45 | 45 |
| 46 protected: | 46 protected: |
| 47 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
| 48 return kSkipTiled_Flag; |
| 49 } |
| 50 |
| 47 virtual SkString onShortName() { | 51 virtual SkString onShortName() { |
| 48 return SkString("ninepatch-stretch"); | 52 return SkString("ninepatch-stretch"); |
| 49 } | 53 } |
| 50 | 54 |
| 51 virtual SkISize onISize() { | 55 virtual SkISize onISize() { |
| 52 return make_isize(400, 400); | 56 return make_isize(400, 400); |
| 53 } | 57 } |
| 54 | 58 |
| 55 virtual void onDraw(SkCanvas* canvas) { | 59 virtual void onDraw(SkCanvas* canvas) { |
| 56 SkBitmap bm; | 60 SkBitmap bm; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 private: | 92 private: |
| 89 typedef GM INHERITED; | 93 typedef GM INHERITED; |
| 90 }; | 94 }; |
| 91 | 95 |
| 92 ////////////////////////////////////////////////////////////////////////////// | 96 ////////////////////////////////////////////////////////////////////////////// |
| 93 | 97 |
| 94 static GM* MyFactory(void*) { return new NinePatchStretchGM; } | 98 static GM* MyFactory(void*) { return new NinePatchStretchGM; } |
| 95 static GMRegistry reg(MyFactory); | 99 static GMRegistry reg(MyFactory); |
| 96 | 100 |
| 97 } | 101 } |
| OLD | NEW |