Index: src/gpu/GrStencilAndCoverTextContext.cpp |
diff --git a/src/gpu/GrStencilAndCoverTextContext.cpp b/src/gpu/GrStencilAndCoverTextContext.cpp |
index cfcabe923f2b96c6b23149f6783b653c77360fb7..1941fa7afc7db8d4ebad44059d9137eaab4fe6b7 100644 |
--- a/src/gpu/GrStencilAndCoverTextContext.cpp |
+++ b/src/gpu/GrStencilAndCoverTextContext.cpp |
@@ -28,6 +28,30 @@ GrStencilAndCoverTextContext::GrStencilAndCoverTextContext( |
GrStencilAndCoverTextContext::~GrStencilAndCoverTextContext() { |
} |
+bool GrStencilAndCoverTextContext::canDraw(const SkPaint& paint) { |
+ if (paint.getRasterizer()) { |
+ return false; |
+ } |
+ if (paint.getMaskFilter()) { |
+ return false; |
+ } |
+ if (paint.getPathEffect()) { |
+ return false; |
+ } |
+ |
+ // No hairlines unless we can map the 1 px width to the object space. |
+ if (paint.getStyle() == SkPaint::kStroke_Style |
+ && paint.getStrokeWidth() == 0 |
+ && fContext->getMatrix().hasPerspective()) { |
+ return false; |
+ } |
+ |
+ // No color bitmap fonts. |
+ SkScalerContext::Rec rec; |
+ SkScalerContext::MakeRec(paint, &fDeviceProperties, NULL, &rec); |
+ return rec.getFormat() != SkMask::kARGB32_Format; |
+} |
+ |
void GrStencilAndCoverTextContext::drawText(const GrPaint& paint, |
const SkPaint& skPaint, |
const char text[], |
@@ -189,30 +213,6 @@ void GrStencilAndCoverTextContext::drawPosText(const GrPaint& paint, |
this->finish(); |
} |
-bool GrStencilAndCoverTextContext::canDraw(const SkPaint& paint) { |
- if (paint.getRasterizer()) { |
- return false; |
- } |
- if (paint.getMaskFilter()) { |
- return false; |
- } |
- if (paint.getPathEffect()) { |
- return false; |
- } |
- |
- // No hairlines unless we can map the 1 px width to the object space. |
- if (paint.getStyle() == SkPaint::kStroke_Style |
- && paint.getStrokeWidth() == 0 |
- && fContext->getMatrix().hasPerspective()) { |
- return false; |
- } |
- |
- // No color bitmap fonts. |
- SkScalerContext::Rec rec; |
- SkScalerContext::MakeRec(paint, &fDeviceProperties, NULL, &rec); |
- return rec.getFormat() != SkMask::kARGB32_Format; |
-} |
- |
static GrPathRange* get_gr_glyphs(GrContext* ctx, |
const SkTypeface* typeface, |
const SkDescriptor* desc, |