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

Unified Diff: src/gpu/GrStyle.cpp

Issue 1822723003: Add initial implementation of GrShape and GrStyle classes and tests (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Fix dumb SkDEBUGCODE mistake Created 4 years, 8 months 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
« no previous file with comments | « src/gpu/GrStyle.h ('k') | tests/GrShapeTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrStyle.cpp
diff --git a/src/gpu/GrStyle.cpp b/src/gpu/GrStyle.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..40a148bb4a9c6e88063d064aa3232ef6fda50202
--- /dev/null
+++ b/src/gpu/GrStyle.cpp
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "GrStyle.h"
+
+void GrStyle::initPathEffect(SkPathEffect* pe) {
+ if (!pe) {
+ fDashInfo.fType = SkPathEffect::kNone_DashType;
+ return;
+ }
+ SkPathEffect::DashInfo info;
+ if (SkPathEffect::kDash_DashType == pe->asADash(&info)) {
+ if (fStrokeRec.getStyle() == SkStrokeRec::kFill_Style) {
+ fPathEffect.reset(nullptr);
+ } else {
+ fPathEffect.reset(SkSafeRef(pe));
+ fDashInfo.fType = SkPathEffect::kDash_DashType;
+ fDashInfo.fIntervals.reset(info.fCount);
+ fDashInfo.fPhase = info.fPhase;
+ info.fIntervals = fDashInfo.fIntervals.get();
+ pe->asADash(&info);
+ return;
+ }
+ } else {
+ fPathEffect.reset(SkSafeRef(pe));
+ }
+ fDashInfo.fType = SkPathEffect::kNone_DashType;
+ fDashInfo.fIntervals.reset(0);
+}
« no previous file with comments | « src/gpu/GrStyle.h ('k') | tests/GrShapeTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698