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

Unified Diff: src/gpu/SkGpuDevice.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: Created 7 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698