Lines Matching refs:paint
13 static bool is_use_nonlinear_metrics(const SkPaint& paint) { in is_use_nonlinear_metrics() argument
14 return !paint.isSubpixelText() && !paint.isLinearText(); in is_use_nonlinear_metrics()
17 static bool is_enable_auto_hints(const SkPaint& paint) { in is_enable_auto_hints() argument
18 return paint.isAutohinted(); in is_enable_auto_hints()
21 static bool is_enable_bytecode_hints(const SkPaint& paint) { in is_enable_bytecode_hints() argument
22 return paint.getHinting() >= SkPaint::kFull_Hinting; in is_enable_bytecode_hints()
25 static void test_cachedfont(skiatest::Reporter* reporter, const SkPaint& paint) { in test_cachedfont() argument
26 SkAutoTUnref<SkFont> font(SkFont::Testing_CreateFromPaint(paint)); in test_cachedfont()
29 if (paint.getTypeface()) { in test_cachedfont()
30 REPORTER_ASSERT(reporter, font->getTypeface() == paint.getTypeface()); in test_cachedfont()
32 REPORTER_ASSERT(reporter, font->getSize() == paint.getTextSize()); in test_cachedfont()
33 REPORTER_ASSERT(reporter, font->getScaleX() == paint.getTextScaleX()); in test_cachedfont()
34 REPORTER_ASSERT(reporter, font->getSkewX() == paint.getTextSkewX()); in test_cachedfont()
36 REPORTER_ASSERT(reporter, font->isVertical() == paint.isVerticalText()); in test_cachedfont()
37 REPORTER_ASSERT(reporter, font->isEmbolden() == paint.isFakeBoldText()); in test_cachedfont()
39 REPORTER_ASSERT(reporter, font->isUseNonLinearMetrics() == is_use_nonlinear_metrics(paint)); in test_cachedfont()
40 REPORTER_ASSERT(reporter, font->isEnableAutoHints() == is_enable_auto_hints(paint)); in test_cachedfont()
41 REPORTER_ASSERT(reporter, font->isEnableByteCodeHints() == is_enable_bytecode_hints(paint)); in test_cachedfont()
77 SkPaint paint; in test_cachedfont() local
82 paint.setTypeface(face); in test_cachedfont()
85 paint.setHinting(settings[j].hinting); in test_cachedfont()
86 paint.setLinearText((settings[j].flags & SkPaint::kLinearText_Flag) != 0); in test_cachedfont()
87 paint.setSubpixelText((settings[j].flags & SkPaint::kSubpixelText_Flag) != 0); in test_cachedfont()
90 paint.setTextScaleX(gScaleRec[k].fScaleX); in test_cachedfont()
91 paint.setTextSkewX(gScaleRec[k].fSkewX); in test_cachedfont()
93 test_cachedfont(reporter, paint); in test_cachedfont()
99 SkScalar width1 = paint.measureText(txt, strlen(txt)); in test_cachedfont()
102 SkScalar width2 = paint.measureText(txt, strlen(txt), &bounds); in test_cachedfont()
106 SkAutoTUnref<SkFont> font(SkFont::Testing_CreateFromPaint(paint)); in test_cachedfont()