aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-03-05 16:01:18 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-03-05 16:01:18 +0000
commit8c0a0d36541d8385b3e8bddea802c5542800c9a4 (patch)
tree40b3cdd52a5a57d46b88cf54253361ae14802d8c
parent10bfeb4a7b714acda10cc362ba87a23f28638281 (diff)
Avoid hairline coverage mul when possible
Review URL: http://codereview.appspot.com/5727062/ git-svn-id: http://skia.googlecode.com/svn/trunk@3315 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--src/gpu/SkGpuDevice.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index af59699654..0ea34528e2 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1110,13 +1110,6 @@ void SkGpuDevice::drawPath(const SkDraw& draw, const SkPath& origSrcPath,
bool doFill = true;
- SkScalar coverage = SK_Scalar1;
- // can we cheat, and threat a thin stroke as a hairline w/ coverage
- // if we can, we draw lots faster (raster device does this same test)
- if (SkDrawTreatAsHairline(paint, *draw.fMatrix, &coverage)) {
- doFill = false;
- }
-
GrPaint grPaint;
SkAutoCachedTexture act;
if (!this->skPaint2GrPaintShader(paint,
@@ -1127,7 +1120,14 @@ void SkGpuDevice::drawPath(const SkDraw& draw, const SkPath& origSrcPath,
return;
}
- grPaint.fCoverage = SkScalarRoundToInt(coverage * grPaint.fCoverage);
+ // can we cheat, and threat a thin stroke as a hairline w/ coverage
+ // if we can, we draw lots faster (raster device does this same test)
+ SkScalar hairlineCoverage;
+ if (SkDrawTreatAsHairline(paint, *draw.fMatrix, &hairlineCoverage)) {
+ doFill = false;
+ grPaint.fCoverage = SkScalarRoundToInt(hairlineCoverage *
+ grPaint.fCoverage);
+ }
// If we have a prematrix, apply it to the path, optimizing for the case
// where the original path can in fact be modified in place (even though