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

Unified Diff: src/core/SkDraw.cpp

Issue 38573007: Do not apply hairline optimization for paths if nv_path_rendering is used (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: address problems Created 7 years, 1 month 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 | « no previous file | src/core/SkDrawProcs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkDraw.cpp
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index 8557a5190bdf29c15bfc9a6629ae59b438613e85..2d142cf1e5d214e83ac7662ab97e8a50ed964d16 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -988,24 +988,11 @@ static bool xfermodeSupportsCoverageAsAlpha(SkXfermode* xfer) {
}
}
-bool SkDrawTreatAsHairline(const SkPaint& paint, const SkMatrix& matrix,
- SkScalar* coverage) {
- SkASSERT(coverage);
- if (SkPaint::kStroke_Style != paint.getStyle()) {
- return false;
- }
- SkScalar strokeWidth = paint.getStrokeWidth();
- if (0 == strokeWidth) {
- *coverage = SK_Scalar1;
- return true;
- }
+bool SkDrawTreatAAStrokeAsHairline(SkScalar strokeWidth, const SkMatrix& matrix,
+ SkScalar* coverage) {
+ SkASSERT(strokeWidth > 0);
+ // We need to try to fake a thick-stroke with a modulated hairline.
- // if we get here, we need to try to fake a thick-stroke with a modulated
- // hairline
-
- if (!paint.isAntiAlias()) {
- return false;
- }
if (matrix.hasPerspective()) {
return false;
}
@@ -1017,7 +1004,9 @@ bool SkDrawTreatAsHairline(const SkPaint& paint, const SkMatrix& matrix,
SkScalar len0 = fast_len(dst[0]);
SkScalar len1 = fast_len(dst[1]);
if (len0 <= SK_Scalar1 && len1 <= SK_Scalar1) {
- *coverage = SkScalarAve(len0, len1);
+ if (NULL != coverage) {
+ *coverage = SkScalarAve(len0, len1);
+ }
return true;
}
return false;
« no previous file with comments | « no previous file | src/core/SkDrawProcs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698