robertphillips@google.com | 42cc237 | 2013-12-10 15:19:32 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2013 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #include "SkBorder.h" |
| 9 | |
| 10 | SkBorder::SkBorder(SkPaint& p, SkScalar width, BorderStyle style) |
| 11 | : fFlags(kOnePaint_Flag) { |
| 12 | fPaints[0] = p; |
| 13 | |
| 14 | for (int i = 0; i < 4; ++i) { |
| 15 | fWidths[i] = width; |
| 16 | fStyles[i] = style; |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | SkBorder::SkBorder(const SkPaint paints[4], |
skia.committer@gmail.com | 63ba319 | 2013-12-11 07:02:06 +0000 | [diff] [blame] | 21 | const SkScalar widths[4], |
| 22 | const BorderStyle styles[4]) |
robertphillips@google.com | 42cc237 | 2013-12-10 15:19:32 +0000 | [diff] [blame] | 23 | : fFlags(0) { |
| 24 | for (int i = 0; i < 4; ++i) { |
| 25 | fPaints[i] = paints[i]; |
| 26 | } |
| 27 | |
| 28 | memcpy(fWidths, widths, sizeof(fWidths)); |
| 29 | memcpy(fStyles, styles, sizeof(fStyles)); |
| 30 | } |