| 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 "gm.h" | 8 #include "gm.h" |
| 9 #include "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
| 10 #include "SkBlurMaskFilter.h" | 10 #include "SkBlurMaskFilter.h" |
| 11 | 11 |
| 12 namespace skiagm { | 12 namespace skiagm { |
| 13 | 13 |
| 14 class BlursGM : public GM { | 14 class BlursGM : public GM { |
| 15 public: | 15 public: |
| 16 BlursGM() { | 16 BlursGM() { |
| 17 this->setBGColor(0xFFDDDDDD); | 17 this->setBGColor(0xFFDDDDDD); |
| 18 } | 18 } |
| 19 | 19 |
| 20 protected: | 20 protected: |
| 21 virtual uint32_t onGetFlags() const SK_OVERRIDE { | 21 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
| 22 return kSkipTiled_Flag; | 22 return kSkipTiled_Flag; |
| 23 } | 23 } |
| 24 | 24 |
| 25 virtual SkString onShortName() { | 25 virtual SkString onShortName() { |
| 26 return SkString("blurs"); | 26 return SkString("blurs"); |
| 27 } | 27 } |
| 28 | 28 |
| 29 virtual SkISize onISize() { | 29 virtual SkISize onISize() { |
| 30 return make_isize(700, 500); | 30 return SkISize::Make(700, 500); |
| 31 } | 31 } |
| 32 | 32 |
| 33 virtual void onDraw(SkCanvas* canvas) { | 33 virtual void onDraw(SkCanvas* canvas) { |
| 34 SkBlurStyle NONE = SkBlurStyle(-999); | 34 SkBlurStyle NONE = SkBlurStyle(-999); |
| 35 static const struct { | 35 static const struct { |
| 36 SkBlurStyle fStyle; | 36 SkBlurStyle fStyle; |
| 37 int fCx, fCy; | 37 int fCx, fCy; |
| 38 } gRecs[] = { | 38 } gRecs[] = { |
| 39 { NONE, 0, 0 }, | 39 { NONE, 0, 0 }, |
| 40 { kInner_SkBlurStyle, -1, 0 }, | 40 { kInner_SkBlurStyle, -1, 0 }, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 private: | 93 private: |
| 94 typedef GM INHERITED; | 94 typedef GM INHERITED; |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 ////////////////////////////////////////////////////////////////////////////// | 97 ////////////////////////////////////////////////////////////////////////////// |
| 98 | 98 |
| 99 static GM* MyFactory(void*) { return new BlursGM; } | 99 static GM* MyFactory(void*) { return new BlursGM; } |
| 100 static GMRegistry reg(MyFactory); | 100 static GMRegistry reg(MyFactory); |
| 101 | 101 |
| 102 } | 102 } |
| OLD | NEW |