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

Unified Diff: src/gpu/GrStencilAndCoverTextContext.cpp

Issue 641613003: Rearrange code in TextContexts to be more consistent. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Some more indention clean up Created 6 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 | « src/gpu/GrStencilAndCoverTextContext.h ('k') | src/gpu/GrTextContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « src/gpu/GrStencilAndCoverTextContext.h ('k') | src/gpu/GrTextContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698