| 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 #include "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
| 10 #include "SkBlurMaskFilter.h" | 10 #include "SkBlurMaskFilter.h" |
| 11 | 11 |
| 12 class BlursGM : public skiagm::GM { | 12 class BlursGM : public skiagm::GM { |
| 13 public: | 13 public: |
| 14 BlursGM() { | 14 BlursGM() { |
| 15 this->setBGColor(0xFFDDDDDD); | 15 this->setBGColor(0xFFDDDDDD); |
| 16 } | 16 } |
| 17 | 17 |
| 18 protected: | 18 protected: |
| 19 virtual uint32_t onGetFlags() const SK_OVERRIDE { | 19 uint32_t onGetFlags() const SK_OVERRIDE { |
| 20 return kSkipTiled_Flag; | 20 return kSkipTiled_Flag; |
| 21 } | 21 } |
| 22 | 22 |
| 23 virtual SkString onShortName() SK_OVERRIDE { | 23 SkString onShortName() SK_OVERRIDE { |
| 24 return SkString("blurs"); | 24 return SkString("blurs"); |
| 25 } | 25 } |
| 26 | 26 |
| 27 virtual SkISize onISize() SK_OVERRIDE { | 27 SkISize onISize() SK_OVERRIDE { |
| 28 return SkISize::Make(700, 500); | 28 return SkISize::Make(700, 500); |
| 29 } | 29 } |
| 30 | 30 |
| 31 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 31 void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
| 32 SkBlurStyle NONE = SkBlurStyle(-999); | 32 SkBlurStyle NONE = SkBlurStyle(-999); |
| 33 static const struct { | 33 static const struct { |
| 34 SkBlurStyle fStyle; | 34 SkBlurStyle fStyle; |
| 35 int fCx, fCy; | 35 int fCx, fCy; |
| 36 } gRecs[] = { | 36 } gRecs[] = { |
| 37 { NONE, 0, 0 }, | 37 { NONE, 0, 0 }, |
| 38 { kInner_SkBlurStyle, -1, 0 }, | 38 { kInner_SkBlurStyle, -1, 0 }, |
| 39 { kNormal_SkBlurStyle, 0, 1 }, | 39 { kNormal_SkBlurStyle, 0, 1 }, |
| 40 { kSolid_SkBlurStyle, 0, -1 }, | 40 { kSolid_SkBlurStyle, 0, -1 }, |
| 41 { kOuter_SkBlurStyle, 1, 0 }, | 41 { kOuter_SkBlurStyle, 1, 0 }, |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 canvas->translate(dx, 0); | 160 canvas->translate(dx, 0); |
| 161 canvas->drawPath(path, paint); | 161 canvas->drawPath(path, paint); |
| 162 | 162 |
| 163 // Translate to outside of clip bounds. | 163 // Translate to outside of clip bounds. |
| 164 canvas->translate(-dx, 0); | 164 canvas->translate(-dx, 0); |
| 165 canvas->translate(-30, -150); | 165 canvas->translate(-30, -150); |
| 166 canvas->drawPath(path, paint); | 166 canvas->drawPath(path, paint); |
| 167 } | 167 } |
| 168 }; | 168 }; |
| 169 DEF_GM( return new Blur2RectsNonNinePatchGM; ) | 169 DEF_GM( return new Blur2RectsNonNinePatchGM; ) |
| OLD | NEW |