make gradtext quadpaths gm portable
TBR=reed@google.com Review URL: https://codereview.chromium.org/1234233003
This commit is contained in:
parent
91e51cbd64
commit
5df0575f04
@ -47,7 +47,7 @@ protected:
|
||||
virtual SkISize onISize() { return SkISize::Make(500, 480); }
|
||||
virtual void onDraw(SkCanvas* canvas) {
|
||||
SkPaint paint;
|
||||
sk_tool_utils::set_portable_typeface(&paint);
|
||||
sk_tool_utils::set_portable_typeface_always(&paint);
|
||||
SkRect r = SkRect::MakeWH(SkIntToScalar(100), SkIntToScalar(100));
|
||||
|
||||
canvas->clipRect(r);
|
||||
@ -66,7 +66,7 @@ private:
|
||||
};
|
||||
|
||||
|
||||
// Replicate chrome layout test - switching between solid & gadient text
|
||||
// Replicate chrome layout test - switching between solid & gradient text
|
||||
class ChromeGradTextGM2 : public GM {
|
||||
public:
|
||||
ChromeGradTextGM2() { }
|
||||
@ -76,7 +76,7 @@ protected:
|
||||
virtual SkISize onISize() { return SkISize::Make(500, 480); }
|
||||
virtual void onDraw(SkCanvas* canvas) {
|
||||
SkPaint paint;
|
||||
sk_tool_utils::set_portable_typeface(&paint);
|
||||
sk_tool_utils::set_portable_typeface_always(&paint);
|
||||
|
||||
paint.setStyle(SkPaint::kFill_Style);
|
||||
canvas->drawText("Normal Fill Text", 16, 0, 50, paint);
|
||||
@ -129,7 +129,7 @@ protected:
|
||||
|
||||
void onDraw(SkCanvas* canvas) override {
|
||||
SkPaint paint;
|
||||
sk_tool_utils::set_portable_typeface(&paint);
|
||||
sk_tool_utils::set_portable_typeface_always(&paint);
|
||||
paint.setTextSize(SkIntToScalar(26));
|
||||
|
||||
const SkISize& size = this->getISize();
|
||||
|
@ -83,8 +83,7 @@ protected:
|
||||
SkPaint titlePaint;
|
||||
titlePaint.setColor(SK_ColorBLACK);
|
||||
titlePaint.setAntiAlias(true);
|
||||
sk_tool_utils::set_portable_typeface(&titlePaint);
|
||||
titlePaint.setLCDRenderText(true);
|
||||
sk_tool_utils::set_portable_typeface_always(&titlePaint);
|
||||
titlePaint.setTextSize(15 * SK_Scalar1);
|
||||
const char title[] = "Quad Drawn Into Rectangle Clips With "
|
||||
"Indicated Style, Fill and Linecaps, with stroke width 10";
|
||||
@ -113,7 +112,7 @@ protected:
|
||||
canvas->translate(rect.width() + 40 * SK_Scalar1, 0);
|
||||
}
|
||||
|
||||
SkColor color = 0xff007000;
|
||||
SkColor color = sk_tool_utils::color_to_565(0xff007000);
|
||||
this->drawPath(path.fPath, canvas, color, rect,
|
||||
gCaps[cap].fCap, gCaps[cap].fJoin, gStyles[style].fStyle,
|
||||
gFills[fill].fFill, SK_Scalar1*10);
|
||||
@ -128,8 +127,7 @@ protected:
|
||||
SkPaint labelPaint;
|
||||
labelPaint.setColor(color);
|
||||
labelPaint.setAntiAlias(true);
|
||||
sk_tool_utils::set_portable_typeface(&labelPaint);
|
||||
labelPaint.setLCDRenderText(true);
|
||||
sk_tool_utils::set_portable_typeface_always(&labelPaint);
|
||||
labelPaint.setTextSize(10 * SK_Scalar1);
|
||||
canvas->drawText(gStyles[style].fName,
|
||||
strlen(gStyles[style].fName),
|
||||
@ -229,8 +227,7 @@ protected:
|
||||
SkPaint titlePaint;
|
||||
titlePaint.setColor(SK_ColorBLACK);
|
||||
titlePaint.setAntiAlias(true);
|
||||
sk_tool_utils::set_portable_typeface(&titlePaint);
|
||||
titlePaint.setLCDRenderText(true);
|
||||
sk_tool_utils::set_portable_typeface_always(&titlePaint);
|
||||
titlePaint.setTextSize(15 * SK_Scalar1);
|
||||
const char title[] = "Quad Closed Drawn Into Rectangle Clips With "
|
||||
"Indicated Style, Fill and Linecaps, with stroke width 10";
|
||||
@ -259,7 +256,7 @@ protected:
|
||||
canvas->translate(rect.width() + 40 * SK_Scalar1, 0);
|
||||
}
|
||||
|
||||
SkColor color = 0xff007000;
|
||||
SkColor color = sk_tool_utils::color_to_565(0xff007000);
|
||||
this->drawPath(path.fPath, canvas, color, rect,
|
||||
gCaps[cap].fCap, gCaps[cap].fJoin, gStyles[style].fStyle,
|
||||
gFills[fill].fFill, SK_Scalar1*10);
|
||||
@ -274,8 +271,7 @@ protected:
|
||||
SkPaint labelPaint;
|
||||
labelPaint.setColor(color);
|
||||
labelPaint.setAntiAlias(true);
|
||||
sk_tool_utils::set_portable_typeface(&labelPaint);
|
||||
labelPaint.setLCDRenderText(true);
|
||||
sk_tool_utils::set_portable_typeface_always(&labelPaint);
|
||||
labelPaint.setTextSize(10 * SK_Scalar1);
|
||||
canvas->drawText(gStyles[style].fName,
|
||||
strlen(gStyles[style].fName),
|
||||
|
Loading…
Reference in New Issue
Block a user