| 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 | |
| 51 virtual SkString onShortName() { | 47 virtual SkString onShortName() { |
| 52 return SkString("ninepatch-stretch"); | 48 return SkString("ninepatch-stretch"); |
| 53 } | 49 } |
| 54 | 50 |
| 55 virtual SkISize onISize() { | 51 virtual SkISize onISize() { |
| 56 return SkISize::Make(400, 400); | 52 return SkISize::Make(400, 400); |
| 57 } | 53 } |
| 58 | 54 |
| 59 virtual void onDraw(SkCanvas* canvas) { | 55 virtual void onDraw(SkCanvas* canvas) { |
| 60 SkBitmap bm; | 56 SkBitmap bm; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 private: | 88 private: |
| 93 typedef GM INHERITED; | 89 typedef GM INHERITED; |
| 94 }; | 90 }; |
| 95 | 91 |
| 96 ////////////////////////////////////////////////////////////////////////////// | 92 ////////////////////////////////////////////////////////////////////////////// |
| 97 | 93 |
| 98 static GM* MyFactory(void*) { return new NinePatchStretchGM; } | 94 static GM* MyFactory(void*) { return new NinePatchStretchGM; } |
| 99 static GMRegistry reg(MyFactory); | 95 static GMRegistry reg(MyFactory); |
| 100 | 96 |
| 101 } | 97 } |
| OLD | NEW |