Add test of tiny text with perspective.
There is an issue with rendering tiny text with SDFs, and it's unclear which platforms this occurs on. Adding this to the GM will make it clearer. Bug: skia:8042 Change-Id: I0596c8e17a3b3cc7d6b51bef33097cfaba3bc64e Reviewed-on: https://skia-review.googlesource.com/132823 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
This commit is contained in:
parent
18562b8adb
commit
2525a37c08
@ -179,12 +179,45 @@ protected:
|
|||||||
canvas->drawText(text, textLen, 580, 125, paint);
|
canvas->drawText(text, textLen, 580, 125, paint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check perspective
|
||||||
|
{
|
||||||
|
paint.setLCDRenderText(false);
|
||||||
|
SkAutoCanvasRestore acr(canvas, true);
|
||||||
|
SkMatrix persp;
|
||||||
|
persp.setAll(0.9839f, 0, 0,
|
||||||
|
0.2246f, 0.6829f, 0,
|
||||||
|
0.0002352f, -0.0003844f, 1);
|
||||||
|
canvas->concat(persp);
|
||||||
|
canvas->translate(1100, -295);
|
||||||
|
canvas->scale(375, 375);
|
||||||
|
paint.setTextSize(0.1f);
|
||||||
|
canvas->drawText(text, textLen, 0, 0, paint);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
paint.setSubpixelText(false);
|
||||||
|
paint.setAntiAlias(false);
|
||||||
|
SkAutoCanvasRestore acr(canvas, true);
|
||||||
|
SkMatrix persp;
|
||||||
|
persp.setAll(0.9839f, 0, 0,
|
||||||
|
0.2246f, 0.6829f, 0,
|
||||||
|
0.0002352f, -0.0003844f, 1);
|
||||||
|
canvas->concat(persp);
|
||||||
|
canvas->translate(1075, -245);
|
||||||
|
canvas->scale(375, 375);
|
||||||
|
paint.setTextSize(0.1f);
|
||||||
|
canvas->drawText(text, textLen, 0, 0, paint);
|
||||||
|
}
|
||||||
|
|
||||||
// check color emoji
|
// check color emoji
|
||||||
if (fEmojiTypeface) {
|
if (fEmojiTypeface) {
|
||||||
paint.setTypeface(fEmojiTypeface);
|
SkPaint emojiPaint;
|
||||||
paint.setTextSize(SkIntToScalar(19));
|
emojiPaint.setSubpixelText(true);
|
||||||
canvas->drawString(fEmojiText, 670, 90, paint);
|
emojiPaint.setAntiAlias(true);
|
||||||
|
emojiPaint.setTypeface(fEmojiTypeface);
|
||||||
|
emojiPaint.setTextSize(SkIntToScalar(19));
|
||||||
|
canvas->drawString(fEmojiText, 670, 90, emojiPaint);
|
||||||
}
|
}
|
||||||
|
|
||||||
// render offscreen buffer
|
// render offscreen buffer
|
||||||
if (surface) {
|
if (surface) {
|
||||||
SkAutoCanvasRestore acr(inputCanvas, true);
|
SkAutoCanvasRestore acr(inputCanvas, true);
|
||||||
|
Loading…
Reference in New Issue
Block a user