Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Unified Diff: experimental/ChromeUtils/SkBorder.cpp

Issue 86263003: New Composite CSS border object (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Moved to experimental Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: experimental/ChromeUtils/SkBorder.cpp
===================================================================
--- experimental/ChromeUtils/SkBorder.cpp (revision 0)
+++ experimental/ChromeUtils/SkBorder.cpp (revision 0)
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2013 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "SkBorder.h"
+
+SkBorder::SkBorder(SkPaint& p, SkScalar width, BorderStyle style)
+ : fFlags(kOnePaint_Flag) {
+ fPaints[0] = p;
+
+ for (int i = 0; i < 4; ++i) {
+ fWidths[i] = width;
+ fStyles[i] = style;
+ }
+}
+
+SkBorder::SkBorder(const SkPaint paints[4],
+ const SkScalar widths[4],
+ const BorderStyle styles[4])
+ : fFlags(0) {
+ for (int i = 0; i < 4; ++i) {
+ fPaints[i] = paints[i];
+ }
+
+ memcpy(fWidths, widths, sizeof(fWidths));
+ memcpy(fStyles, styles, sizeof(fStyles));
+}
+
Property changes on: experimental\ChromeUtils\SkBorder.cpp
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698