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

Side by Side Diff: src/core/SkDrawProcs.h

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/core/SkDraw.cpp ('k') | src/gpu/GrAAHairLinePathRenderer.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #ifndef SkDrawProcs_DEFINED 8 #ifndef SkDrawProcs_DEFINED
9 #define SkDrawProcs_DEFINED 9 #define SkDrawProcs_DEFINED
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 /** 68 /**
69 * Scale glyphs to get different point sizes 69 * Scale glyphs to get different point sizes
70 */ 70 */
71 kUseScaledGlyphs_Flag = 0x2, 71 kUseScaledGlyphs_Flag = 0x2,
72 }; 72 };
73 73
74 static const int kBaseDFFontSize = 32; 74 static const int kBaseDFFontSize = 32;
75 #endif 75 #endif
76 }; 76 };
77 77
78 bool SkDrawTreatAAStrokeAsHairline(SkScalar strokeWidth, const SkMatrix&,
79 SkScalar* coverage);
80
78 /** 81 /**
79 * If the current paint is set to stroke and the stroke-width when applied to 82 * If the current paint is set to stroke and the stroke-width when applied to
80 * the matrix is <= 1.0, then this returns true, and sets coverage (simulating 83 * the matrix is <= 1.0, then this returns true, and sets coverage (simulating
81 * a stroke by drawing a hairline with partial coverage). If any of these 84 * a stroke by drawing a hairline with partial coverage). If any of these
82 * conditions are false, then this returns false and coverage is ignored. 85 * conditions are false, then this returns false and coverage is ignored.
83 */ 86 */
84 bool SkDrawTreatAsHairline(const SkPaint&, const SkMatrix&, SkScalar* coverage); 87 inline bool SkDrawTreatAsHairline(const SkPaint& paint, const SkMatrix& matrix,
88 SkScalar* coverage) {
89 if (SkPaint::kStroke_Style != paint.getStyle()) {
90 return false;
91 }
92
93 SkScalar strokeWidth = paint.getStrokeWidth();
94 if (0 == strokeWidth) {
95 *coverage = SK_Scalar1;
96 return true;
97 }
98
99 if (!paint.isAntiAlias()) {
100 return false;
101 }
102
103 return SkDrawTreatAAStrokeAsHairline(strokeWidth, matrix, coverage);
104 }
85 105
86 #endif 106 #endif
OLDNEW
« no previous file with comments | « src/core/SkDraw.cpp ('k') | src/gpu/GrAAHairLinePathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698