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

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

Issue 1943973002: Revert of Make GrStyle more sk_sp savy (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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 | « src/gpu/GrStyle.h ('k') | no next file » | 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 void GrStyle::initPathEffect(sk_sp<SkPathEffect> pe) { 10 void GrStyle::initPathEffect(SkPathEffect* pe) {
11 if (!pe) { 11 if (!pe) {
12 fDashInfo.fType = SkPathEffect::kNone_DashType; 12 fDashInfo.fType = SkPathEffect::kNone_DashType;
13 return; 13 return;
14 } 14 }
15 SkPathEffect::DashInfo info; 15 SkPathEffect::DashInfo info;
16 if (SkPathEffect::kDash_DashType == pe->asADash(&info)) { 16 if (SkPathEffect::kDash_DashType == pe->asADash(&info)) {
17 if (fStrokeRec.getStyle() == SkStrokeRec::kFill_Style) { 17 if (fStrokeRec.getStyle() == SkStrokeRec::kFill_Style) {
18 fPathEffect.reset(nullptr); 18 fPathEffect.reset(nullptr);
19 } else { 19 } else {
20 fPathEffect = std::move(pe); 20 fPathEffect.reset(SkSafeRef(pe));
21 fDashInfo.fType = SkPathEffect::kDash_DashType; 21 fDashInfo.fType = SkPathEffect::kDash_DashType;
22 fDashInfo.fIntervals.reset(info.fCount); 22 fDashInfo.fIntervals.reset(info.fCount);
23 fDashInfo.fPhase = info.fPhase; 23 fDashInfo.fPhase = info.fPhase;
24 info.fIntervals = fDashInfo.fIntervals.get(); 24 info.fIntervals = fDashInfo.fIntervals.get();
25 pe->asADash(&info); 25 pe->asADash(&info);
26 return; 26 return;
27 } 27 }
28 } else { 28 } else {
29 fPathEffect = std::move(pe); 29 fPathEffect.reset(SkSafeRef(pe));
30 } 30 }
31 fDashInfo.fType = SkPathEffect::kNone_DashType; 31 fDashInfo.fType = SkPathEffect::kNone_DashType;
32 fDashInfo.fIntervals.reset(0); 32 fDashInfo.fIntervals.reset(0);
33 } 33 }
OLDNEW
« no previous file with comments | « src/gpu/GrStyle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698