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

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

Issue 1048333003: Set resScale on stroker when stroking path on gpu. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 unified diff | Download patch
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
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 void SkStrokeRec::setStrokeStyle(SkScalar width, bool strokeAndFill) { 91 void SkStrokeRec::setStrokeStyle(SkScalar width, bool strokeAndFill) {
92 if (strokeAndFill && (0 == width)) { 92 if (strokeAndFill && (0 == width)) {
93 // hairline+fill == fill 93 // hairline+fill == fill
94 this->setFillStyle(); 94 this->setFillStyle();
95 } else { 95 } else {
96 fWidth = width; 96 fWidth = width;
97 fStrokeAndFill = strokeAndFill; 97 fStrokeAndFill = strokeAndFill;
98 } 98 }
99 } 99 }
100 100
101 void SkStrokeRec::setResScale(SkScalar rs) {
102 SkASSERT(rs > 0 && SkScalarIsFinite(rs));
103 fResScale = rs;
104 }
105
101 #include "SkStroke.h" 106 #include "SkStroke.h"
102 107
103 #if !defined SK_LEGACY_STROKE_CURVES && defined SK_DEBUG 108 #if !defined SK_LEGACY_STROKE_CURVES && defined SK_DEBUG
104 // enables tweaking these values at runtime from SampleApp 109 // enables tweaking these values at runtime from SampleApp
105 bool gDebugStrokerErrorSet = false; 110 bool gDebugStrokerErrorSet = false;
106 SkScalar gDebugStrokerError; 111 SkScalar gDebugStrokerError;
107 #endif 112 #endif
108 113
109 bool SkStrokeRec::applyToPath(SkPath* dst, const SkPath& src) const { 114 bool SkStrokeRec::applyToPath(SkPath* dst, const SkPath& src) const {
110 if (fWidth <= 0) { // hairline or fill 115 if (fWidth <= 0) { // hairline or fill
(...skipping 20 matching lines...) Expand all
131 paint->setStyle(SkPaint::kFill_Style); 136 paint->setStyle(SkPaint::kFill_Style);
132 return; 137 return;
133 } 138 }
134 139
135 paint->setStyle(fStrokeAndFill ? SkPaint::kStrokeAndFill_Style : SkPaint::kS troke_Style); 140 paint->setStyle(fStrokeAndFill ? SkPaint::kStrokeAndFill_Style : SkPaint::kS troke_Style);
136 paint->setStrokeWidth(fWidth); 141 paint->setStrokeWidth(fWidth);
137 paint->setStrokeMiter(fMiterLimit); 142 paint->setStrokeMiter(fMiterLimit);
138 paint->setStrokeCap(fCap); 143 paint->setStrokeCap(fCap);
139 paint->setStrokeJoin(fJoin); 144 paint->setStrokeJoin(fJoin);
140 } 145 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698