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

Side by Side Diff: src/core/SkStrokeRec.cpp

Issue 1128113008: Make GrStrokeInfo inherit from SkStrokeRec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address review comments Created 5 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 | « include/core/SkStrokeRec.h ('k') | src/gpu/GrAADistanceFieldPathRenderer.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 2012 Google Inc. 2 * Copyright 2012 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 "SkStrokeRec.h" 8 #include "SkStrokeRec.h"
9 #include "SkPaintDefaults.h" 9 #include "SkPaintDefaults.h"
10 10
11 // must be < 0, since ==0 means hairline, and >0 means normal stroke 11 // must be < 0, since ==0 means hairline, and >0 means normal stroke
12 #define kStrokeRec_FillStyleWidth (-SK_Scalar1) 12 #define kStrokeRec_FillStyleWidth (-SK_Scalar1)
13 13
14 SkStrokeRec::SkStrokeRec(InitStyle s) { 14 SkStrokeRec::SkStrokeRec(InitStyle s) {
15 fResScale = 1; 15 fResScale = 1;
16 fWidth = (kFill_InitStyle == s) ? kStrokeRec_FillStyleWidth : 0; 16 fWidth = (kFill_InitStyle == s) ? kStrokeRec_FillStyleWidth : 0;
17 fMiterLimit = SkPaintDefaults_MiterLimit; 17 fMiterLimit = SkPaintDefaults_MiterLimit;
18 fCap = SkPaint::kDefault_Cap; 18 fCap = SkPaint::kDefault_Cap;
19 fJoin = SkPaint::kDefault_Join; 19 fJoin = SkPaint::kDefault_Join;
20 fStrokeAndFill = false; 20 fStrokeAndFill = false;
21 } 21 }
22 22
23 SkStrokeRec::SkStrokeRec(const SkStrokeRec& src) {
24 memcpy(this, &src, sizeof(src));
25 }
26
27 SkStrokeRec::SkStrokeRec(const SkPaint& paint, SkScalar resScale) { 23 SkStrokeRec::SkStrokeRec(const SkPaint& paint, SkScalar resScale) {
28 this->init(paint, paint.getStyle(), resScale); 24 this->init(paint, paint.getStyle(), resScale);
29 } 25 }
30 26
31 SkStrokeRec::SkStrokeRec(const SkPaint& paint, SkPaint::Style styleOverride, SkS calar resScale) { 27 SkStrokeRec::SkStrokeRec(const SkPaint& paint, SkPaint::Style styleOverride, SkS calar resScale) {
32 this->init(paint, styleOverride, resScale); 28 this->init(paint, styleOverride, resScale);
33 } 29 }
34 30
35 void SkStrokeRec::init(const SkPaint& paint, SkPaint::Style style, SkScalar resS cale) { 31 void SkStrokeRec::init(const SkPaint& paint, SkPaint::Style style, SkScalar resS cale) {
36 fResScale = resScale; 32 fResScale = resScale;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 paint->setStyle(SkPaint::kFill_Style); 127 paint->setStyle(SkPaint::kFill_Style);
132 return; 128 return;
133 } 129 }
134 130
135 paint->setStyle(fStrokeAndFill ? SkPaint::kStrokeAndFill_Style : SkPaint::kS troke_Style); 131 paint->setStyle(fStrokeAndFill ? SkPaint::kStrokeAndFill_Style : SkPaint::kS troke_Style);
136 paint->setStrokeWidth(fWidth); 132 paint->setStrokeWidth(fWidth);
137 paint->setStrokeMiter(fMiterLimit); 133 paint->setStrokeMiter(fMiterLimit);
138 paint->setStrokeCap(fCap); 134 paint->setStrokeCap(fCap);
139 paint->setStrokeJoin(fJoin); 135 paint->setStrokeJoin(fJoin);
140 } 136 }
OLDNEW
« no previous file with comments | « include/core/SkStrokeRec.h ('k') | src/gpu/GrAADistanceFieldPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698