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

Unified Diff: src/core/SkStrokeRec.cpp

Issue 932113002: Revive quad approximation stroker (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add macro to suppress uninitialized warning Created 5 years, 10 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/core/SkStroke.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkStrokeRec.cpp
diff --git a/src/core/SkStrokeRec.cpp b/src/core/SkStrokeRec.cpp
index c25a652a88e8fe4dc1aa4f3c9f7521419e583bc4..2ca7efd7033198c5c8cf3051e4d6cdc3bb25fba8 100644
--- a/src/core/SkStrokeRec.cpp
+++ b/src/core/SkStrokeRec.cpp
@@ -100,6 +100,12 @@ void SkStrokeRec::setStrokeStyle(SkScalar width, bool strokeAndFill) {
#include "SkStroke.h"
+#if defined SK_QUAD_STROKE_APPROXIMATION && defined SK_DEBUG
+ // enables tweaking these values at runtime from SampleApp
+ bool gDebugStrokerErrorSet = false;
+ SkScalar gDebugStrokerError;
+#endif
+
bool SkStrokeRec::applyToPath(SkPath* dst, const SkPath& src) const {
if (fWidth <= 0) { // hairline or fill
return false;
@@ -111,9 +117,10 @@ bool SkStrokeRec::applyToPath(SkPath* dst, const SkPath& src) const {
stroker.setMiterLimit(fMiterLimit);
stroker.setWidth(fWidth);
stroker.setDoFill(fStrokeAndFill);
+#if defined SK_QUAD_STROKE_APPROXIMATION && defined SK_DEBUG
+ stroker.setResScale(gDebugStrokerErrorSet ? gDebugStrokerError : fResScale);
+#else
stroker.setResScale(fResScale);
-#if QUAD_STROKE_APPROXIMATION
- stroker.setError(1);
#endif
stroker.strokePath(src, dst);
return true;
« no previous file with comments | « src/core/SkStroke.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698