blob: fad27210fc24aacee3ba126fdd2af29e7bb45b71 [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],
skia.committer@gmail.com63ba3192013-12-11 07:02:06 +000021 const SkScalar widths[4],
22 const BorderStyle styles[4])
robertphillips@google.com42cc2372013-12-10 15:19:32 +000023 : 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}