Chromium Code Reviews| Index: src/gpu/SkGpuDevice.cpp |
| diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp |
| index 6617989848771e231c7141dd16c4b458b3adad05..2ba5ddfab2969dc5b58991643a5c9946e99a397a 100644 |
| --- a/src/gpu/SkGpuDevice.cpp |
| +++ b/src/gpu/SkGpuDevice.cpp |
| @@ -12,7 +12,8 @@ |
| #include "GrContext.h" |
| #include "GrBitmapTextContext.h" |
| - |
| +#include "GrGpu.h" |
| +#include "GrDrawTargetCaps.h" |
| #include "SkGrTexturePixelRef.h" |
| #include "SkColorFilter.h" |
| @@ -855,6 +856,11 @@ SkBitmap wrap_texture(GrTexture* texture) { |
| return result; |
| } |
| +bool treat_paint_as_hairline(const SkPaint& paint, const GrContext* context, SkScalar* hairlineCoverage) { |
|
bsalomon
2013/10/24 13:28:36
Kimmo, maybe we can do this check from GrContext::
Kimmo Kinnunen
2013/10/30 09:33:41
Done.
|
| + return !context->getGpu()->caps()->pathRenderingSupport() && |
| + SkDrawTreatAsHairline(paint, context->getMatrix(), hairlineCoverage); |
| +} |
| + |
| }; |
| void SkGpuDevice::drawPath(const SkDraw& draw, const SkPath& origSrcPath, |
| @@ -871,7 +877,7 @@ void SkGpuDevice::drawPath(const SkDraw& draw, const SkPath& origSrcPath, |
| // can we cheat, and treat a thin stroke as a hairline w/ coverage |
| // if we can, we draw lots faster (raster device does this same test) |
| SkScalar hairlineCoverage; |
| - bool doHairLine = SkDrawTreatAsHairline(paint, fContext->getMatrix(), &hairlineCoverage); |
| + bool doHairLine = treat_paint_as_hairline(paint, fContext, &hairlineCoverage); |
| if (doHairLine) { |
| grPaint.setCoverage(SkScalarRoundToInt(hairlineCoverage * grPaint.getCoverage())); |
| } |