blob: f6caa5796ae1f463d39c3a5fdc7cabd9b4a248ef [file] [log] [blame]
robertphillips@google.com42cc2372013-12-10 15:19:32 +00001/*
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
10SkBorder::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
20SkBorder::SkBorder(const SkPaint paints[4],
21 const SkScalar widths[4],
22 const BorderStyle styles[4])
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}
31