| 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 #include "SkPath.h" | 11 #include "SkPath.h" |
| 12 | 12 |
| 13 DEF_SIMPLE_GM_BG(blurs, canvas, 700, 500, sk_tool_utils::color_to_565(0xFFDDDDDD
)) { | 13 DEF_SIMPLE_GM_BG(blurs, canvas, 700, 500, sk_tool_utils::color_to_565(0xFFDDDDDD
)) { |
| 14 SkBlurStyle NONE = SkBlurStyle(-999); | 14 SkBlurStyle NONE = SkBlurStyle(-999); |
| 15 static const struct { | 15 const struct { |
| 16 SkBlurStyle fStyle; | 16 SkBlurStyle fStyle; |
| 17 int fCx, fCy; | 17 int fCx, fCy; |
| 18 } gRecs[] = { | 18 } gRecs[] = { |
| 19 { NONE, 0, 0 }, | 19 { NONE, 0, 0 }, |
| 20 { kInner_SkBlurStyle, -1, 0 }, | 20 { kInner_SkBlurStyle, -1, 0 }, |
| 21 { kNormal_SkBlurStyle, 0, 1 }, | 21 { kNormal_SkBlurStyle, 0, 1 }, |
| 22 { kSolid_SkBlurStyle, 0, -1 }, | 22 { kSolid_SkBlurStyle, 0, -1 }, |
| 23 { kOuter_SkBlurStyle, 1, 0 }, | 23 { kOuter_SkBlurStyle, 1, 0 }, |
| 24 }; | 24 }; |
| 25 | 25 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 SkScalar dx = SkScalarRoundToScalar(path.getBounds().width()) + 40 + 0.2
5f; | 110 SkScalar dx = SkScalarRoundToScalar(path.getBounds().width()) + 40 + 0.2
5f; |
| 111 canvas->translate(dx, 0); | 111 canvas->translate(dx, 0); |
| 112 canvas->drawPath(path, paint); | 112 canvas->drawPath(path, paint); |
| 113 | 113 |
| 114 // Translate to outside of clip bounds. | 114 // Translate to outside of clip bounds. |
| 115 canvas->translate(-dx, 0); | 115 canvas->translate(-dx, 0); |
| 116 canvas->translate(-30, -150); | 116 canvas->translate(-30, -150); |
| 117 canvas->drawPath(path, paint); | 117 canvas->drawPath(path, paint); |
| 118 } | 118 } |
| OLD | NEW |