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

Side by Side Diff: src/gpu/GrStyle.cpp

Issue 2048183002: Make SkDashPathEffect fail for stroke+fill style (in addition to fill style) (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/utils/SkDashPath.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrStyle.h" 8 #include "GrStyle.h"
9 9
10 int GrStyle::KeySize(const GrStyle &style, Apply apply, uint32_t flags) { 10 int GrStyle::KeySize(const GrStyle &style, Apply apply, uint32_t flags) {
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 void GrStyle::initPathEffect(SkPathEffect* pe) { 100 void GrStyle::initPathEffect(SkPathEffect* pe) {
101 SkASSERT(!fPathEffect) 101 SkASSERT(!fPathEffect)
102 SkASSERT(SkPathEffect::kNone_DashType == fDashInfo.fType); 102 SkASSERT(SkPathEffect::kNone_DashType == fDashInfo.fType);
103 SkASSERT(0 == fDashInfo.fIntervals.count()); 103 SkASSERT(0 == fDashInfo.fIntervals.count());
104 if (!pe) { 104 if (!pe) {
105 return; 105 return;
106 } 106 }
107 SkPathEffect::DashInfo info; 107 SkPathEffect::DashInfo info;
108 if (SkPathEffect::kDash_DashType == pe->asADash(&info)) { 108 if (SkPathEffect::kDash_DashType == pe->asADash(&info)) {
109 if (fStrokeRec.getStyle() != SkStrokeRec::kFill_Style) { 109 SkStrokeRec::Style recStyle = fStrokeRec.getStyle();
110 if (recStyle != SkStrokeRec::kFill_Style && recStyle != SkStrokeRec::kSt rokeAndFill_Style) {
110 fDashInfo.fType = SkPathEffect::kDash_DashType; 111 fDashInfo.fType = SkPathEffect::kDash_DashType;
111 fDashInfo.fIntervals.reset(info.fCount); 112 fDashInfo.fIntervals.reset(info.fCount);
112 fDashInfo.fPhase = info.fPhase; 113 fDashInfo.fPhase = info.fPhase;
113 info.fIntervals = fDashInfo.fIntervals.get(); 114 info.fIntervals = fDashInfo.fIntervals.get();
114 pe->asADash(&info); 115 pe->asADash(&info);
115 fPathEffect.reset(SkSafeRef(pe)); 116 fPathEffect.reset(SkSafeRef(pe));
116 } 117 }
117 } else { 118 } else {
118 fPathEffect.reset(SkSafeRef(pe)); 119 fPathEffect.reset(SkSafeRef(pe));
119 } 120 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 return false; 166 return false;
166 } else { 167 } else {
167 SkASSERT(SkStrokeRec::kFill_Style == strokeRec.getStyle() || 168 SkASSERT(SkStrokeRec::kFill_Style == strokeRec.getStyle() ||
168 SkStrokeRec::kHairline_Style == strokeRec.getStyle()); 169 SkStrokeRec::kHairline_Style == strokeRec.getStyle());
169 *style = strokeRec.getStyle() == SkStrokeRec::kFill_Style 170 *style = strokeRec.getStyle() == SkStrokeRec::kFill_Style
170 ? SkStrokeRec::kFill_InitStyle 171 ? SkStrokeRec::kFill_InitStyle
171 : SkStrokeRec::kHairline_InitStyle; 172 : SkStrokeRec::kHairline_InitStyle;
172 } 173 }
173 return true; 174 return true;
174 } 175 }
OLDNEW
« no previous file with comments | « no previous file | src/utils/SkDashPath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698